Changeset 1280 in ExiteCMS
- Timestamp:
- 02/14/08 15:02:48 (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
-
administration/tools/language_pack_English.php (modified) (1 diff)
-
administration/upgrade/rev01280.php (added)
-
edit_profile.php (modified) (2 diffs)
-
forum/index.php (modified) (1 diff)
-
forum/viewforum.php (modified) (2 diffs)
-
forum/viewthread.php (modified) (1 diff)
-
includes/templates/main.edit_profile.tpl (modified) (1 diff)
-
modules/user_info_panel/user_info_panel.php (modified) (1 diff)
-
themes/ExiteCMS/theme.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/administration/tools/language_pack_English.php
r1262 r1280 3077 3077 $localestrings['u033'] = "Open"; 3078 3078 $localestrings['u034'] = "Closed"; 3079 $localestrings['u035'] = " ";3079 $localestrings['u035'] = "Show your own posts as unread"; 3080 3080 $localestrings['u036'] = ""; 3081 3081 $localestrings['u037'] = "Html"; -
trunk/edit_profile.php
r1240 r1280 144 144 $user_newsletters = isNum($_POST['user_newsletters']) ? $_POST['user_newsletters'] : "1"; 145 145 $user_forum_fullscreen = isNum($_POST['user_forum_fullscreen']) ? $_POST['user_forum_fullscreen'] : "0"; 146 $user_posts_unread = isNum($_POST['user_posts_unread']) ? $_POST['user_posts_unread'] : "0"; 146 147 $user_theme = stripinput($_POST['user_theme']); 147 148 $user_offset = isset($_POST['user_offset']) ? $_POST['user_offset'] : "+0"; … … 185 186 } 186 187 if ($user_newpassword != "") { $newpass = " user_password=md5(md5('$user_newpassword')), "; } else { $newpass = " "; } 187 $result = dbquery("UPDATE ".$db_prefix."users SET user_name='$username', user_fullname='$user_fullname', ".$newpass."user_email='".$_POST['user_email']."', user_bad_email = '0', user_hide_email='$user_hide_email', user_location='$user_location', user_birthdate='$user_birthdate', user_aim='$user_aim', user_icq='$user_icq', user_msn='$user_msn', user_yahoo='$user_yahoo', user_web='$user_web', user_forum_fullscreen='$user_forum_fullscreen', user_ newsletters='$user_newsletters', user_theme='$user_theme', user_offset='$user_offset', ".$set_avatar."user_sig='$user_sig', user_locale='".$_POST['user_locale']."' WHERE user_id='".$this_userdata['user_id']."'");188 $result = dbquery("UPDATE ".$db_prefix."users SET user_name='$username', user_fullname='$user_fullname', ".$newpass."user_email='".$_POST['user_email']."', user_bad_email = '0', user_hide_email='$user_hide_email', user_location='$user_location', user_birthdate='$user_birthdate', user_aim='$user_aim', user_icq='$user_icq', user_msn='$user_msn', user_yahoo='$user_yahoo', user_web='$user_web', user_forum_fullscreen='$user_forum_fullscreen', user_posts_unread='$user_forum_posts_unread', user_newsletters='$user_newsletters', user_theme='$user_theme', user_offset='$user_offset', ".$set_avatar."user_sig='$user_sig', user_locale='".$_POST['user_locale']."' WHERE user_id='".$this_userdata['user_id']."'"); 188 189 if ($user_theme != $userdata['user_theme']) redirect(FUSION_SELF."?status=1"); 189 190 $result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id='".$this_userdata['user_id']."'"); -
trunk/forum/index.php
r1194 r1280 80 80 // get the unread posts count for this forum 81 81 if (iMEMBER) { 82 $result2 = 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 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); 82 if ($userdata['user_posts_unread']) { 83 // include the users own posts 84 $result2 = 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 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 } else { 86 // filter the users own posts 87 $result2 = 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 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 } 83 89 $data['unread_posts'] = ($result2 ? mysql_result($result2, 0) : 0); 84 90 } else { -
trunk/forum/viewforum.php
r1278 r1280 66 66 } 67 67 68 // get the number of unread posts in this forum69 $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 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);70 $variables['unread_posts'] = ($result ? mysql_result($result, 0) : 0);71 72 68 // if a forum rules custompage is given, check if it exists 73 69 $variables['rulespage_defined'] = false; … … 107 103 } 108 104 109 // check forunread posts in this forum105 // get the number of unread posts in this forum 110 106 if (iMEMBER) { 111 $result = dbquery(" 112 SELECT count(*) as unread, sum(tr.thread_page) AS pages 113 FROM ".$db_prefix."posts p 114 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 115 WHERE tr.user_id = '".$userdata['user_id']."' 116 AND tr.forum_id = '".$forum_id."' 117 AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") 118 AND (p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read) 119 ", false); 120 $data['unread_count'] = ($result ? mysql_result($result, 0) : 0); 107 if ($userdata['user_posts_unread']) { 108 // include the users own posts 109 $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 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 } else { 111 // filter the users own posts 112 $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 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 } 114 $variables['unread_posts'] = ($result ? mysql_result($result, 0) : 0); 121 115 } else { 122 $ data['unread_count'] = 0;116 $variables['unread_posts'] = 0; 123 117 } 124 118 -
trunk/forum/viewthread.php
r1260 r1280 191 191 // number of unread posts in this thread 192 192 if (iMEMBER) { 193 $result = dbquery(" 194 SELECT count(*) as unread, tr.thread_last_read, tr.thread_page 195 FROM ".$db_prefix."posts p 196 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 197 WHERE tr.user_id = '".$userdata['user_id']."' 198 AND tr.thread_id = '".$thread_id."' 199 AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") 200 AND (p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read) 201 GROUP BY tr.thread_id 202 "); 193 if ($userdata['user_posts_unread']) { 194 // include the users own posts 195 $result = dbquery(" 196 SELECT count(*) as unread, tr.thread_last_read, tr.thread_page 197 FROM ".$db_prefix."posts p 198 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 199 WHERE tr.user_id = '".$userdata['user_id']."' 200 AND tr.thread_id = '".$thread_id."' 201 AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") 202 AND (p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read) 203 GROUP BY tr.thread_id 204 "); 205 } else { 206 // filter the users own posts 207 $result = dbquery(" 208 SELECT count(*) as unread, tr.thread_last_read, tr.thread_page 209 FROM ".$db_prefix."posts p 210 LEFT JOIN ".$db_prefix."threads_read tr ON p.thread_id = tr.thread_id 211 WHERE tr.user_id = '".$userdata['user_id']."' 212 AND p.post_author != '".$userdata['user_id']."' 213 AND p.post_edituser != '".$userdata['user_id']."' 214 AND tr.thread_id = '".$thread_id."' 215 AND (p.post_datestamp > ".$settings['unread_threshold']." OR p.post_edittime > ".$settings['unread_threshold'].") 216 AND (p.post_datestamp > tr.thread_last_read OR p.post_edittime > tr.thread_last_read) 217 GROUP BY tr.thread_id 218 "); 219 } 203 220 if (dbrows($result)) { 204 221 $data = dbarray($result); -
trunk/includes/templates/main.edit_profile.tpl
r1130 r1280 102 102 <input type='radio' name='user_forum_fullscreen' value='1' {if $this_userdata.user_forum_fullscreen == "1"}checked="checked"{/if} />{$locale.u007} 103 103 <input type='radio' name='user_forum_fullscreen' value='0' {if $this_userdata.user_forum_fullscreen == "0"}checked="checked"{/if} />{$locale.u008} 104 </td> 105 </tr> 106 <tr> 107 <td class='tbl'> 108 {$locale.u035} 109 </td> 110 <td class='tbl'> 111 <input type='radio' name='user_posts_unread' value='1' {if $this_userdata.user_posts_unread == "1"}checked="checked"{/if} />{$locale.u007} 112 <input type='radio' name='user_posts_unread' value='0' {if $this_userdata.user_posts_unread == "0"}checked="checked"{/if} />{$locale.u008} 104 113 </td> 105 114 </tr> -
trunk/modules/user_info_panel/user_info_panel.php
r1220 r1280 32 32 } 33 33 $variables['new_pm_msg'] = dbcount("(pmindex_id)", "pm_index", "pmindex_user_id ='".$userdata['user_id']."' AND pmindex_to_id='".$userdata['user_id']."' AND pmindex_read_datestamp = '0'"); 34 $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); 34 if ($userdata['user_posts_unread']) { 35 // include the users own posts 36 $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); 37 } else { 38 // filter the users own posts 39 $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_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 } 35 41 $variables['new_post_msg'] = ($result ? mysql_result($result, 0) : 0); 36 42 // check if the forum_threads_list_panel module is installed -
trunk/themes/ExiteCMS/theme.php
r1194 r1280 66 66 // unread forum post indicator 67 67 if (iMEMBER) { 68 $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); 68 if ($userdata['user_posts_unread']) { 69 // include the users own posts 70 $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); 71 } else { 72 // filter the users own posts 73 $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_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 } 69 75 $variables['new_posts'] = ($result ? mysql_result($result, 0) : 0); 70 76 } else {
Note: See TracChangeset
for help on using the changeset viewer.
