mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-05 23:25:30 +02:00
revert newest post change.
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3610 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
34f1c6df98
commit
3bb8fffb70
@ -64,30 +64,14 @@ if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
|
|||||||
|
|
||||||
if ( $session_id )
|
if ( $session_id )
|
||||||
{
|
{
|
||||||
$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array();
|
|
||||||
|
|
||||||
$topic_last_read = (!empty($tracking_topics[$topic_id])) ? $tracking_topics[$topic_id] : 'u.user_lastvisit';
|
|
||||||
|
|
||||||
$sql = "SELECT p.post_id
|
$sql = "SELECT p.post_id
|
||||||
FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
|
FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
|
||||||
WHERE s.session_id = '$session_id'
|
WHERE s.session_id = '$session_id'
|
||||||
AND u.user_id = s.session_user_id
|
AND u.user_id = s.session_user_id
|
||||||
AND p.topic_id = " . intval($topic_id) . "
|
AND p.topic_id = $topic_id
|
||||||
AND p.post_time >= " . intval($topic_last_read) . "
|
AND p.post_time >= u.user_lastvisit
|
||||||
ORDER BY p.post_time DESC
|
ORDER BY p.post_time ASC
|
||||||
LIMIT 1";
|
LIMIT 1";
|
||||||
|
|
||||||
if ( !($result = $db->sql_query($sql)) )
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !($row = $db->sql_fetchrow($result)) )
|
|
||||||
{
|
|
||||||
$sql = "SELECT topic_last_post_id as post_id
|
|
||||||
FROM " . TOPICS_TABLE . "
|
|
||||||
WHERE topic_id = " . intval($topic_id);
|
|
||||||
|
|
||||||
if ( !($result = $db->sql_query($sql)) )
|
if ( !($result = $db->sql_query($sql)) )
|
||||||
{
|
{
|
||||||
message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
|
message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
|
||||||
@ -97,7 +81,6 @@ if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
|
|||||||
{
|
{
|
||||||
message_die(GENERAL_MESSAGE, 'No_new_posts_last_visit');
|
message_die(GENERAL_MESSAGE, 'No_new_posts_last_visit');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$post_id = $row['post_id'];
|
$post_id = $row['post_id'];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user