Links block V1, lang other than english needs update

This commit is contained in:
Ice
2008-04-25 22:31:59 +00:00
parent f946690f06
commit 903aaf8574
11 changed files with 203 additions and 42 deletions

View File

@@ -28,6 +28,8 @@ class acp_portal
$action = request_var('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
$this->new_config = $portal_config;
/**
* Validation types are:
@@ -47,11 +49,10 @@ class acp_portal
'portal_leaders' => array('lang' => 'PORTAL_LEADERS' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_clock' => array('lang' => 'PORTAL_CLOCK' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_link_us' => array('lang' => 'PORTAL_LINK_US' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_links' => array('lang' => 'PORTAL_LINKS' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_birthdays' => array('lang' => 'PORTAL_BIRTHDAYS' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_birthdays_ahead' => array('lang' => 'PORTAL_BIRTHDAYS_AHEAD' , 'validate' => 'int' , 'type' => 'text:3:3' , 'explain' => true),
'portal_random_member' => array('lang' => 'PORTAL_RANDOM_MEMBER' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_forum_index' => array('lang' => 'PORTAL_FORUM_INDEX' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'forum_index' => array('lang' => 'PORTAL_FORUM_INDEX' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_whois_online' => array('lang' => 'PORTAL_WHOIS_ONLINE' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_change_style' => array('lang' => 'PORTAL_CHANGE_STYLE' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
'portal_main_menu' => array('lang' => 'PORTAL_MAIN_MENU' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
@@ -70,15 +71,15 @@ class acp_portal
'title' => 'ACP_PORTAL_NEWS_SETTINGS',
'vars' => array(
'legend1' => 'ACP_PORTAL_NEWS_SETTINGS',
'portal_news' => array('lang' => 'PORTAL_NEWS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_news_style' => array('lang' => 'PORTAL_NEWS_STYLE' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_show_all_news' => array('lang' => 'PORTAL_SHOW_ALL_NEWS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_number_of_news' => array('lang' => 'PORTAL_NUMBER_OF_NEWS' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'portal_news_length' => array('lang' => 'PORTAL_NEWS_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'portal_news_forum' => array('lang' => 'PORTAL_NEWS_FORUM' , 'validate' => 'string', 'type' => 'text:10:200', 'explain' => true),
'portal_news_permissions' => array('lang' => 'PORTAL_NEWS_PERMISSIONS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_news_show_last' => array('lang' => 'PORTAL_NEWS_SHOW_LAST' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_news_archive' => array('lang' => 'PORTAL_NEWS_ARCHIVE' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_news' => array('lang' => 'PORTAL_NEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_news_style' => array('lang' => 'PORTAL_NEWS_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_show_all_news' => array('lang' => 'PORTAL_SHOW_ALL_NEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_number_of_news' => array('lang' => 'PORTAL_NUMBER_OF_NEWS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'portal_news_length' => array('lang' => 'PORTAL_NEWS_LENGTH', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'portal_news_forum' => array('lang' => 'PORTAL_NEWS_FORUM', 'validate' => 'string', 'type' => 'text:10:200', 'explain' => true),
'portal_news_permissions' => array('lang' => 'PORTAL_NEWS_PERMISSIONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_news_show_last' => array('lang' => 'PORTAL_NEWS_SHOW_LAST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_news_archive' => array('lang' => 'PORTAL_NEWS_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
)
);
break;
@@ -87,14 +88,14 @@ class acp_portal
'title' => 'ACP_PORTAL_ANNOUNCE_SETTINGS',
'vars' => array(
'legend1' => 'ACP_PORTAL_ANNOUNCE_SETTINGS',
'portal_announcements' => array('lang' => 'PORTAL_ANNOUNCEMENTS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_announcements' => array('lang' => 'PORTAL_ANNOUNCEMENTS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_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),
'portal_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),
'portal_global_announcements_forum' => array('lang' => 'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM' , 'validate' => 'string', 'type' => 'text:10:200', 'explain' => true),
'portal_announcements_permissions' => array('lang' => 'PORTAL_ANNOUNCEMENTS_PERMISSIONS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_announcements_archive' => array('lang' => 'PORTAL_ANNOUNCEMENTS_ARCHIVE' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_announcements_archive' => array('lang' => 'PORTAL_ANNOUNCEMENTS_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
)
);
break;
@@ -103,7 +104,7 @@ class acp_portal
'title' => 'ACP_PORTAL_RECENT_SETTINGS',
'vars' => array(
'legend1' => 'ACP_PORTAL_RECENT_SETTINGS',
'portal_recent' => array('lang' => 'PORTAL_RECENT' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_recent' => array('lang' => 'PORTAL_RECENT' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_max_topics' => array('lang' => 'PORTAL_MAX_TOPIC' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'portal_recent_title_limit' => array('lang' => 'PORTAL_RECENT_TITLE_LIMIT' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'portal_exclude_forums' => array('lang' => 'PORTAL_EXCLUDE_FORUM' , 'validate' => 'string', 'type' => 'text:10:200', 'explain' => true),
@@ -127,8 +128,8 @@ class acp_portal
'title' => 'ACP_PORTAL_PAYPAL_SETTINGS',
'vars' => array(
'legend2' => 'ACP_PORTAL_PAYPAL_SETTINGS',
'portal_pay_c_block' => array('lang' => 'PORTAL_PAY_C_BLOCK' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_pay_s_block' => array('lang' => 'PORTAL_PAY_S_BLOCK' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_pay_c_block' => array('lang' => 'PORTAL_PAY_C_BLOCK' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_pay_s_block' => array('lang' => 'PORTAL_PAY_S_BLOCK' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_pay_acc' => array('lang' => 'PORTAL_PAY_ACC' , 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true),
)
);
@@ -138,7 +139,7 @@ class acp_portal
'title' => 'ACP_PORTAL_ATTACHMENTS_NUMBER_SETTINGS',
'vars' => array(
'legend1' => 'ACP_PORTAL_ATTACHMENTS_NUMBER_SETTINGS',
'portal_attachments' => array('lang' => 'PORTAL_ATTACHMENTS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_attachments' => array('lang' => 'PORTAL_ATTACHMENTS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_attachments_number' => array('lang' => 'PORTAL_ATTACHMENTS_NUMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'portal_attachments_forum_ids' => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_IDS', 'validate' => 'string', 'type' => 'text:10:200', 'explain' => true),
)
@@ -149,7 +150,7 @@ class acp_portal
'title' => 'ACP_PORTAL_MEMBERS_SETTINGS',
'vars' => array(
'legend1' => 'ACP_PORTAL_MEMBERS_SETTINGS',
'portal_latest_members' => array('lang' => 'PORTAL_LATEST_MEMBERS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_latest_members' => array('lang' => 'PORTAL_LATEST_MEMBERS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_max_last_member' => array('lang' => 'PORTAL_MAX_LAST_MEMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
)
);
@@ -182,7 +183,7 @@ class acp_portal
'vars' => array(
'legend1' => 'ACP_PORTAL_MOST_POSTER_SETTINGS',
'portal_top_posters' => array('lang' => 'PORTAL_TOP_POSTERS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_max_most_poster' => array('lang' => 'PORTAL_MAX_MOST_POSTER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'portal_max_most_poster' => array('lang' => 'PORTAL_MAX_MOST_POSTER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
)
);
break;
@@ -205,29 +206,99 @@ class acp_portal
'vars' => array(
'legend1' => 'ACP_PORTAL_CUSTOM_SMALL_SETTINGS',
'portal_custom_small' => array('lang' => 'PORTAL_CUSTOM_SMALL' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_custom_small_headline' => array('lang' => 'PORTAL_CUSTOM_SMALL_HEADLINE' , 'validate' => 'string', 'type' => 'text:40:200', 'explain' => true),
'portal_custom_small_headline' => array('lang' => 'PORTAL_CUSTOM_SMALL_HEADLINE' , 'validate' => 'string', 'type' => 'text:40:200', 'explain' => true),
'portal_custom_small_bbcode' => array('lang' => 'PORTAL_CUSTOM_SMALL_BBCODE' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_custom_code_small' => array('lang' => 'PORTAL_CUSTOM_CODE_SMALL' , 'type' => 'textarea:6:6', 'explain' => true),
'legend2' => 'ACP_PORTAL_CUSTOM_CENTER_SETTINGS',
'portal_custom_center' => array('lang' => 'PORTAL_CUSTOM_CENTER' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_custom_center_headline' => array('lang' => 'PORTAL_CUSTOM_CENTER_HEADLINE' , 'validate' => 'string', 'type' => 'text:40:200', 'explain' => true),
'portal_custom_center_headline' => array('lang' => 'PORTAL_CUSTOM_CENTER_HEADLINE' , 'validate' => 'string', 'type' => 'text:40:200', 'explain' => true),
'portal_custom_center_bbcode' => array('lang' => 'PORTAL_CUSTOM_CENTER_BBCODE' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_custom_code_center' => array('lang' => 'PORTAL_CUSTOM_CODE_CENTER' , 'type' => 'textarea:6:6', 'explain' => true),
)
);
break;
case 'minicalendar':
case 'minicalendar':
$display_vars = array(
'title' => 'ACP_PORTAL_MINICALENDAR_SETTINGS',
'vars' => array(
'legend1' => 'ACP_PORTAL_MINICALENDAR_SETTINGS',
'portal_minicalendar' => array('lang' => 'PORTAL_MINICALENDAR' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_minicalendar_today_color' => array('lang' => 'PORTAL_MINICALENDAR_TODAY_COLOR' , 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true),
'portal_minicalendar_day_link_color' => array('lang' => 'PORTAL_MINICALENDAR_DAY_LINK_COLOR' , 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true),
'portal_minicalendar_today_color' => array('lang' => 'PORTAL_MINICALENDAR_TODAY_COLOR' , 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true),
'portal_minicalendar_day_link_color' => array('lang' => 'PORTAL_MINICALENDAR_DAY_LINK_COLOR' , 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true),
)
);
break;
case 'links':
$display_vars = array(
'title' => 'ACP_PORTAL_LINKS_SETTINGS',
'vars' => array(
'legend1' => 'ACP_PORTAL_LINKS_SETTINGS',
'portal_links' => array('lang' => 'PORTAL_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
)
);
// Links require preprocessing
$links = ( strlen($portal_config['portal_links_array']) ) ? utf_unserialize($portal_config['portal_links_array']) : array() ;
$this->link_num = count( $links );
$lid = request_var('link', 0);
switch( $action )
{
case 'delete':
if($lid > 0)
{
if($lid < $this->link_num)
{
for($i = $lid+1; $i <= $this->link_num; ++$i)
{
$links[$i-1] = $links[$i];
}
}
unset($links[$this->link_num]);
set_portal_config('portal_links_array', serialize($links));
}
break;
case 'add':
$this->link_num = $this->link_num + 1;
$links[$this->link_num] = array( 'url' => '', 'text' => '' );
set_portal_config('portal_links_array', serialize($links));
break;
case 'moveup':
if($lid > 1 && isset($links[$lid]))
{
$temp = $links[$lid];
$links[$lid] = $links[$lid-1];
$links[$lid-1] = $temp;
unset($temp);
set_portal_config('portal_links_array', serialize($links));
}
break;
case 'movedown':
if($lid > 0 && $lid < $this->link_num && isset($links[$lid]))
{
$temp = $links[$lid];
$links[$lid] = $links[$lid+1];
$links[$lid+1] = $temp;
unset($temp);
set_portal_config('portal_links_array', serialize($links));
}
break;
}
ksort( $links );
reset( $links );
foreach($links as $link_id => $link_data)
{
$key = 'portal_link_'.$link_id;
$display_vars['vars'][$key] = array('lang' => 'PORTAL_LINK_TEXT', 'type' => 'custom', 'method' => 'createLink', 'explain' => true);
$this->new_config[$key] = array('key' => $link_id, 'text' => $link_data['text'], 'url' => $link_data['url']);
}
$display_vars['vars']['portal_links_add'] = array('lang' => 'PORTAL_ADD_LINK_TEXT', 'type' => 'custom', 'method' => 'addLink', 'explain' => true);
break;
default:
trigger_error('NO_MODE', E_USER_ERROR);
break;
@@ -238,23 +309,41 @@ class acp_portal
$user->add_lang($display_vars['lang']);
}
$this->new_config = $portal_config;
$cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config;
$error = array();
// We validate the complete config if whished
validate_config_vars($display_vars['vars'], $cfg_array, $error);
// Do not write values if there is an error
if (sizeof($error))
{
$submit = false;
}
if ($submit)
{
switch( $mode )
{
case 'links':
$links = array();
for($i = 1; $i <= $this->link_num; ++$i)
{
$links[$i] = array(
'url' => $cfg_array['portal_link_'.$i.'_url'],
'text' => $cfg_array['portal_link_'.$i.'_text'],
);
}
$display_vars['vars']['portal_links_array'] = '';
$cfg_array['portal_links_array'] = serialize($links);
break;
}
}
// 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)
{
if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') || ($type == 'links' && strpos($config_name, 'portal_link_') ) !== false)
{
continue;
}
@@ -331,6 +420,32 @@ class acp_portal
unset($display_vars['vars'][$config_key]);
}
}
function createLink($value, $key)
{
global $user, $phpEx;
$icon_up = '<a href="'.append_sid("{$phpbb_root_path}index.$phpEx", 'i=portal&amp;mode=links&amp;action=moveup&amp;link='.$value['key']).'"><img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" /></a>';
$icon_up_d = '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />';
$icon_down = '<a href="'.append_sid("{$phpbb_root_path}index.$phpEx", 'i=portal&amp;mode=links&amp;action=movedown&amp;link='.$value['key']).'"><img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" /></a>';
$icon_down_d = '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />';
$icon_del = '<a href="'.append_sid("{$phpbb_root_path}index.$phpEx", 'i=portal&amp;mode=links&amp;action=delete&amp;link='.$value['key']).'"><img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" /></a>';
return '<input id="' . $key . '_text" type="text" size="40" maxlength="255" name="config[' . $key . '_text]" value="' . $value['text'] . '" /> <input id="' . $key . '_url" type="text" size="40" maxlength="255" name="config[' . $key . '_url]" value="' . $value['url'] . '" /> ' . $icon_del . ' ' . ( ($value['key'] < $this->link_num) ? $icon_down : $icon_down_d ) . ' ' . ( ($value['key'] > 1) ? $icon_up : $icon_up_d );
}
function addLink($value, $key)
{
global $user, $phpEx;
$link = append_sid("{$phpbb_root_path}index.$phpEx", 'i=portal&amp;mode=links&amp;action=add');
return '<a href="'.$link.'">'.$user->lang['PORTAL_LINK_ADD'].'</a>';
}
}
function utf_unserialize($serial_str) {
$out = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $serial_str );
return unserialize($out);
}
?>

View File

@@ -36,6 +36,7 @@ class acp_portal_info
'poster' => array('title' => 'ACP_PORTAL_MOST_POSTER_INFO', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'customblock' => array('title' => 'ACP_PORTAL_CUSTOM_INFO', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'minicalendar' => array('title' => 'ACP_PORTAL_MINICALENDAR_INFO', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'links' => array('title' => 'ACP_PORTAL_LINKS_INFO', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
),
);
}

View File

@@ -822,7 +822,18 @@ if( $user->data['is_registered'] && $auth->acl_get('a_board') )
'module_mode' => 'customblock',
'module_auth' => ''
);
$modules->update_module_data($customblock);
$modules->update_module_data($customblock);
$linkblock = array(
'module_basename' => 'portal',
'module_enabled' => 1,
'module_display' => 1,
'parent_id' => $portal['module_id'],
'module_class' => 'acp',
'module_langname' => 'ACP_PORTAL_LINKS_INFO',
'module_mode' => 'links',
'module_auth' => ''
);
$modules->update_module_data($linkblock);
// clear cache and log what we did
$cache->purge();
@@ -873,7 +884,18 @@ if( $user->data['is_registered'] && $auth->acl_get('a_board') )
'module_mode' => 'customblock',
'module_auth' => ''
);
$modules->update_module_data($customblock);
$modules->update_module_data($customblock);
$linkblock = array(
'module_basename' => 'portal',
'module_enabled' => 1,
'module_display' => 1,
'parent_id' => $portal['module_id'],
'module_class' => 'acp',
'module_langname' => 'ACP_PORTAL_LINKS_INFO',
'module_mode' => 'links',
'module_auth' => ''
);
$modules->update_module_data($linkblock);
$updated = true;
}

View File

@@ -84,6 +84,7 @@ INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_foru
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_news_show_last', '0');
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_news_archive', '1');
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_announcements_archive', '1');
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_links_array', 'a:2:{i:1;a:2:{s:4:"text";s:9:"Board3.de";s:3:"url";s:21:"http://www.board3.de/";}i:2;a:2:{s:4:"text";s:9:"phpBB.com";s:3:"url";s:21:"http://www.phpbb.com/";}}');
# POSTGRES COMMIT #

View File

@@ -26,6 +26,7 @@ $sql_update['0.2.3'] = array(
"INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_news_show_last', '0')",
"INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_news_archive', '1')",
"INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_announcements_archive', '1')",
"INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_links_array', 'a:2:{i:1;a:2:{s:4:\"text\";s:9:\"Board3.de\";s:3:\"url\";s:21:\"http://www.board3.de/\";}i:2;a:2:{s:4:\"text\";s:9:\"phpBB.com\";s:3:\"url\";s:21:\"http://www.phpbb.com/\";}}')",
);
?>

View File

@@ -37,6 +37,7 @@ $lang = array_merge($lang, array(
'ACP_PORTAL_WELCOME_INFO' => 'Welcome message',
'ACP_PORTAL_CUSTOM_INFO' => 'Custom block',
'ACP_PORTAL_MINICALENDAR_INFO' => 'Mini calendar',
'ACP_PORTAL_LINKS_INFO' => 'Links',
));
?>

View File

@@ -53,8 +53,6 @@ $lang = array_merge($lang, array(
'PORTAL_CLOCK_EXPLAIN' => 'Display this block on portal.',
'PORTAL_LINK_US' => 'Link us block',
'PORTAL_LINK_US_EXPLAIN' => 'Display this block on portal.',
'PORTAL_LINKS' => 'Links block',
'PORTAL_LINKS_EXPLAIN' => 'Display this block on portal.',
'PORTAL_BIRTHDAYS' => 'Birthday block',
'PORTAL_BIRTHDAYS_EXPLAIN' => 'Display this block on portal.',
'PORTAL_BIRTHDAYS_AHEAD' => 'Birthdays ahead days',
@@ -238,6 +236,18 @@ $lang = array_merge($lang, array(
'PORTAL_WELCOME_INTRO' => 'Welcome message',
'PORTAL_WELCOME_GUEST' => 'Welcome message only for guests?',
'PORTAL_WELCOME_INTRO_EXPLAIN' => 'Change the welcome message (BBCode is allowed).',
// links
'ACP_PORTAL_LINKS_INFO' => 'Links',
'ACP_PORTAL_LINKS_SETTINGS' => 'Link Settings',
'ACP_PORTAL_LINKS_SETTINGS_EXPLAIN' => 'Set up the link block links.',
'PORTAL_LINKS' => 'Links block',
'PORTAL_LINKS_EXPLAIN' => 'Display this block on portal.',
'PORTAL_LINK_TEXT' => 'Text/URL',
'PORTAL_LINK_TEXT_EXPLAIN' => 'The text followed by the url for the link. Use the buttons to delete and reorder the links.',
'PORTAL_ADD_LINK_TEXT' => 'Add link',
'PORTAL_ADD_LINK_TEXT_EXPLAIN' => 'Click the text to create a new link.',
'PORTAL_LINK_ADD' => '<strong>Add</strong>',
// custom
'ACP_PORTAL_CUSTOM_INFO' => 'Custom block',

View File

@@ -227,10 +227,7 @@ if ($portal_config['portal_clock'])
if ($portal_config['portal_links'])
{
// include($phpbb_root_path . 'portal/block/links.'.$phpEx);
$template->assign_vars(array(
'S_DISPLAY_LINKS' => true,
));
include($phpbb_root_path . 'portal/block/links.'.$phpEx);
}

View File

@@ -20,6 +20,19 @@ if (!defined('IN_PORTAL'))
exit;
}
$links = ( strlen($portal_config['portal_links_array']) > 0 ) ? unserialize($portal_config['portal_links_array']) : array();
ksort( $links );
reset( $links );
foreach( $links as $link_id => $link_data )
{
$template->assign_block_vars('link', array(
'URL' => $link_data['url'],
'TEXT' => $link_data['text'],
));
}
$template->assign_vars(array(
'S_DISPLAY_LINKS' => true,
));

View File

@@ -4,9 +4,9 @@
<h3>{L_LINKS}</h3>
<div class="panel" style="margin-bottom: 0px;">
<ul class="ul-link">
<li><a href="http://www.phpbb.de" title="Deutsche phpBB Supportseite">phpbb.de</a></li>
<li><a href="http://www.board3.de" title="Home of the board3 Portal">board3</a></li>
<li><a href="http://www.flying-bits.org" title="Hier findest du die Mods von nickvergessen">www.flying-bits.org</a></li>
<!-- BEGIN link -->
<li><a href="{link.URL}" title="{link.TEXT}">{link.TEXT}</a></li>
<!-- END link -->
</ul>
</div>
<span class="corners-bottom"><span></span></span>