Changeset 1064
- Timestamp:
- 11/26/09 22:50:21 (2 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
common/db/smf.php (modified) (1 diff)
-
www/views/sitewide.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/db/smf.php
r1058 r1064 220 220 } 221 221 222 // Counts the number of unread personal messages 223 function smf_get_pm_count($username) { 224 $from_cache = mem_cache_get("smf-new-pm-".$username); 225 226 if ($from_cache !== false) { 227 return $from_cache; 228 } 229 230 $user_smf_id = smf_get_member_id($username); 231 $prefix = IA_SMF_DB_PREFIX; 232 $query = " 233 SELECT COUNT(*) FROM {$prefix}pm_recipients 234 WHERE ID_MEMBER = ".$user_smf_id." AND is_read = 0 235 "; 236 237 // Cache value 238 $new_pm_count = db_query_value($query); 239 mem_cache_set("smf-new-pm-".$username, $new_pm_count, 600); 240 return $new_pm_count; 241 } 222 242 ?> -
trunk/www/views/sitewide.php
r938 r1064 84 84 <li> 85 85 <?= getattr($pre, 'pm') ?> 86 <?= format_link(url_forum() . "?action=pm", "mesaje") ?> 86 <?php 87 $new_pm_count = smf_get_pm_count($identity_user['username']); 88 if ($new_pm_count) { ?> 89 <?= format_link(url_forum() . "?action=pm", "<b>mesaje (".$new_pm_count.")</b>", false) ?> 90 <?php } else { ?> 91 <?= format_link(url_forum() . "?action=pm", "mesaje") ?> 92 <?php } ?> 87 93 <?= getattr($post, 'pm') ?> 88 94 </li>
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)