aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewforum.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-11-04 12:55:23 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-11-04 12:55:23 +0000
commitf0e441777b964384e9fde384788d7f29dd340cf2 (patch)
tree8db59026c698e006d333fbcdb94fe25989f617d9 /phpBB/viewforum.php
parent2a11de8efcfbaac2f4928a8867d4dec22f069b9b (diff)
downloadforums-f0e441777b964384e9fde384788d7f29dd340cf2.tar
forums-f0e441777b964384e9fde384788d7f29dd340cf2.tar.gz
forums-f0e441777b964384e9fde384788d7f29dd340cf2.tar.bz2
forums-f0e441777b964384e9fde384788d7f29dd340cf2.tar.xz
forums-f0e441777b964384e9fde384788d7f29dd340cf2.zip
Support for new locked with new topics icon
git-svn-id: file:///svn/phpbb/trunk@1274 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewforum.php')
-rw-r--r--phpBB/viewforum.php81
1 files changed, 43 insertions, 38 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 8c8482a9a1..cf2329870e 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -112,46 +112,49 @@ if( !$is_auth['auth_read'] || !$is_auth['auth_view'] )
//
if( $mark_read == "topics" )
{
- $sql = "SELECT t.topic_id, p.post_time
- FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
- WHERE t.forum_id = $forum_id
- AND p.post_id = t.topic_last_post_id
- AND p.post_time > " . $userdata['session_last_visit'] . "
- AND t.topic_moved_id IS NULL";
- if(!$t_result = $db->sql_query($sql))
- {
- message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql);
- }
-
- if( $mark_read_rows = $db->sql_numrows($t_result) )
+ if( $userdata['session_last_visit'] )
{
- $mark_read_list = $db->sql_fetchrowset($t_result);
+ $sql = "SELECT t.topic_id, p.post_time
+ FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
+ WHERE t.forum_id = $forum_id
+ AND p.post_id = t.topic_last_post_id
+ AND p.post_time > " . $userdata['session_last_visit'] . "
+ AND t.topic_moved_id IS NULL";
+ if(!$t_result = $db->sql_query($sql))
+ {
+ message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql);
+ }
- for($i = 0; $i < $mark_read_rows; $i++ )
+ if( $mark_read_rows = $db->sql_numrows($t_result) )
{
- $topic_id = $mark_read_list[$i]['topic_id'];
- $post_time = $mark_read_list[$i]['post_time'];
+ $mark_read_list = $db->sql_fetchrowset($t_result);
- if( empty($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) )
+ for($i = 0; $i < $mark_read_rows; $i++ )
{
- setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
- }
- else
- {
- if( isset($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) )
+ $topic_id = $mark_read_list[$i]['topic_id'];
+ $post_time = $mark_read_list[$i]['post_time'];
+
+ if( empty($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) )
{
setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
}
+ else
+ {
+ if( isset($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) )
+ {
+ setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
+ }
+ }
}
}
- }
- $template->assign_vars(array(
- "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">')
- );
+ $template->assign_vars(array(
+ "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">')
+ );
- $message = $lang['Topics_marked_read'] . "<br /><br />" . sprintf($lang['Click_return_forum'], "<a href=\"" . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">", "</a> ");
- message_die(GENERAL_MESSAGE, $message);
+ $message = $lang['Topics_marked_read'] . "<br /><br />" . sprintf($lang['Click_return_forum'], "<a href=\"" . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">", "</a> ");
+ message_die(GENERAL_MESSAGE, $message);
+ }
}
//
// End handle marking posts
@@ -474,12 +477,7 @@ if($total_topics)
$goto_page = "";
}
- if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED )
- {
- $folder_image = "<img src=\"" . $images['folder_locked'] . "\" alt=\"" . $lang['Topic_locked'] . "\" />";
- $newest_post_img = "";
- }
- else if( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED )
+ if( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED )
{
$topic_type = $lang['Topic_Moved'] . " ";
$topic_id = $topic_rowset[$i]['topic_moved_id'];
@@ -489,7 +487,12 @@ if($total_topics)
}
else
{
- if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE )
+ if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED )
+ {
+ $folder = $images['folder_locked'];
+ $folder_new = $images['folder_locked_new'];
+ }
+ else if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE )
{
$folder = $images['folder_announce'];
$folder_new = $images['folder_announce_new'];
@@ -504,7 +507,7 @@ if($total_topics)
if($replies >= $board_config['hot_threshold'])
{
$folder = $images['folder_hot'];
- $folder_new = $images['folder_new_hot'];
+ $folder_new = $images['folder_hot_new'];
}
else
{
@@ -531,13 +534,15 @@ if($total_topics)
}
else
{
- $folder_image = "<img src=\"$folder\" alt=\"" . $lang['No_new_posts'] . "\" />";
+ $folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
+ $folder_image = "<img src=\"$folder\" alt=\"$folder_alt\" />";
$newest_post_img = "";
}
}
else
{
- $folder_image = "<img src=\"$folder\" alt=\"" . $lang['No_new_posts'] . "\" />";
+ $folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
+ $folder_image = "<img src=\"$folder\" alt=\"$folder_alt\" />";
$newest_post_img = "";
}
}