Changeset 1311 in ExiteCMS for trunk/forum/index.php
- Timestamp:
- 02/27/08 11:25:49 (4 years ago)
- File:
-
- 1 edited
-
trunk/forum/index.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/forum/index.php
r1307 r1311 81 81 if (iMEMBER) { 82 82 if ($userdata['user_posts_unread']) { 83 // include the users own posts 84 $result2 = dbquery("SELECT count(*) as unread FROM ".$db_prefix."posts p LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id WHERE tr.user_id = '".$userdata['user_id']."' AND tr.forum_id = '".$data['forum_id']."' AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") AND (p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read)", false); 83 $result = dbquery(" 84 SELECT count(*) as unread 85 FROM ".$db_prefix."posts p 86 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 87 WHERE tr.user_id = '".$userdata['user_id']."' 88 AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") 89 AND ((p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read) 90 OR (p.post_datestamp < tr.thread_first_read OR (p.post_edittime != 0 AND p.post_edittime < tr.thread_first_read)))" 91 ); 85 92 } else { 86 // filter the users own posts 87 $result2 = dbquery("SELECT count(*) as unread FROM ".$db_prefix."posts p LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id WHERE tr.user_id = '".$userdata['user_id']."' AND tr.forum_id = '".$data['forum_id']."' AND p.post_author != '".$userdata['user_id']."' AND p.post_edituser != '".$userdata['user_id']."' AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") AND (p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read)", false); 88 } 93 $result = dbquery(" 94 SELECT count(*) as unread 95 FROM ".$db_prefix."posts p 96 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 97 WHERE tr.user_id = '".$userdata['user_id']."' 98 AND p.post_author != '".$userdata['user_id']."' 99 AND p.post_edituser != '".$userdata['user_id']."' 100 AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") 101 AND ((p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read) 102 OR (p.post_datestamp < tr.thread_first_read OR (p.post_edittime != 0 AND p.post_edittime < tr.thread_first_read)))" 103 ); 104 } 89 105 $data['unread_posts'] = ($result2 ? mysql_result($result2, 0) : 0); 90 106 } else {
Note: See TracChangeset
for help on using the changeset viewer.
