Changeset 1312 in ExiteCMS for themes/PLi-Fusion/PLiXmas/php-files/themes/PLiXmas/theme.php
- Timestamp:
- 02/27/08 11:28:54 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
themes/PLi-Fusion/PLiXmas/php-files/themes/PLiXmas/theme.php
r1307 r1312 83 83 // unread forum post indicator 84 84 if (iMEMBER && $settings['revision'] >= 1193) { 85 $result = dbquery("SELECT count(*) as unread, sum(tr.thread_page) AS pages 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 (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); 85 if ($userdata['user_posts_unread']) { 86 $result = dbquery(" 87 SELECT count(*) as unread 88 FROM ".$db_prefix."posts p 89 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 90 WHERE tr.user_id = '".$userdata['user_id']."' 91 AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") 92 AND ((p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read) 93 OR (p.post_datestamp < tr.thread_first_read OR (p.post_edittime != 0 AND p.post_edittime < tr.thread_first_read)))" 94 ); 95 } else { 96 $result = dbquery(" 97 SELECT count(*) as unread 98 FROM ".$db_prefix."posts p 99 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 100 WHERE tr.user_id = '".$userdata['user_id']."' 101 AND p.post_author != '".$userdata['user_id']."' 102 AND p.post_edituser != '".$userdata['user_id']."' 103 AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") 104 AND ((p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read) 105 OR (p.post_datestamp < tr.thread_first_read OR (p.post_edittime != 0 AND p.post_edittime < tr.thread_first_read)))" 106 ); 107 } 86 108 $variables['new_posts'] = ($result ? mysql_result($result, 0) : 0); 87 109 } else {
Note: See TracChangeset
for help on using the changeset viewer.
