Added ability to handle custom functions to Portal ACP backend;

Removed unneeded language variables from language files; 
Finished global announcements block (basic function); 
Added missing includes in portal.php; 
Added missing handling of top and bottom column; 
Added unset of $template_module in portal.php in order to prevent incorrect block names; 
Added correct title for page_header and language string for Portal link;
This commit is contained in:
Marc Alexander
2010-08-28 18:25:28 +00:00
parent 438a9cdd59
commit 22b7ebab4d
7 changed files with 133 additions and 197 deletions

View File

@@ -56,7 +56,7 @@ class acp_portal
'board3_enable' => array('lang' => 'PORTAL_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_enable' => array('lang' => 'PORTAL_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'board3_left_column' => array('lang' => 'PORTAL_LEFT_COLUMN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_left_column' => array('lang' => 'PORTAL_LEFT_COLUMN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'board3_right_column' => array('lang' => 'PORTAL_RIGHT_COLUMN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_right_column' => array('lang' => 'PORTAL_RIGHT_COLUMN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'board3_version_check' => array('lang' => 'PORTAL_VERSION_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_version_check' => array('lang' => 'PORTAL_VERSION_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'board3_forum_index' => array('lang' => 'PORTAL_FORUM_INDEX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_forum_index' => array('lang' => 'PORTAL_FORUM_INDEX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS', 'legend2' => 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS',
@@ -128,15 +128,27 @@ class acp_portal
// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
foreach ($display_vars['vars'] as $config_name => $null) foreach ($display_vars['vars'] as $config_name => $null)
{ {
if ($submit && $null['type'] == 'custom')
{
$func = array($c_class, $null['submit']);
call_user_func_array($func, $config_name);
}
if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
{ {
continue; continue;
} }
if($null['type'] == 'custom')
{
continue;
}
$this->new_config[$config_name] = $config_value = $cfg_array[$config_name]; $this->new_config[$config_name] = $config_value = $cfg_array[$config_name];
if ($submit) if ($submit)
{ {
set_config($config_name, $config_value); set_config($config_name, $config_value);
} }
} }
@@ -197,7 +209,16 @@ class acp_portal
$l_explain = (isset($user->lang[$vars['lang'] . '_EXP'])) ? $user->lang[$vars['lang'] . '_EXP'] : ''; $l_explain = (isset($user->lang[$vars['lang'] . '_EXP'])) ? $user->lang[$vars['lang'] . '_EXP'] : '';
} }
$content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars); if($vars['type'] != 'custom')
{
$content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars);
}
else
{
$args = array($this->new_config[$config_key], $config_key);
$func = array($c_class, $vars['method']);
$content = call_user_func_array($func, $args);
}
if (empty($content)) if (empty($content))
{ {

View File

@@ -48,41 +48,21 @@ $lang = array_merge($lang, array(
'ACP_PORTAL_GENERAL_INFO' => 'Allgemeine Einstellungen', 'ACP_PORTAL_GENERAL_INFO' => 'Allgemeine Einstellungen',
'ACP_PORTAL_GENERAL_TITLE' => 'Portal Administration', 'ACP_PORTAL_GENERAL_TITLE' => 'Portal Administration',
'ACP_PORTAL_GENERAL_TITLE_EXP' => 'Thank you for choosing Board3 Portal! This is where you can manage your portal page. The options below let you customize the various general settings.', 'ACP_PORTAL_GENERAL_TITLE_EXP' => 'Thank you for choosing Board3 Portal! This is where you can manage your portal page. The options below let you customize the various general settings.',
'PORTAL_ENABLE' => 'Enable Portal',
'BLOCK_ADDED' => 'The block was successfully added.', 'PORTAL_ENABLE_EXP' => 'Turns the whole portal on or off',
'BLOCK_FILENAME' => 'Block template file', 'PORTAL_LEFT_COLUMN' => 'Enable left column',
'BLOCK_FILENAME_EXPLAIN' => 'Use this to define a tempalte file used for the block. The path is relative to the root phpBB directory.', 'PORTAL_LEFT_COLUMN_EXP' => 'Switch to no if you wish to turn off the left column',
'BLOCK_ICON' => 'Block icon', 'PORTAL_RIGHT_COLUMN' => 'Enable right column',
'BLOCK_ICON_EXPLAIN' => 'Use this to define a small icon associated with the block. The path is relative to the root phpBB directory.', 'PORTAL_RIGHT_COLUMN_EXP' => 'Switch to no if you wish to turn off the right column',
'BLOCK_POSITION' => 'Display position', 'PORTAL_VERSION_CHECK' => 'Versioncheck on Portal',
'BLOCK_POSITION_EXPLAIN' => 'Select the display position on index page.', 'PORTAL_FORUM_INDEX' => 'Forum Index (Forum list)',
'BLOCK_POSITION_BOTTOM' => 'Bottom', 'PORTAL_FORUM_INDEX_EXP' => 'Display this block on the portal.',
'BLOCK_POSITION_LEFT' => 'Left', 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS' => 'Left and right column width settings',
'BLOCK_POSITION_MIDDLE_BOTTOM' => 'Middle - Bottom', 'PORTAL_LEFT_COLUMN_WIDTH' => 'Width of the left column',
'BLOCK_POSITION_MIDDLE_TOP' => 'Middle - Top', 'PORTAL_LEFT_COLUMN_WIDTH_EXP' => 'Change the width of the left column in pixels; recommended value is 180',
'BLOCK_POSITION_NONE' => 'Not display', 'PORTAL_RIGHT_COLUMN_WIDTH' => 'Width of the right column',
'BLOCK_POSITION_RIGHT' => 'Right', 'PORTAL_RIGHT_COLUMN_WIDTH_EXP' => 'Change the width of the right column in pixels; recommended value is 180',
'BLOCK_POSITION_TOP' => 'Top',
'BLOCK_REMOVED' => 'The block was successfully deleted.',
'BLOCK_TEXT' => 'Text',
'BLOCK_TEXT_EXPLAIN' => 'Enter here the content of the block text.',
'BLOCK_TITLE' => 'Block title',
'BLOCK_TITLE_EXPLAIN' => 'Enter the displayed block title. Use language constant if name is served from language file: <samp>language/en/mods/portal.php</samp>',
'BLOCK_TYPE' => 'Block type',
'BLOCK_TYPE_EXPLAIN' => 'Select the block type.',
'BLOCK_UPDATED' => 'The block was successfully updated.',
'MUST_SELECT_BLOCK' => 'You must select a block.',
'NO_BLOCK_HTML' => 'You have created block with template file but havent selected a template file for this block.',
'NO_BLOCK_TEXT' => 'You have created custom text block but havent entered the content for this block.',
'NO_BLOCK_TITLE' => 'You havent specified a title for the block.',
'SELECT_BLOCK_FILE' => 'Select a template file…',
'SELECT_BLOCK_ICON' => 'Select an icon…',
'SELECT_BLOCK_CLOCK' => 'Select an clock…',
'SELECT_BLOCK_POSITION' => 'Select a position…',
'SELECT_BLOCK_TYPE' => 'Select a type…',
// Portal Modules // Portal Modules
'ACP_PORTAL_MODULES' => 'Portal Modules', 'ACP_PORTAL_MODULES' => 'Portal Modules',

View File

@@ -33,137 +33,8 @@ if (empty($lang) || !is_array($lang))
// equally where a string contains only two placeholders which are used to wrap text // equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
// Manage categories
$lang = array_merge($lang, array(
'BIRTHDAYS_AHEAD' => 'In den nächsten %s Tagen',
'NO_BIRTHDAYS_AHEAD' => 'In diesem Zeitraum hat kein Mitglied Geburtstag',
));
// Common // Common
$lang = array_merge($lang, array( $lang = array_merge($lang, array(
// ACP - General Settings 'PORTAL' => 'Portal',
'ACP_PORTAL_GENERAL_TITLE' => 'Portal administration',
'ACP_PORTAL_GENERAL_TITLE_EXP' => 'Thank you for choosing Board3 Portal! This is where you can manage your portal page. The options below let you customize the various general settings. The links on the left-hand side allow you to customize in detail every aspect of your portal experience.',
'ACP_PORTAL_GENERAL_SETTINGS' => 'General settings',
'PORTAL_ENABLE' => 'Enable Portal',
'PORTAL_ENABLE_EXP' => 'Turns the whole portal on or off.',
'PORTAL_LEFT_COLUMN' => 'Enable left column',
'PORTAL_LEFT_COLUMN_EXP' => 'Switch to no if you wish to turn off the left column',
'PORTAL_RIGHT_COLUMN' => 'Enable right column',
'PORTAL_RIGHT_COLUMN_EXP' => 'Switch to no if you wish to turn off the right column',
'PORTAL_VERSION_CHECK' => 'Versioncheck on Portal',
'PORTAL_FORUM_INDEX' => 'Forum Index (Forum list)',
'PORTAL_FORUM_INDEX_EXP' => 'Display this block on the portal.',
'ACP_PORTAL_COLUMN_WIDTH_SETTINGS' => 'Left and right column width settings',
'PORTAL_LEFT_COLUMN_WIDTH' => 'Width of the left column',
'PORTAL_LEFT_COLUMN_WIDTH_EXP' => 'Change the width of the left column in pixels; recommended value is 180',
'PORTAL_RIGHT_COLUMN_WIDTH' => 'Width of the right column',
'PORTAL_RIGHT_COLUMN_WIDTH_EXP' => 'Change the width of the right column in pixels; recommended value is 180',
'POSTERS' => 'Posters',
// Search engine names
'SEARCH_A9' => 'A9.com',
'SEARCH_ACRONYM_FINDER' => 'AcronymFinder',
'SEARCH_ALEXA' => 'Alexa',
'SEARCH_ALTA_VISTA' => 'AltaVista',
'SEARCH_AMAZON' => 'Amazon',
'SEARCH_AOL' => 'AOL',
'SEARCH_ASK' => 'Ask.com',
'SEARCH_BAAMBOO' => 'BaamBoo',
'SEARCH_BIT_TORRENT' => 'BitTorrent',
'SEARCH_CREATIVE_COMMONS' => 'Crative Commons',
'SEARCH_EBAY' => 'Ebay',
'SEARCH_GOOGLE' => 'Google',
'SEARCH_LIVE' => 'Bing',
'SEARCH_LYCOS' => 'Lycos',
'SEARCH_MININOVA' => 'Mininova',
'SEARCH_REFERENCE' => 'Reference.com',
'SEARCH_SOURCE_FORGE' => 'SourceForge',
'SEARCH_TORRENT_PORTAL' => 'TorrentPortal',
'SEARCH_TORRENT_SPY' => 'TorrentSpy',
'SEARCH_TORRENTZ' => 'TorrentZ',
'SEARCH_VDICT' => 'VDict',
'SEARCH_WIKI_PEDIA' => 'WikiPedia',
'SEARCH_YAHOO' => 'Yahoo! Search',
'WELCOME_YOU' => 'Welcome you',
// paypal
'PORTAL_PAY_ACC' => 'Paypal Account',
'PORTAL_PAY_ACC_EXP' => 'Gib deine e-mail-Adresse an, die du bei Paypal benutzt, z.B. xxx@xxx.com',
// User menu
'UM_LOG_ME_IN' => 'Mich bei jedem Besuch automatisch anmelden',
'UM_HIDE_ME' => 'Meinen Online-Status während dieser Sitzung verbergen',
'UM_MAIN_SUBSCRIBED' => 'Benachrichtigungen verwalten',
'UM_BOOKMARKS' => 'Lesezeichen verwalten',
'M_MENU' => 'Menü',
'M_ACP' => 'Administrations-Bereich',
// search
'GO' => 'Los',
'SEARCH_BOARD' => 'Foren',
'SEARCH_SERVICE' => 'Suchmaschinen',
'SEARCH_LOOKUP' => 'Lookup',
'SEARCH_TORRENT' => 'Torrent',
'SEARCH_ADV' => 'erweiterte Suche',
// Styles
'STYLE_CHOOSE' => '',
// Friends
'FRIENDS_OFFLINE' => 'Offline',
'FRIENDS_ONLINE' => 'Online',
'NO_FRIENDS' => 'Derzeit sind keine Freunde definiert',
'NO_FRIENDS_OFFLINE' => 'Keine Freunde offline',
'NO_FRIENDS_ONLINE' => 'Keine Freunde online',
// Statistics
'ST_TOP' => 'Insgesamt',
'ST_TOP_ANNS' => 'Bekanntmachungen insgesamt:',
'ST_TOP_STICKYS' => 'Wichtig insgesamt:',
'ST_TOT_ATTACH' => 'Dateianhänge insgesamt:',
'TOPICS_PER_DAY_OTHER' => 'Themen pro Tag: <strong>%d</strong>',
'TOPICS_PER_DAY_ZERO' => 'Themen pro Tag: <strong>0</strong>',
'POSTS_PER_DAY_OTHER' => 'Beiträge pro Tag: <strong>%d</strong>',
'POSTS_PER_DAY_ZERO' => 'Beiträge pro Tag: <strong>0</strong>',
'USERS_PER_DAY_OTHER' => 'Benutzer pro Tag: <strong>%d</strong>',
'USERS_PER_DAY_ZERO' => 'Benutzer pro Tag: <strong>0</strong>',
'TOPICS_PER_USER_OTHER' => 'Themen pro Benutzer: <strong>%d</strong>',
'TOPICS_PER_USER_ZERO' => 'Themen pro Benutzer: <strong>0</strong>',
'POSTS_PER_USER_OTHER' => 'Beiträge pro Benutzer: <strong>%d</strong>',
'POSTS_PER_USER_ZERO' => 'Beiträge pro Benutzer: <strong>0</strong>',
'POSTS_PER_TOPIC_OTHER' => 'Beiträge pro Thema: <strong>%d</strong>',
'POSTS_PER_TOPIC_ZERO' => 'Beiträge pro Thema: <strong>0</strong>',
// PayPal
'DONATION' => 'PayPal-Spenden',
'DONATION_TEXT' => 'ist eine Webseite ohne jedes Gewinninteresse. Jeder der dieses Projekt unterstützen möchte, kann dies mit einer kleinen PayPal-Spende tun, damit die Rechnungen für den Server, die Domain, etc. bezahlt werden können.',
'PAY_MSG' => 'Betrag bitte mit Punkt statt Komma trennen, z.B. 3.50',
'PAY_ITEM' => 'Freiwillige Foren-Spende',
'AUD' => 'Australische Dollar (AUD)',
'CAD' => 'Kanadische Dollar (CAD)',
'CZK' => 'Tschechische Kronen (CZK)',
'DKK' => 'Dänische Kronen (DKK)',
'HKD' => 'Hongkong-Dollar (HKD)',
'HUF' => 'Ungarische Forint (HUF)',
'NZD' => 'Neuseeland-Dollar (NZD)',
'NOK' => 'Norwegische Kronen (NOK)',
'PLN' => 'Polnische Zloty (PLN)',
'GBP' => 'Britische Pfund (GBP)',
'SGD' => 'Singapur-Dollar (SGD)',
'SEK' => 'Schwedische Kronen (SEK)',
'CHF' => 'Schweizer Franken (CHF)',
'JPY' => 'Japanische Yen (JPY)',
'USD' => 'US-Dollar (USD)',
'EUR' => 'Euro (EUR)',
'MXN' => 'Mexikanische Pesos (MXN)',
'ILS' => 'Neue Israelische Schekel (ILS)',
)); ));
?> ?>

View File

@@ -32,6 +32,7 @@ if (empty($lang) || !is_array($lang))
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
$lang = array_merge($lang, array( $lang = array_merge($lang, array(
'LATEST_ANNOUNCEMENTS' => 'Latest global announcements', 'LATEST_ANNOUNCEMENTS' => 'Latest global announcements',
'GLOBAL_ANNOUNCEMENTS' => 'Global announcements',
'GLOBAL_ANNOUNCEMENT' => 'Global announcement', 'GLOBAL_ANNOUNCEMENT' => 'Global announcement',
'VIEW_LATEST_ANNOUNCEMENT' => '1 announcement', 'VIEW_LATEST_ANNOUNCEMENT' => '1 announcement',
'VIEW_LATEST_ANNOUNCEMENTS' => '%d announcements', 'VIEW_LATEST_ANNOUNCEMENTS' => '%d announcements',

View File

@@ -19,6 +19,8 @@ include($phpbb_root_path . 'common.' . $phpEx);
$portal_root_path = PORTAL_ROOT_PATH; $portal_root_path = PORTAL_ROOT_PATH;
$portal_icons_path = PORTAL_ICONS_PATH; $portal_icons_path = PORTAL_ICONS_PATH;
include($phpbb_root_path . $portal_root_path . 'includes/functions_modules.' . $phpEx); include($phpbb_root_path . $portal_root_path . 'includes/functions_modules.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . $portal_root_path . 'includes/functions.' . $phpEx);
//include($phpbb_root_path . 'includes/message_parser.' . $phpEx); //include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
@@ -69,6 +71,14 @@ while ($row = $db->sql_fetchrow($result))
$template_module = $module->get_template_side($row['module_id']); $template_module = $module->get_template_side($row['module_id']);
$template_column = 'right'; $template_column = 'right';
} }
if ($row['module_column'] == 4)
{
$template_module = $module->get_template_center($row['module_id']);
}
if ($row['module_column'] == 5)
{
$template_module = $module->get_template_center($row['module_id']);
}
if (!$template_module) if (!$template_module)
{ {
continue; continue;
@@ -78,6 +88,7 @@ while ($row = $db->sql_fetchrow($result))
'TEMPLATE_FILE' => 'portal/modules/' . $template_module, 'TEMPLATE_FILE' => 'portal/modules/' . $template_module,
'IMAGE_SRC' => $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/' . $row['module_image_src'], 'IMAGE_SRC' => $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/' . $row['module_image_src'],
)); ));
unset($template_module);
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@@ -89,7 +100,7 @@ $template->assign_vars(array(
)); ));
// Output page // Output page
page_header($user->lang['INDEX']); page_header($user->lang['PORTAL']);
$template->set_filenames(array( $template->set_filenames(array(
'body' => 'portal/portal_body.html') 'body' => 'portal/portal_body.html')

View File

@@ -48,7 +48,7 @@ class portal_announcements_module
function get_template_center($module_id) function get_template_center($module_id)
{ {
global $config, $template, $db; global $config, $template, $db, $user, $auth, $cache;
$announcement = request_var('announcement', -1); $announcement = request_var('announcement', -1);
$announcement = ($announcement > $portal_config['portal_announcements_length'] -1) ? -1 : $announcement; $announcement = ($announcement > $portal_config['portal_announcements_length'] -1) ? -1 : $announcement;
@@ -354,7 +354,7 @@ class portal_announcements_module
'S_TOPIC_ICONS' => $topic_icons, 'S_TOPIC_ICONS' => $topic_icons,
)); ));
return 'modulename_center.html'; return 'announcements_center.html';
} }
function get_template_side($module_id) function get_template_side($module_id)
@@ -374,15 +374,15 @@ class portal_announcements_module
'title' => 'ACP_PORTAL_ANNOUNCE_SETTINGS', 'title' => 'ACP_PORTAL_ANNOUNCE_SETTINGS',
'vars' => array( 'vars' => array(
'legend1' => 'ACP_PORTAL_ANNOUNCE_SETTINGS', 'legend1' => 'ACP_PORTAL_ANNOUNCE_SETTINGS',
'portal_announcements_style' => array('lang' => 'PORTAL_ANNOUNCEMENTS_STYLE' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_announcements_style' => array('lang' => 'PORTAL_ANNOUNCEMENTS_STYLE' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_number_of_announcements' => array('lang' => 'PORTAL_NUMBER_OF_ANNOUNCEMENTS' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_number_of_announcements' => array('lang' => 'PORTAL_NUMBER_OF_ANNOUNCEMENTS' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'portal_announcements_day' => array('lang' => 'PORTAL_ANNOUNCEMENTS_DAY' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_announcements_day' => array('lang' => 'PORTAL_ANNOUNCEMENTS_DAY' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'portal_announcements_length' => array('lang' => 'PORTAL_ANNOUNCEMENTS_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_announcements_length' => array('lang' => 'PORTAL_ANNOUNCEMENTS_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'portal_global_announcements_forum' => array('lang' => 'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'), 'board3_global_announcements_forum' => array('lang' => 'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'),
'portal_announcements_forum_exclude' => array('lang' => 'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE', 'validate' => 'string', 'type' => 'radio:yes_no', 'explain' => true), 'board3_announcements_forum_exclude' => array('lang' => 'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE', 'validate' => 'string', 'type' => 'radio:yes_no', 'explain' => true),
'portal_announcements_archive' => array('lang' => 'PORTAL_ANNOUNCEMENTS_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_announcements_archive' => array('lang' => 'PORTAL_ANNOUNCEMENTS_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_announcements_permissions' => array('lang' => 'PORTAL_ANNOUNCEMENTS_PERMISSIONS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_announcements_permissions' => array('lang' => 'PORTAL_ANNOUNCEMENTS_PERMISSIONS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_show_announcements_replies_views' => array('lang' => 'PORTAL_SHOW_REPLIES_VIEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_show_announcements_replies_views' => array('lang' => 'PORTAL_SHOW_REPLIES_VIEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
), ),
); );
} }
@@ -392,15 +392,15 @@ class portal_announcements_module
*/ */
function install($module_id) function install($module_id)
{ {
set_config('portal_announcements_style', 0); set_config('board3_announcements_style', 0);
set_config('portal_number_of_announcements', 1); set_config('board3_number_of_announcements', 1);
set_config('portal_announcements_day', 0); set_config('board3_announcements_day', 0);
set_config('portal_announcements_length', 200); set_config('board3_announcements_length', 200);
set_config('portal_global_announcements_forum', ''); set_config('board3_global_announcements_forum', '');
set_config('portal_announcements_forum_exclude', 0); set_config('board3_announcements_forum_exclude', 0);
set_config('portal_announcements_archive', 1); set_config('board3_announcements_archive', 1);
set_config('portal_announcements_permissions', 1); set_config('board3_announcements_permissions', 1);
set_config('portal_show_announcements_replies_views', 1); set_config('board3_show_announcements_replies_views', 1);
return true; return true;
} }
@@ -410,15 +410,15 @@ class portal_announcements_module
global $db; global $db;
$del_config = array( $del_config = array(
'portal_announcements_style', 'board3_announcements_style',
'portal_number_of_announcements', 'board3_number_of_announcements',
'portal_announcements_day', 'board3_announcements_day',
'portal_announcements_length', 'board3_announcements_length',
'portal_global_announcements_forum', 'board3_global_announcements_forum',
'portal_announcements_forum_exclude', 'board3_announcements_forum_exclude',
'portal_announcements_archive', 'board3_announcements_archive',
'portal_announcements_permissions', 'board3_announcements_permissions',
'portal_show_announcements_replies_views', 'board3_show_announcements_replies_views',
); );
$sql = 'DELETE FROM ' . CONFIG_TABLE . ' $sql = 'DELETE FROM ' . CONFIG_TABLE . '
WHERE ' . $db->sql_in_set('config_name', $del_config); WHERE ' . $db->sql_in_set('config_name', $del_config);

View File

@@ -0,0 +1,52 @@
<!--version $Id$ //-->
<!-- BEGIN announcements_row -->
<!-- IF announcements_row.S_FIRST_ROW -->
{$C_BLOCK_H_L}<dt>{L_LATEST_ANNOUNCEMENTS}</dt>{$C_BLOCK_H_R}
<!-- ENDIF -->
<!-- IF $S_POSTBODY_TOP --><div class="postbody" style="width: 100%"><!-- ENDIF -->
<!-- IF announcements_row.S_NO_TOPICS -->
<div class="post bg2" style="margin-bottom: 0px">
<div class="inner"><span class="portal-corners-top-inner"></span>
<span style="text-align: center;"><strong>{L_NO_ANNOUNCEMENTS}</strong></span>
<!-- ELSE -->
<div style="margin-bottom: <!-- IF announcements_row.S_LAST_ROW -->0px<!-- ELSE -->1px<!-- ENDIF -->" class="post <!-- IF announcements_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
<div class="inner"><span class="portal-corners-top-inner"></span>
<h4 class="first"><a name="a"></a><a name="a{announcements_row.A_ID}"></a><!-- IF announcements_row.S_UNREAD_INFO --><a href="{announcements_row.U_VIEW_UNREAD}">{NEWEST_POST_IMG}</a><!-- ELSE --><a href="{announcements_row.U_LAST_COMMENTS}">{READ_POST_IMG}</a><!-- ENDIF --> {announcements_row.ATTACH_ICON_IMG} <!-- IF announcements_row.S_POLL --> <strong>{L_POLL}: </strong><!-- ENDIF --><!-- IF announcements_row.TOPIC_ICON_IMG --><img src="{T_ICONS_PATH}{announcements_row.TOPIC_ICON_IMG}" width="{announcements_row.TOPIC_ICON_IMG_WIDTH}" height="{announcements_row.TOPIC_ICON_IMG_HEIGHT}" alt="" /> <!-- ENDIF --><a href="{announcements_row.U_VIEW_COMMENTS}"><strong>{announcements_row.TITLE}</strong></a></h4>
<!-- IF announcements_row.PAGINATION --><strong class="pagination"><span>{announcements_row.PAGINATION}</span></strong><!-- ENDIF -->
<ul class="linklist">
<li>{L_POSTED} {L_POST_BY_AUTHOR}: {announcements_row.POSTER_FULL} &raquo; {announcements_row.TIME}</li>
<li class="rightside"><!-- IF announcements_row.FORUM_NAME -->{L_FORUM}: <strong><a href="{announcements_row.U_VIEWFORUM}">{announcements_row.FORUM_NAME}</a></strong><!-- ELSE -->{L_GLOBAL_ANNOUNCEMENT}<!-- ENDIF --></li>
</ul>
<!-- IF not $S_POSTBODY_TOP --><div class="postbody" style="width: 100%"><!-- ENDIF -->
<div class="content">
<br />{announcements_row.TEXT}
</div>
<!-- IF announcements_row.S_HAS_ATTACHMENTS -->
<dl class="attachbox">
<dt>{L_ATTACHMENTS}</dt>
<!-- BEGIN attachment -->
<dd>{announcements_row.attachment.DISPLAY_ATTACHMENT}</dd>
<!-- END attachment -->
</dl>
<!-- ENDIF -->
<br style="clear:both" />
<span style="float: left;">{L_TOPIC_VIEWS}: {announcements_row.TOPIC_VIEWS} &nbsp;&bull;&nbsp; <a href="{announcements_row.U_VIEW_COMMENTS}" title="{L_VIEW_COMMENTS}">{L_COMMENTS}: {announcements_row.REPLIES}</a> &nbsp;&bull;&nbsp; <a href="{announcements_row.U_POST_COMMENT}">{L_POST_REPLY}</a></span>
<span style="float: right; margin: 0 0 5px 0">{announcements_row.OPEN}<a href="{announcements_row.U_READ_FULL}">{announcements_row.L_READ_FULL}</a>{announcements_row.CLOSE}</span>
<div class="back2top"><a href="#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
<!-- IF announcements_row.S_NOT_LAST --><br style="clear:both" /><!-- ENDIF -->
<!-- IF announcements_row.S_LAST_ROW and (AP_PAGINATION or TOTAL_ANNOUNCEMENTS) -->
<hr class="dashed" />
<div class="pagination">
{TOTAL_ANNOUNCEMENTS}
<!-- IF AP_PAGE_NUMBER --><!-- IF AP_PAGINATION --> &bull; {AP_PAGE_NUMBER} &bull; <span>{AP_PAGINATION}</span><!-- ELSE --> &bull; {AP_PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
</div>
<!-- ENDIF -->
<!-- IF not $S_POSTBODY_TOP --></div><!-- ENDIF -->
<!-- ENDIF -->
<span class="portal-corners-bottom-inner"></span></div>
</div>
<!-- IF $S_POSTBODY_TOP --></div><!-- ENDIF -->
<!-- IF announcements_row.S_LAST_ROW -->
{$C_BLOCK_F_L}{$C_BLOCK_F_R}
<!-- ENDIF -->
<!-- END announcements_row -->