Changeset 5696 for trunk/bp-messages/bp-messages-functions.php
- Timestamp:
- 02/10/2012 09:02:53 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-messages/bp-messages-functions.php
r5417 r5696 1 1 <?php 2 /******************************************************************************* 2 3 /** 4 * BuddyPress Messages Functions 5 * 3 6 * Business functions are where all the magic happens in BuddyPress. They will 4 7 * handle the actual saving or manipulation of information. Usually they will 5 8 * hand off to a database class for data access, then return 6 9 * true or false on success or failure. 10 * 11 * @package BuddyPress 12 * @subpackage MessagesFunctions 7 13 */ 8 14 … … 11 17 12 18 function messages_new_message( $args = '' ) { 13 global $bp;14 19 15 20 $defaults = array ( … … 144 149 $error = 0; 145 150 for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { 146 if ( !$status = BP_Messages_Thread::delete( $thread_ids[$i]) ) 151 if ( !$status = BP_Messages_Thread::delete( $thread_ids[$i]) ) { 147 152 $error = 1; 153 } 148 154 } 149 155 … … 165 171 166 172 function messages_check_thread_access( $thread_id, $user_id = 0 ) { 167 global $bp;168 169 173 if ( empty( $user_id ) ) 170 174 $user_id = bp_loggedin_user_id(); … … 194 198 195 199 function messages_get_unread_count( $user_id = 0 ) { 196 global $bp;197 198 200 if ( empty( $user_id ) ) 199 201 $user_id = bp_loggedin_user_id(); … … 213 215 return BP_Messages_Thread::is_valid( $thread_id ); 214 216 } 215 216 /*******************************************************************************217 * These functions handle the recording, deleting and formatting of activity and218 * notifications for the user and for this specific component.219 */220 217 221 218 /** … … 231 228 */ 232 229 function messages_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { 233 global $bp;234 230 235 231 if ( 'new_message' == $action ) { … … 237 233 $title = __( 'Inbox', 'buddypress' ); 238 234 239 if ( (int) $total_items > 1 ) {235 if ( (int) $total_items > 1 ) { 240 236 $text = sprintf( __('You have %d new messages', 'buddypress' ), (int)$total_items ); 241 237 $filter = 'bp_messages_multiple_new_message_notification'; … … 252 248 'text' => $text, 253 249 'link' => $link 254 ), $link, (int) $total_items, $text, $link );250 ), $link, (int) $total_items, $text, $link ); 255 251 } 256 252 … … 259 255 return $return; 260 256 } 257 261 258 ?>
Note: See TracChangeset
for help on using the changeset viewer.