aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-12-16 13:36:47 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-12-16 13:36:47 +0000
commite6e6be2b77e4ddfff79adfea4a7c65dce74807a8 (patch)
tree04b59784a7132904e28aae32586bec586bf0ab3c /phpBB/viewtopic.php
parent9e9710dc211dc7c283697618d9419cb2cc80b710 (diff)
downloadforums-e6e6be2b77e4ddfff79adfea4a7c65dce74807a8.tar
forums-e6e6be2b77e4ddfff79adfea4a7c65dce74807a8.tar.gz
forums-e6e6be2b77e4ddfff79adfea4a7c65dce74807a8.tar.bz2
forums-e6e6be2b77e4ddfff79adfea4a7c65dce74807a8.tar.xz
forums-e6e6be2b77e4ddfff79adfea4a7c65dce74807a8.zip
Fix view newest post error + missing mini post icon in posting preview
git-svn-id: file:///svn/phpbb/trunk@1604 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 994aefdfd6..d66532772f 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -63,10 +63,11 @@ if( isset($HTTP_GET_VARS["view"]) && empty($HTTP_GET_VARS[POST_POST_URL]) )
if( $session_id )
{
$sql = "SELECT p.post_id
- FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s
- WHERE topic_id = $topic_id
- AND s.session_id = '$session_id'
- AND p.post_time >= s.session_last_visit
+ FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
+ WHERE s.session_id = '$session_id'
+ AND u.user_id = s.session_user_id
+ AND p.topic_id = $topic_id
+ AND p.post_time >= u.user_lastvisit
ORDER BY p.post_time ASC
LIMIT 1";
if( !$result = $db->sql_query($sql) )