Added check to prevent adding a module more than once
Few small bugfixes
This commit is contained in:
@@ -352,7 +352,6 @@ class portal_announcements_module
|
||||
'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
|
||||
'READ_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
|
||||
'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
|
||||
'S_DISPLAY_ANNOUNCEMENTS' => true,
|
||||
'S_DISPLAY_ANNOUNCEMENTS_RVS' => ($config['board3_show_announcements_replies_views_' . $module_id]) ? true : false,
|
||||
'S_TOPIC_ICONS' => $topic_icons,
|
||||
));
|
||||
|
||||
@@ -64,7 +64,6 @@ class portal_forumlist_module
|
||||
'FORUM_NEW_IMG' => $user->img('forum_unread', 'NEW_POSTS'),
|
||||
'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'),
|
||||
'FORUM_NEW_LOCKED_IMG' => $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'),
|
||||
'S_DISPLAY_PORTAL_FORUM_INDEX' => true,
|
||||
'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums') : '',
|
||||
'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '',
|
||||
));
|
||||
|
||||
@@ -97,7 +97,6 @@ class portal_friends_module
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'S_DISPLAY_FRIENDS' => $s_display_friends,
|
||||
'S_ZEBRA_ENABLED' => true,
|
||||
));
|
||||
|
||||
return 'friends_side.html';
|
||||
|
||||
@@ -55,36 +55,22 @@ class portal_latest_bots_module
|
||||
$sql = 'SELECT username, user_colour, user_lastvisit
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_type = ' . USER_IGNORE . '
|
||||
AND user_lastvisit > 0
|
||||
ORDER BY user_lastvisit DESC';
|
||||
$result = $db->sql_query_limit($sql, $config['board3_last_visited_bots_number_' . $module_id]);
|
||||
$first = true;
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if (!$row['user_lastvisit'] && $first == true)
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_DISPLAY_LAST_BOTS' => false,
|
||||
$template->assign_block_vars('last_visited_bots', array(
|
||||
'BOT_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']),
|
||||
'LAST_VISIT_DATE' => $user->format_date($row['user_lastvisit']),
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
$template->assign_var('S_DISPLAY_LAST_BOTS', true);
|
||||
|
||||
if($row['user_lastvisit'] > 0)
|
||||
{
|
||||
$template->assign_block_vars('last_visited_bots', array(
|
||||
'BOT_NAME' => get_username_string('full', '', $row['username'], $row['user_colour']),
|
||||
'LAST_VISIT_DATE' => $user->format_date($row['user_lastvisit']),
|
||||
));
|
||||
}
|
||||
}
|
||||
$first = false;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'LAST_VISITED_BOTS' => sprintf($user->lang['LAST_VISITED_BOTS'], $config['board3_last_visited_bots_number_' . $module_id]),
|
||||
'LAST_VISITED_BOTS' => ($config['board3_last_visited_bots_number_' . $module_id] != 0) ? sprintf($user->lang['LAST_VISITED_BOTS_CNT'], $config['board3_last_visited_bots_number_' . $module_id]) : $user->lang['LAST_VISITED_BOTS'],
|
||||
));
|
||||
|
||||
if(!empty($row))
|
||||
|
||||
@@ -340,7 +340,6 @@ class portal_news_module
|
||||
'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
|
||||
'S_NEWEST_OR_FIRST' => ($config['board3_news_show_last_' . $module_id]) ? $user->lang['JUMP_NEWEST'] : $user->lang['JUMP_FIRST'],
|
||||
'POSTED_BY_TEXT' => ($config['board3_news_show_last_' . $module_id]) ? $user->lang['LAST_POST'] : $user->lang['POSTED'],
|
||||
'S_DISPLAY_NEWS' => true,
|
||||
'S_DISPLAY_NEWS_RVS' => ($config['board3_show_news_replies_views_' . $module_id]) ? true : false,
|
||||
'S_TOPIC_ICONS' => $topic_icons,
|
||||
));
|
||||
|
||||
@@ -421,7 +421,6 @@ class portal_poll_module
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_DISPLAY_POLL' => true,
|
||||
'S_HAS_POLL' => $has_poll,
|
||||
'POLL_LEFT_CAP_IMG' => $user->img('poll_left'),
|
||||
'POLL_RIGHT_CAP_IMG' => $user->img('poll_right'),
|
||||
@@ -789,7 +788,7 @@ class portal_poll_module
|
||||
'POLL_OPTION_RESULT' => $pd['poll_option_total'],
|
||||
'POLL_OPTION_PERCENT' => $option_pct_txt,
|
||||
'POLL_OPTION_PCT' => round($option_pct * 100),
|
||||
'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, round($option_pct * 250)),
|
||||
'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, round($option_pct * 35) . 'px'),
|
||||
'POLL_OPTION_VOTED' => (in_array($pd['poll_option_id'], $cur_voted_id)) ? true : false
|
||||
));
|
||||
}
|
||||
@@ -798,7 +797,6 @@ class portal_poll_module
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_DISPLAY_POLL' => true,
|
||||
'S_HAS_POLL' => $has_poll,
|
||||
'POLL_LEFT_CAP_IMG' => $user->img('poll_left'),
|
||||
'POLL_RIGHT_CAP_IMG' => $user->img('poll_right'),
|
||||
|
||||
@@ -119,7 +119,6 @@ class portal_statistics_module
|
||||
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'S_DISPLAY_ADVANCED_STAT' => true,
|
||||
'B3_TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
|
||||
'B3_TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics),
|
||||
'B3_TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users),
|
||||
|
||||
@@ -82,7 +82,6 @@ class portal_stylechanger_module
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'S_STYLE_OPTIONS' => ($config['override_user_style'] || $style_count < 2) ? '' : style_select($user->data['user_style']),
|
||||
'S_DISPLAY_CHANGE_STYLE' => true,
|
||||
));
|
||||
|
||||
return 'stylechanger_side.html';
|
||||
|
||||
Reference in New Issue
Block a user