diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-08-22 13:58:35 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-08-22 13:58:35 +0000 |
commit | 69e89c90674ebcb530dd0f61a74d82cb3bf9f331 (patch) | |
tree | 1d4702555544385d1cf8fd901f98eaf075ba3b93 /phpBB/index.php | |
parent | 6cf59bc2e964c30ebc1af8feba9d18c6ed88ae88 (diff) | |
download | forums-69e89c90674ebcb530dd0f61a74d82cb3bf9f331.tar forums-69e89c90674ebcb530dd0f61a74d82cb3bf9f331.tar.gz forums-69e89c90674ebcb530dd0f61a74d82cb3bf9f331.tar.bz2 forums-69e89c90674ebcb530dd0f61a74d82cb3bf9f331.tar.xz forums-69e89c90674ebcb530dd0f61a74d82cb3bf9f331.zip |
Forum/Topic marking updates
git-svn-id: file:///svn/phpbb/trunk@2879 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/index.php')
-rw-r--r-- | phpBB/index.php | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/phpBB/index.php b/phpBB/index.php index 398596253a..aa1311fe1a 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -55,7 +55,7 @@ $session->configure($userdata); // if ( $mark_read == 'forums' ) { - if ( $userdata['user_id'] != ANONYMOUS ) + if ( $userdata['user_id'] ) { setcookie($board_config['cookie_name'] . '_f_all', time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); } @@ -71,8 +71,8 @@ if ( $mark_read == 'forums' ) // End handle marking posts // -$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array(); -$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array(); +$mark_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t'])) : array(); +$mark_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f'])) : array(); // // If you don't use these stats on your index you may want to consider @@ -235,36 +235,22 @@ if ( ( $total_categories = count($category_rows) ) ) else { $unread_topics = false; - if ( $userdata['user_id'] != ANONYMOUS ) + if ( $userdata['user_id'] && $forum_data[$j]['forum_last_post_time'] > $userdata['user_lastvisit'] ) { - if ( !empty($new_topic_data[$row_forum_id]) ) + $unread_topics = true; + if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) ) { - $forum_last_post_time = 0; - - foreach ( $new_topic_data[$row_forum_id] as $check_topic_id => $check_post_time ) + if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_data[$j]['forum_last_post_time'] ) { - if ( empty($tracking_topics[$check_topic_id]) || $tracking_topics[$check_topic_id] < $check_post_time) - { - $unread_topics = true; - $forum_last_post_time = max($check_post_time, $forum_last_post_time); - - } - } - - if ( !empty($tracking_forums[$row_forum_id]) ) - { - if ( $tracking_forums[$row_forum_id] > $forum_last_post_time ) - { - $unread_topics = false; - } + $unread_topics = false; } + } - if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) ) + if ( isset($mark_topics[$row_forum_id]) || isset($mark_forums[$row_forum_id]) ) + { + if ( $mark_forums[$row_forum_id] > $userdata['user_lastvisit'] || !max($mark_topics[$row_forum_id]) ) { - if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time ) - { - $unread_topics = false; - } + $unread_topics = false; } } } |