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 /phpBB/viewtopic.php | |
| 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
Diffstat (limited to 'phpBB/viewtopic.php')
| -rw-r--r-- | phpBB/viewtopic.php | 15 |
1 files changed, 9 insertions, 6 deletions
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)); } |
