Changeset 1307 in ExiteCMS
- Timestamp:
- 02/27/08 09:57:44 (4 years ago)
- Files:
-
- 10 edited
-
themes/PLi-Fusion/PLiTheme/php-files/themes/PLiTheme/theme.php (modified) (1 diff)
-
themes/PLi-Fusion/PLiThemeCentered/php-files/themes/PLiThemeCentered/theme.php (modified) (1 diff)
-
themes/PLi-Fusion/PLiXmas/php-files/themes/PLiXmas/theme.php (modified) (1 diff)
-
themes/public/ExiteCMS_70/php-files/themes/ExiteCMS_70/theme.php (modified) (1 diff)
-
trunk/forum/index.php (modified) (1 diff)
-
trunk/forum/viewforum.php (modified) (3 diffs)
-
trunk/forum/viewthread.php (modified) (4 diffs)
-
trunk/modules/user_info_panel/user_info_panel.php (modified) (1 diff)
-
trunk/profile.php (modified) (1 diff)
-
trunk/themes/ExiteCMS/theme.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
themes/PLi-Fusion/PLiTheme/php-files/themes/PLiTheme/theme.php
r1201 r1307 82 82 83 83 // unread forum post indicator 84 if (iMEMBER ) {84 if (iMEMBER && $settings['revision'] >= 1193) { 85 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); 86 86 $variables['new_posts'] = ($result ? mysql_result($result, 0) : 0); -
themes/PLi-Fusion/PLiThemeCentered/php-files/themes/PLiThemeCentered/theme.php
r1201 r1307 82 82 83 83 // unread forum post indicator 84 if (iMEMBER ) {84 if (iMEMBER && $settings['revision'] >= 1193) { 85 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); 86 86 $variables['new_posts'] = ($result ? mysql_result($result, 0) : 0); -
themes/PLi-Fusion/PLiXmas/php-files/themes/PLiXmas/theme.php
r1201 r1307 82 82 83 83 // unread forum post indicator 84 if (iMEMBER ) {84 if (iMEMBER && $settings['revision'] >= 1193) { 85 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); 86 86 $variables['new_posts'] = ($result ? mysql_result($result, 0) : 0); -
themes/public/ExiteCMS_70/php-files/themes/ExiteCMS_70/theme.php
r1303 r1307 65 65 66 66 // unread forum post indicator 67 if (iMEMBER ) {67 if (iMEMBER && $settings['revision'] >= 1193) { 68 68 if ($userdata['user_posts_unread']) { 69 69 // include the users own posts -
trunk/forum/index.php
r1280 r1307 82 82 if ($userdata['user_posts_unread']) { 83 83 // include the users own posts 84 $result2 = dbquery("SELECT count(*) as unread , sum(tr.thread_page) AS pagesFROM ".$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);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); 85 85 } else { 86 86 // filter the users own posts 87 $result2 = dbquery("SELECT count(*) as unread , sum(tr.thread_page) AS pagesFROM ".$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);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 88 } 89 89 $data['unread_posts'] = ($result2 ? mysql_result($result2, 0) : 0); -
trunk/forum/viewforum.php
r1280 r1307 107 107 if ($userdata['user_posts_unread']) { 108 108 // include the users own posts 109 $result = dbquery("SELECT count(*) as unread , sum(tr.thread_page) AS pagesFROM ".$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 = '".$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);109 $result = 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 = '".$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); 110 110 } else { 111 111 // filter the users own posts 112 $result = dbquery("SELECT count(*) as unread , sum(tr.thread_page) AS pagesFROM ".$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 = '".$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);112 $result = 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 = '".$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); 113 113 } 114 114 $variables['unread_posts'] = ($result ? mysql_result($result, 0) : 0); … … 152 152 if (isset($userdata['user_id']) && $variables['unread_posts']) { 153 153 $result2 = dbquery(" 154 SELECT count(*) as unread, sum(tr.thread_page) AS pages,MIN(p.post_id) as post_id154 SELECT count(*) as unread, MIN(p.post_id) as post_id 155 155 FROM ".$db_prefix."posts p 156 156 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id … … 173 173 $data['first_unread_post'] = 0; 174 174 } 175 // number of pages of posts in this thread176 $data['thread_pages'] = ceil($data['thread_replies'] / $settings['numofthreads']) + 1;177 175 // correct the number of replies 178 176 $data['thread_replies'] = max(0, $data['thread_replies'] - 1); -
trunk/forum/viewthread.php
r1295 r1307 194 194 // include the users own posts 195 195 $result = dbquery(" 196 SELECT count(*) as unread, tr.thread_last_read , tr.thread_page196 SELECT count(*) as unread, tr.thread_last_read 197 197 FROM ".$db_prefix."posts p 198 198 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id … … 206 206 // filter the users own posts 207 207 $result = dbquery(" 208 SELECT count(*) as unread, tr.thread_last_read , tr.thread_page208 SELECT count(*) as unread, tr.thread_last_read 209 209 FROM ".$db_prefix."posts p 210 210 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id … … 222 222 $variables['unread_posts'] = $data['unread']; 223 223 $thread_last_read = $data['thread_last_read']; 224 $thread_page = $data['thread_page'];225 224 } else { 226 225 $variables['unread_posts'] = 0; 227 226 $thread_last_read = time(); 228 $thread_page = 0;229 227 } 230 228 } else { 231 229 $variables['unread_posts'] = 0; 232 230 $thread_last_read = time(); 233 $thread_page = 0;234 231 } 235 232 … … 397 394 // update the threads_read record for this user and thread when the last_post_datestamp is newer 398 395 if (iMEMBER && $last_post_datestamp) { 399 $result = dbquery("UPDATE ".$db_prefix."threads_read SET thread_last_read = '".$last_post_datestamp."' , thread_page = '".min($rowstart, $thread_page)."'WHERE user_id = '".$userdata['user_id']."' AND thread_id = '".$thread_id."' AND thread_last_read < '".$last_post_datestamp."'");396 $result = dbquery("UPDATE ".$db_prefix."threads_read SET thread_last_read = '".$last_post_datestamp."' WHERE user_id = '".$userdata['user_id']."' AND thread_id = '".$thread_id."' AND thread_last_read < '".$last_post_datestamp."'"); 400 397 } 401 398 -
trunk/modules/user_info_panel/user_info_panel.php
r1280 r1307 34 34 if ($userdata['user_posts_unread']) { 35 35 // include the users own posts 36 $result = dbquery("SELECT count(*) as unread , sum(tr.thread_page) AS pagesFROM ".$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);36 $result = 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 (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); 37 37 } else { 38 38 // filter the users own posts 39 $result = dbquery("SELECT count(*) as unread , sum(tr.thread_page) AS pagesFROM ".$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_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);39 $result = 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 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); 40 40 } 41 41 $variables['new_post_msg'] = ($result ? mysql_result($result, 0) : 0); -
trunk/profile.php
r1286 r1307 92 92 $data['user_posts'] = number_format($data['user_posts']); 93 93 $data['show_viewposts_button'] = ($data['user_posts'] > 0 and file_exists(PATH_MODULES."forum_threads_list_panel/my_posts.php")); 94 $result = dbquery("SELECT count(*) as unread , sum(tr.thread_page) AS pagesFROM ".$db_prefix."posts p LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id WHERE tr.user_id = '".$data['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);94 $result = 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 = '".$data['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); 95 95 $data['unread_count'] = ($result ? mysql_result($result, 0) : 0); 96 96 $data['user_email'] = str_replace("@","@",$data['user_email']); -
trunk/themes/ExiteCMS/theme.php
r1280 r1307 68 68 if ($userdata['user_posts_unread']) { 69 69 // include the users own posts 70 $result = dbquery("SELECT count(*) as unread , sum(tr.thread_page) AS pagesFROM ".$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);70 $result = 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 (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); 71 71 } else { 72 72 // filter the users own posts 73 $result = dbquery("SELECT count(*) as unread , sum(tr.thread_page) AS pagesFROM ".$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_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);73 $result = 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 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); 74 74 } 75 75 $variables['new_posts'] = ($result ? mysql_result($result, 0) : 0);
Note: See TracChangeset
for help on using the changeset viewer.
