1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-06 22:45:02 +02:00

More bugfixes

git-svn-id: file:///svn/phpbb/trunk@2951 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Ludovic Arnaud 2002-10-10 01:02:47 +00:00
parent c677640b64
commit 58ddae0c90
3 changed files with 120 additions and 124 deletions

View File

@ -22,6 +22,11 @@
foreach ($forum_rows as $row) foreach ($forum_rows as $row)
{ {
extract($row); extract($row);
if (!$auth->acl_get('f_list', $forum_id))
{
continue;
}
if ($parent_id == $root_id) if ($parent_id == $root_id)
{ {
if ($forum_status == ITEM_CATEGORY) if ($forum_status == ITEM_CATEGORY)
@ -45,133 +50,130 @@ foreach ($forum_rows as $row)
unset($stored_cat); 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'];
case ITEM_CATEGORY: $folder_alt = $lang['Category'];
$folder_image = $theme['sub_forum']; break;
$folder_alt = $lang['Category'];
break;
case ITEM_LOCKED: case ITEM_LOCKED:
$folder_image = $theme['forum_locked']; $folder_image = $theme['forum_locked'];
$folder_alt = $lang['Forum_locked']; $folder_alt = $lang['Forum_locked'];
break; break;
default: default:
$unread_topics = false; $unread_topics = false;
if ($userdata['user_id'] && $forum_last_post_time > $userdata['user_lastvisit']) 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 ($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time)
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) $unread_topics = false;
{
$unread_topics = false;
}
}
if (isset($mark_topics[$forum_id]) || isset($mark_forums[$forum_id]))
{
if ($mark_forums[$forum_id] > $userdata['user_lastvisit'] || !max($mark_topics[$forum_id]))
{
$unread_topics = false;
}
} }
} }
$folder_image = ($unread_topics) ? $theme['forum_new'] : $theme['forum']; if (isset($mark_topics[$forum_id]) || isset($mark_forums[$forum_id]))
$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 />';
$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'];
}
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)
{
$alist[$row['forum_id']] = $row['forum_name'];
}
asort($alist);
$links = array();
foreach ($alist as $subforum_id => $subforum_name)
{
$links[] = '<a href="viewforum.' . $phpEx . $SID . '&f=' . $subforum_id . '">' . htmlspecialchars($subforum_name) . '</a>';
}
$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'; if ($mark_forums[$forum_id] > $userdata['user_lastvisit'] || !max($mark_topics[$forum_id]))
{
$unread_topics = false;
}
} }
else }
{
$forum_type_switch = 'S_IS_FORUM';
}
}
$template->assign_block_vars('forumrow', array( $folder_image = ($unread_topics) ? $theme['forum_new'] : $theme['forum'];
$forum_type_switch => TRUE, $folder_alt = ($unread_topics) ? $lang['New_posts'] : $lang['No_new_posts'];
'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,
'FORUM_IMG' => $forum_image,
'L_SUBFORUM' => $l_subforums,
'L_MODERATOR' => $l_moderator,
'L_FORUM_FOLDER_ALT'=> $folder_alt,
'U_VIEWFORUM' => $forum_link
));
} }
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 .= '<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]))
{
$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)
{
$alist[$row['forum_id']] = $row['forum_name'];
}
asort($alist);
$links = array();
foreach ($alist as $subforum_id => $subforum_name)
{
$links[] = '<a href="viewforum.' . $phpEx . $SID . '&f=' . $subforum_id . '">' . htmlspecialchars($subforum_name) . '</a>';
}
$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,
'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,
'FORUM_IMG' => $forum_image,
'L_SUBFORUM' => $l_subforums,
'L_MODERATOR' => $l_moderator,
'L_FORUM_FOLDER_ALT'=> $folder_alt,
'U_VIEWFORUM' => $forum_link
));
} }
?> ?>

View File

@ -44,8 +44,9 @@ if (defined('DEBUG'))
if ($auth->acl_get('a_')) 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( $template->assign_vars(array(

View File

@ -167,13 +167,6 @@ class Template {
*/ */
function display($handle) function display($handle)
{ {
if (!empty($_REQUEST['explain']))
{
global $db;
echo $db->sql_report;
return TRUE;
}
$_str = ''; $_str = '';
if (!$this->compile_load($_str, $handle, true)) if (!$this->compile_load($_str, $handle, true))