From 53dd64926a73eab3d9d7bd1a0ccbddd16b9aaf83 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Wed, 26 Sep 2001 22:12:38 +0000 Subject: topic watch/forum/topic read now cause a message to be displayed, changed profile ICQ for subSilver, various other changes git-svn-id: file:///svn/phpbb/trunk@1093 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/viewtopic.php | 73 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 6 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 7dffb86320..9d60156a07 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -53,7 +53,41 @@ if( !isset($topic_id) && !isset($post_id) ) // if( isset($HTTP_GET_VARS["view"]) && empty($HTTP_GET_VARS[POST_POST_URL]) ) { - if($HTTP_GET_VARS["view"] == "next") + if( $HTTP_GET_VARS["view"] == "newest" ) + { + if(isset($HTTP_COOKIE_VARS[$board_config['cookie_name']])) + { + $sessiondata = unserialize(stripslashes($HTTP_COOKIE_VARS[$board_config['cookie_name']])); + + $newest_time = $sessiondata['lastvisit']; + + $sql = "SELECT post_id + FROM " . POSTS_TABLE . " + WHERE topic_id = $topic_id + AND post_time >= $newest_time + ORDER BY post_time ASC + LIMIT 1"; + if(!$result = $db->sql_query($sql)) + { + message_die(GENERAL_ERROR, "Couldn't obtain newer/older topic information", "", __LINE__, __FILE__, $sql); + } + + if( !($row = $db->sql_fetchrow($result)) ) + { + message_die(GENERAL_MESSAGE, 'No new posts since your last visit'); + } + else + { + $post_id = $row['post_id']; + header("Location: viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id"); + } + } + else + { + header("Location: viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"); + } + } + else if($HTTP_GET_VARS["view"] == "next") { $sql_condition = ">"; $sql_ordering = "ASC"; @@ -198,6 +232,13 @@ if($userdata['user_id'] != ANONYMOUS) message_die(GENERAL_ERROR, "Couldn't delete topic watch information", "", __LINE__, __FILE__, $sql); } } + + $template->assign_vars(array( + "META" => '') + ); + + $message = $lang['No_longer_watching']. "

" . $lang['Click'] . " " . $lang['HERE'] . " " . $lang['to_return_topic']; + message_die(GENERAL_MESSAGE, $message); } else { @@ -235,6 +276,13 @@ if($userdata['user_id'] != ANONYMOUS) message_die(GENERAL_ERROR, "Couldn't insert topic watch information", "", __LINE__, __FILE__, $sql); } } + + $template->assign_vars(array( + "META" => '') + ); + + $message = $lang['You_are_watching']. "

" . $lang['Click'] . " " . $lang['HERE'] . " " . $lang['to_return_topic']; + message_die(GENERAL_MESSAGE, $message); } else { @@ -623,6 +671,18 @@ for($i = 0; $i < $total_posts; $i++) $poster_avatar = ""; } + // + // Define the little post icon + // + if( $postrow[$i]['post_time'] > $userdata['session_last_visit'] ) + { + $mini_post_img = '' . $lang['New_post'] . ''; + } + else + { + $mini_post_img = '' . $lang['Post'] . ''; + } + // // Generate ranks // @@ -676,16 +736,16 @@ for($i = 0; $i < $total_posts; $i++) if( !empty($postrow[$i]['user_icq']) ) { - $icq_status_img = ""; + $icq_status_img = ""; // // This cannot stay like this, it needs a 'proper' solution, eg a separate - // template for overlaying the ICQ icon, or we just do away with the icq status - // display (which is after all somewhat a pain in the rear :D + // template for overlaying the ICQ icon, or we just do away with the icq status + // display (which is after all somewhat a pain in the rear :D // if( $theme['template_name'] == "subSilver" ) { - $icq_add_img = '
' . $icq_status_img . '' . $lang['ICQ'] . '
'; + $icq_add_img = '
' . $icq_status_img . '' . $lang['ICQ'] . '
'; $icq_status_img = ""; } else @@ -818,6 +878,7 @@ for($i = 0; $i < $total_posts; $i++) $template->assign_block_vars("postrow", array( "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, + "MINI_POST_IMG" => $mini_post_img, "POSTER_NAME" => $poster, "POSTER_RANK" => $poster_rank, "RANK_IMAGE" => $rank_image, @@ -834,7 +895,7 @@ for($i = 0; $i < $total_posts; $i++) "EMAIL_IMG" => $email_img, "WWW_IMG" => $www_img, "ICQ_STATUS_IMG" => $icq_status_img, - "ICQ_ADD_IMG" => $icq_add_img, + "ICQ_ADD_IMG" => $icq_add_img, "AIM_IMG" => $aim_img, "MSN_IMG" => $msn_img, "YIM_IMG" => $yim_img, -- cgit v1.2.1