aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-08-21 16:35:52 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-08-21 16:35:52 +0000
commit37818e4c9d3fa140705d1022724c901db356933d (patch)
tree1d41c7fff2a24cefa270c341b90ddfe10e20018e
parent68a2c07b2ec07752007f386d22a7df70f14f9a3e (diff)
downloadforums-37818e4c9d3fa140705d1022724c901db356933d.tar
forums-37818e4c9d3fa140705d1022724c901db356933d.tar.gz
forums-37818e4c9d3fa140705d1022724c901db356933d.tar.bz2
forums-37818e4c9d3fa140705d1022724c901db356933d.tar.xz
forums-37818e4c9d3fa140705d1022724c901db356933d.zip
Fixed problem with index not showing unread topics in forums for recent replies
git-svn-id: file:///svn/phpbb/trunk@912 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/index.php22
1 files changed, 15 insertions, 7 deletions
diff --git a/phpBB/index.php b/phpBB/index.php
index 95711d4500..4a406f6d2e 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -138,7 +138,7 @@ if($total_categories = $db->sql_numrows($q_categories))
}
$forum_rows = $db->sql_fetchrowset($q_forums);
- $sql = "SELECT f.forum_id, t.topic_id
+ $sql = "SELECT f.forum_id, t.topic_id, p.post_time
FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE t.forum_id = f.forum_id
AND p.post_id = t.topic_last_post_id
@@ -150,7 +150,7 @@ if($total_categories = $db->sql_numrows($q_categories))
while( $topic_data = $db->sql_fetchrow($new_topic_ids) )
{
- $new_topic_data[$topic_data['forum_id']][] = $topic_data['topic_id'];
+ $new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time'];
}
//
@@ -248,19 +248,26 @@ if($total_categories = $db->sql_numrows($q_categories))
$unread_topics = false;
if( count($new_topic_data[$forum_id]) )
{
- for($k = 0; $k < count($new_topic_data[$forum_id]); $k++)
+ while( list($check_topic_id, $check_post_time) = each($new_topic_data[$forum_id]) )
{
- if( !isset($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $new_topic_data[$forum_id][$k]]) )
+ if( !isset($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $check_topic_id]) )
{
if($mark_read == "forums")
{
- setcookie('phpbb2_' . $forum_id . '_' . $new_topic_data[$forum_id][$k], time(), 0, $cookiepath, $cookiedomain, $cookiesecure);
+ setcookie('phpbb2_' . $forum_id . '_' . $check_topic_id, time(), 0, $cookiepath, $cookiedomain, $cookiesecure);
}
else
{
$unread_topics = true;
}
}
+ else
+ {
+ if($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $check_topic_id] < $check_post_time )
+ {
+ $unread_topics = true;
+ }
+ }
}
}
@@ -321,16 +328,17 @@ if($total_categories = $db->sql_numrows($q_categories))
$mod_count++;
}
}
+
if($moderators_links == "")
{
$moderators_links = "&nbsp;";
}
- $row_color = "#" . ( ( !($count%2) ) ? $theme['td_color1'] : $theme['td_color2'] );
+ $row_color = ( !($count%2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($count%2) ) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars("catrow.forumrow", array(
- "ROW_COLOR" => $row_color,
+ "ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
"FOLDER" => $folder_image,
"FORUM_NAME" => stripslashes($forum_rows[$j]['forum_name']),