diff options
author | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2002-11-05 07:03:14 +0000 |
---|---|---|
committer | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2002-11-05 07:03:14 +0000 |
commit | e9e9716acc9aa1258637d53f05e10be63014589c (patch) | |
tree | f00004d7edd141170a5da74e3136cb5b4fc23ba8 | |
parent | a583f7bd10539ddb764276049928a9e8cf4263f5 (diff) | |
download | forums-e9e9716acc9aa1258637d53f05e10be63014589c.tar forums-e9e9716acc9aa1258637d53f05e10be63014589c.tar.gz forums-e9e9716acc9aa1258637d53f05e10be63014589c.tar.bz2 forums-e9e9716acc9aa1258637d53f05e10be63014589c.tar.xz forums-e9e9716acc9aa1258637d53f05e10be63014589c.zip |
Experimental: link to the first unread post without redirection
git-svn-id: file:///svn/phpbb/trunk@3009 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/viewforum.php | 2 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 15 |
2 files changed, 10 insertions, 7 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 423bdbfa0e..a742c01290 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -502,7 +502,7 @@ if ($total_topics) $unread_topic = true; } - $newest_post_img = ($unread_topic) ? '<a href="viewtopic.' . $phpEx . $SID . '&t=' . $topic_id . '&view=newest">' . $user->img('goto_post_newest', 'View_newest_post') . '</a> ' : ''; + $newest_post_img = ($unread_topic) ? '<a href="viewtopic.' . $phpEx . $SID . '&t=' . $topic_id . '&view=newest#newest">' . $user->img('goto_post_newest', 'View_newest_post') . '</a> ' : ''; $folder_img = ($unread_topic) ? $folder_new : $folder; $folder_alt = ($unread_topic) ? 'New_posts' : (($topic_rowset[$i]['topic_status'] == ITEM_LOCKED) ? 'Topic_locked' : 'No_new_posts'); diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index f0d1c9a5f1..e6122766a9 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -48,8 +48,6 @@ if (isset($_GET['view']) && empty($post_id)) { $session_id = (!empty($_COOKIE[$config['cookie_name'] . '_sid'])) ? $_COOKIE[$config['cookie_name'] . '_sid'] : $_GET['sid']; - $SID = '?sid=' . ((!empty($_GET['sid'])) ? $session_id : ''); - if ($session_id) { $sql = "SELECT p.post_id @@ -69,11 +67,12 @@ if (isset($_GET['view']) && empty($post_id)) } $post_id = $row['post_id']; - redirect("viewtopic.$phpEx$SID&p=$post_id#$post_id"); + $newest_post_id = $post_id; +// redirect("viewtopic.$phpEx$SID&p=$post_id#$post_id"); } } - redirect("index.$phpEx"); +// redirect("index.$phpEx"); } else if ($_GET['view'] == 'next' || $_GET['view'] == 'previous') { @@ -801,6 +800,10 @@ if ($row = $db->sql_fetchrow($result)) // Define the little post icon $mini_post_img = ($row['post_time'] > $user->data['user_lastvisit'] && $row['post_time'] > $topic_last_read) ? $user->img('goto_post_new', $user->lang['New_post']) : $user->img('goto_post', $user->lang['Post']); + // Little post link and anchor name + $mini_post_url = 'viewtopic.' . $phpEx . $SID . '&p=' . $row['post_id'] . '#' . $row['post_id']; + $u_post_id = (!empty($newest_post_id) && $newest_post_id == $row['post_id']) ? 'newest' : $row['post_id']; + // Dump vars into template $template->assign_block_vars('postrow', array( 'POSTER_NAME' => $poster, @@ -852,8 +855,8 @@ if ($row = $db->sql_fetchrow($result)) 'S_ROW_COUNT' => $i++, 'U_MINI_POST' => $mini_post_url, - 'U_POST_ID' => $row['post_id']) - ); + 'U_POST_ID' => $u_post_id + )); } while ($row = $db->sql_fetchrow($result)); } |