aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorLudovic Arnaud <ludovic_arnaud@users.sourceforge.net>2002-10-10 01:02:47 +0000
committerLudovic Arnaud <ludovic_arnaud@users.sourceforge.net>2002-10-10 01:02:47 +0000
commit58ddae0c90cbf8c751129c9d05432c376c8e374f (patch)
treedc9ab52d42cbfffa30e7c4dcf2069046ad4a7ca9 /phpBB
parentc677640b64e5c3fe8406e47f7eeef2f18c5edf71 (diff)
downloadforums-58ddae0c90cbf8c751129c9d05432c376c8e374f.tar
forums-58ddae0c90cbf8c751129c9d05432c376c8e374f.tar.gz
forums-58ddae0c90cbf8c751129c9d05432c376c8e374f.tar.bz2
forums-58ddae0c90cbf8c751129c9d05432c376c8e374f.tar.xz
forums-58ddae0c90cbf8c751129c9d05432c376c8e374f.zip
More bugfixes
git-svn-id: file:///svn/phpbb/trunk@2951 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/forums_display.php202
-rw-r--r--phpBB/includes/page_tail.php3
-rw-r--r--phpBB/includes/template.php7
3 files changed, 104 insertions, 108 deletions
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']) . '<br />';
+ if ($forum_last_post_id)
+ {
+ $last_post = create_date($board_config['default_dateformat'], $forum_last_post_time, $board_config['board_timezone']) . '<br />';
- $last_post .= ($forum_last_poster_id == ANONYMOUS) ? (($forum_last_poster_name != '') ? $forum_last_poster_name . ' ' : $lang['Guest'] . ' ') : '<a href="profile.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $forum_last_poster_id . '">' . $username . '</a> ';
+ $last_post .= ($forum_last_poster_id == ANONYMOUS) ? (($forum_last_poster_name != '') ? $forum_last_poster_name . ' ' : $lang['Guest'] . ' ') : '<a href="profile.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $forum_last_poster_id . '">' . $username . '</a> ';
- $last_post .= '<a href="viewtopic.' . $phpEx . '$SID&amp;f=' . $forum_id . '&amp;p=' . $forum_last_post_id . '#' . $forum_last_post_id . '">' . create_img($theme['goto_post_latest'], $lang['View_latest_post']) . '</a>';
- }
- else
- {
- $last_post = $lang['No_Posts'];
- }
+ $last_post .= '<a href="viewtopic.' . $phpEx . '$SID&amp;f=' . $forum_id . '&amp;p=' . $forum_last_post_id . '#' . $forum_last_post_id . '">' . create_img($theme['goto_post_latest'], $lang['View_latest_post']) . '</a>';
+ }
+ 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 = '&nbsp;';
+ $moderators_list = '&nbsp;';
+ }
+
+ 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 = '&nbsp;';
- $moderators_list = '&nbsp;';
+ $links[] = '<a href="viewforum.' . $phpEx . $SID . '&f=' . $subforum_id . '">' . htmlspecialchars($subforum_name) . '</a>';
}
+ $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 . '&amp;c=' . $forum_id;
+ $forum_type_switch = 'S_IS_SUBCAT';
+ break;
+
+ default:
+ $forum_link = 'viewforum.' . $phpEx . $SID . '&amp;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[] = '<a href="viewforum.' . $phpEx . $SID . '&f=' . $subforum_id . '">' . htmlspecialchars($subforum_name) . '</a>';
+ $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 . '&amp;c=' . $forum_id;
- $forum_type_switch = 'S_IS_SUBCAT';
- break;
-
- default:
- $forum_link = 'viewforum.' . $phpEx . $SID . '&amp;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 .= ' | <a href="' . $_SERVER['REQUEST_URI'] . '&amp;explain=1">Explain</a> ]';
+ $debug_output .= ' | <a href="' . $_SERVER['REQUEST_URI'] . '&amp;explain=1">Explain</a>';
}
+ $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))