From 58ddae0c90cbf8c751129c9d05432c376c8e374f Mon Sep 17 00:00:00 2001 From: Ludovic Arnaud Date: Thu, 10 Oct 2002 01:02:47 +0000 Subject: More bugfixes git-svn-id: file:///svn/phpbb/trunk@2951 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/forums_display.php | 202 +++++++++++++++++++------------------- phpBB/includes/page_tail.php | 3 +- phpBB/includes/template.php | 7 -- 3 files changed, 104 insertions(+), 108 deletions(-) (limited to 'phpBB') diff --git a/phpBB/includes/forums_display.php b/phpBB/includes/forums_display.php index 4cb1755600..ef86294f66 100644 --- a/phpBB/includes/forums_display.php +++ b/phpBB/includes/forums_display.php @@ -22,6 +22,11 @@ foreach ($forum_rows as $row) { extract($row); + if (!$auth->acl_get('f_list', $forum_id)) + { + continue; + } + if ($parent_id == $root_id) { if ($forum_status == ITEM_CATEGORY) @@ -45,133 +50,130 @@ foreach ($forum_rows as $row) unset($stored_cat); } - if ($auth->acl_get('f_list', $forum_id)) + switch ($forum_status) { - switch ($forum_status) - { - case ITEM_CATEGORY: - $folder_image = $theme['sub_forum']; - $folder_alt = $lang['Category']; - break; - - case ITEM_LOCKED: - $folder_image = $theme['forum_locked']; - $folder_alt = $lang['Forum_locked']; - break; - - default: - $unread_topics = false; - if ($userdata['user_id'] && $forum_last_post_time > $userdata['user_lastvisit']) + case ITEM_CATEGORY: + $folder_image = $theme['sub_forum']; + $folder_alt = $lang['Category']; + break; + + case ITEM_LOCKED: + $folder_image = $theme['forum_locked']; + $folder_alt = $lang['Forum_locked']; + break; + + default: + $unread_topics = false; + if ($userdata['user_id'] && $forum_last_post_time > $userdata['user_lastvisit']) + { + $unread_topics = true; + if (isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'])) { - $unread_topics = true; - if (isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'])) + if ($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time) { - if ($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time) - { - $unread_topics = false; - } + $unread_topics = false; } + } - if (isset($mark_topics[$forum_id]) || isset($mark_forums[$forum_id])) + if (isset($mark_topics[$forum_id]) || isset($mark_forums[$forum_id])) + { + if ($mark_forums[$forum_id] > $userdata['user_lastvisit'] || !max($mark_topics[$forum_id])) { - if ($mark_forums[$forum_id] > $userdata['user_lastvisit'] || !max($mark_topics[$forum_id])) - { - $unread_topics = false; - } + $unread_topics = false; } } + } - $folder_image = ($unread_topics) ? $theme['forum_new'] : $theme['forum']; - $folder_alt = ($unread_topics) ? $lang['New_posts'] : $lang['No_new_posts']; - } + $folder_image = ($unread_topics) ? $theme['forum_new'] : $theme['forum']; + $folder_alt = ($unread_topics) ? $lang['New_posts'] : $lang['No_new_posts']; + } - if ($forum_last_post_id) - { - $last_post = create_date($board_config['default_dateformat'], $forum_last_post_time, $board_config['board_timezone']) . '
'; + if ($forum_last_post_id) + { + $last_post = create_date($board_config['default_dateformat'], $forum_last_post_time, $board_config['board_timezone']) . '
'; - $last_post .= ($forum_last_poster_id == ANONYMOUS) ? (($forum_last_poster_name != '') ? $forum_last_poster_name . ' ' : $lang['Guest'] . ' ') : '' . $username . ' '; + $last_post .= ($forum_last_poster_id == ANONYMOUS) ? (($forum_last_poster_name != '') ? $forum_last_poster_name . ' ' : $lang['Guest'] . ' ') : '' . $username . ' '; - $last_post .= '' . create_img($theme['goto_post_latest'], $lang['View_latest_post']) . ''; - } - else - { - $last_post = $lang['No_Posts']; - } + $last_post .= '' . create_img($theme['goto_post_latest'], $lang['View_latest_post']) . ''; + } + else + { + $last_post = $lang['No_Posts']; + } - if (!empty($forum_moderators[$forum_id])) + if (!empty($forum_moderators[$forum_id])) + { + $l_moderator = (count($forum_moderators[$forum_id]) == 1) ? $lang['Moderator'] . ': ' : $lang['Moderators'] . ': ' ; + $moderators_list = implode(', ', $forum_moderators[$forum_id]); + } + else + { + $l_moderator = ' '; + $moderators_list = ' '; + } + + if (isset($subforums[$forum_id])) + { + foreach ($subforums[$forum_id] as $row) { - $l_moderator = (count($forum_moderators[$forum_id]) == 1) ? $lang['Moderator'] . ': ' : $lang['Moderators'] . ': ' ; - $moderators_list = implode(', ', $forum_moderators[$forum_id]); + $alist[$row['forum_id']] = $row['forum_name']; } - else + asort($alist); + + $links = array(); + foreach ($alist as $subforum_id => $subforum_name) { - $l_moderator = ' '; - $moderators_list = ' '; + $links[] = '' . htmlspecialchars($subforum_name) . ''; } + $subforums_list = implode(', ', $links); - if (isset($subforums[$forum_id])) - { - foreach ($subforums[$forum_id] as $row) + $l_subforums = (count($subforums[$forum_id]) == 1) ? $lang['Subforum'] . ': ' : $lang['Subforums'] . ': '; + } + else + { + $subforums_list = ''; + $l_subforums = ''; + } + + switch ($forum_status) + { + case ITEM_CATEGORY: + $forum_link = 'index.' . $phpEx . $SID . '&c=' . $forum_id; + $forum_type_switch = 'S_IS_SUBCAT'; + break; + + default: + $forum_link = 'viewforum.' . $phpEx . $SID . '&f=' . $forum_id; + if ($parent_id == $root_id) { - $alist[$row['forum_id']] = $row['forum_name']; + $forum_type_switch = 'S_IS_ROOTFORUM'; } - asort($alist); - - $links = array(); - foreach ($alist as $subforum_id => $subforum_name) + else { - $links[] = '' . htmlspecialchars($subforum_name) . ''; + $forum_type_switch = 'S_IS_FORUM'; } - $subforums_list = implode(', ', $links); - - $l_subforums = (count($subforums[$forum_id]) == 1) ? $lang['Subforum'] . ': ' : $lang['Subforums'] . ': '; - } - else - { - $subforums_list = ''; - $l_subforums = ''; - } - - switch ($forum_status) - { - case ITEM_CATEGORY: - $forum_link = 'index.' . $phpEx . $SID . '&c=' . $forum_id; - $forum_type_switch = 'S_IS_SUBCAT'; - break; - - default: - $forum_link = 'viewforum.' . $phpEx . $SID . '&f=' . $forum_id; - if ($parent_id == $root_id) - { - $forum_type_switch = 'S_IS_ROOTFORUM'; - } - else - { - $forum_type_switch = 'S_IS_FORUM'; - } - } + } - $template->assign_block_vars('forumrow', array( - $forum_type_switch => TRUE, + $template->assign_block_vars('forumrow', array( + $forum_type_switch => TRUE, - 'FORUM_FOLDER_IMG' => create_img($folder_image, $folder_alt), - 'FORUM_NAME' => $forum_name, - 'FORUM_DESC' => $forum_desc, + 'FORUM_FOLDER_IMG' => create_img($folder_image, $folder_alt), + 'FORUM_NAME' => $forum_name, + 'FORUM_DESC' => $forum_desc, - 'POSTS' => $forum_posts, - 'TOPICS' => $forum_topics, - 'LAST_POST' => $last_post, - 'MODERATORS' => $moderators_list, - 'SUBFORUMS' => $subforums_list, + 'POSTS' => $forum_posts, + 'TOPICS' => $forum_topics, + 'LAST_POST' => $last_post, + 'MODERATORS' => $moderators_list, + 'SUBFORUMS' => $subforums_list, - 'FORUM_IMG' => $forum_image, + 'FORUM_IMG' => $forum_image, - 'L_SUBFORUM' => $l_subforums, - 'L_MODERATOR' => $l_moderator, - 'L_FORUM_FOLDER_ALT'=> $folder_alt, + 'L_SUBFORUM' => $l_subforums, + 'L_MODERATOR' => $l_moderator, + 'L_FORUM_FOLDER_ALT'=> $folder_alt, - 'U_VIEWFORUM' => $forum_link - )); - } + 'U_VIEWFORUM' => $forum_link + )); } ?> \ No newline at end of file diff --git a/phpBB/includes/page_tail.php b/phpBB/includes/page_tail.php index 5296f41a9c..6893641c6d 100644 --- a/phpBB/includes/page_tail.php +++ b/phpBB/includes/page_tail.php @@ -44,8 +44,9 @@ if (defined('DEBUG')) if ($auth->acl_get('a_')) { - $debug_output .= ' | Explain ]'; + $debug_output .= ' | Explain'; } + $debug_output .= ' ]'; } $template->assign_vars(array( diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 60f6551ce5..4b2f393d53 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -167,13 +167,6 @@ class Template { */ function display($handle) { - if (!empty($_REQUEST['explain'])) - { - global $db; - echo $db->sql_report; - return TRUE; - } - $_str = ''; if (!$this->compile_load($_str, $handle, true)) -- cgit v1.2.1