|
From: Paul S. O. <ps...@us...> - 2001-11-04 12:55:25
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv9214
Modified Files:
viewforum.php
Log Message:
Support for new locked with new topics icon
Index: viewforum.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewforum.php,v
retrieving revision 1.98
retrieving revision 1.99
diff -C2 -r1.98 -r1.99
*** viewforum.php 2001/11/03 13:57:29 1.98
--- viewforum.php 2001/11/04 12:55:22 1.99
***************
*** 113,156 ****
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) )
{
! $mark_read_list = $db->sql_fetchrowset($t_result);
! for($i = 0; $i < $mark_read_rows; $i++ )
{
! $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") . '">')
! );
! $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);
}
//
--- 113,159 ----
if( $mark_read == "topics" )
{
! if( $userdata['session_last_visit'] )
{
! $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) )
{
! $mark_read_list = $db->sql_fetchrowset($t_result);
! for($i = 0; $i < $mark_read_rows; $i++ )
{
! $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") . '">')
! );
! $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);
! }
}
//
***************
*** 475,485 ****
}
! 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 )
- {
$topic_type = $lang['Topic_Moved'] . " ";
$topic_id = $topic_rowset[$i]['topic_moved_id'];
--- 478,483 ----
}
! if( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED )
{
$topic_type = $lang['Topic_Moved'] . " ";
$topic_id = $topic_rowset[$i]['topic_moved_id'];
***************
*** 490,494 ****
else
{
! if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE )
{
$folder = $images['folder_announce'];
--- 488,497 ----
else
{
! 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'];
***************
*** 505,509 ****
{
$folder = $images['folder_hot'];
! $folder_new = $images['folder_new_hot'];
}
else
--- 508,512 ----
{
$folder = $images['folder_hot'];
! $folder_new = $images['folder_hot_new'];
}
else
***************
*** 532,536 ****
else
{
! $folder_image = "<img src=\"$folder\" alt=\"" . $lang['No_new_posts'] . "\" />";
$newest_post_img = "";
}
--- 535,540 ----
else
{
! $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 = "";
}
***************
*** 538,542 ****
else
{
! $folder_image = "<img src=\"$folder\" alt=\"" . $lang['No_new_posts'] . "\" />";
$newest_post_img = "";
}
--- 542,547 ----
else
{
! $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 = "";
}
|