Changeset 2397 for trunk/bp-messages/bp-messages-templatetags.php
- Timestamp:
- 01/21/2010 03:47:02 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-messages/bp-messages-templatetags.php
r2389 r2397 162 162 global $messages_template; 163 163 164 return apply_filters( 'bp_get_message_thread_id', $messages_template->thread->thread_id ); 164 /* Notice support */ 165 if ( empty( $messages_template->thread->thread_id ) ) 166 $id = $messages_template->thread->id; 167 else 168 $id = $messages_template->thread->thread_id; 169 170 return apply_filters( 'bp_get_message_thread_id', $id ); 165 171 } 166 172 … … 170 176 function bp_get_message_thread_subject() { 171 177 global $messages_template; 172 return apply_filters( 'bp_get_message_thread_subject', stripslashes_deep( $messages_template->thread->last_message_subject ) ); 178 179 /* Notice support */ 180 if ( empty( $messages_template->thread->last_message_subject ) ) 181 $subject = $messages_template->thread->subject; 182 else 183 $subject = $messages_template->thread->last_message_subject; 184 185 return apply_filters( 'bp_get_message_thread_subject', stripslashes_deep( $subject ) ); 173 186 } 174 187 … … 178 191 function bp_get_message_thread_excerpt() { 179 192 global $messages_template; 180 return apply_filters( 'bp_get_message_thread_excerpt', strip_tags( bp_create_excerpt($messages_template->thread->last_message_message, 10 ) ) ); 193 194 /* Notice support */ 195 if ( empty( $messages_template->thread->last_message_message ) ) 196 $message = $messages_template->thread->message; 197 else 198 $message = $messages_template->thread->last_message_message; 199 200 return apply_filters( 'bp_get_message_thread_excerpt', strip_tags( bp_create_excerpt( $message, 10 ) ) ); 181 201 } 182 202 … … 185 205 } 186 206 function bp_get_message_thread_from() { 187 global $messages_template; 188 return apply_filters( 'bp_get_message_thread_from', bp_core_get_userlink($messages_template->thread->last_sender_id) ); 207 global $messages_template, $bp; 208 209 /* Notice support */ 210 if ( empty( $messages_template->thread->last_sender_id ) ) 211 $sender = $bp->loggedin_user->id; 212 else 213 $sender = $messages_template->thread->last_sender_id; 214 215 return apply_filters( 'bp_get_message_thread_from', bp_core_get_userlink($sender) ); 189 216 } 190 217 … … 239 266 function bp_get_message_thread_last_post_date() { 240 267 global $messages_template; 241 echo apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( strtotime($messages_template->thread->last_post_date) ) ); 268 269 /* Notice support */ 270 if ( empty( $messages_template->thread->last_post_date ) ) 271 $date = $messages_template->thread->date_sent; 272 else 273 $date = $messages_template->thread->last_post_date; 274 275 echo apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( strtotime($date) ) ); 242 276 } 243 277 … … 246 280 } 247 281 function bp_get_message_thread_avatar() { 248 global $messages_template; 249 echo apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array( 'item_id' => $messages_template->thread->last_sender_id, 'type' => 'thumb' ) ) ); 282 global $messages_template, $bp; 283 284 /* Notice support */ 285 if ( empty( $messages_template->thread->last_sender_id ) ) 286 $sender = $bp->loggedin_user->id; 287 else 288 $sender = $messages_template->thread->last_sender_id; 289 290 echo apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array( 'item_id' => $sender, 'type' => 'thumb' ) ) ); 250 291 } 251 292 … … 318 359 function bp_messages_options() { 319 360 global $bp; 320 321 if ( $bp->current_action != 'sentbox' ) {322 361 ?> 323 <?php _e( 'Select:', 'buddypress' ) ?> 324 <select name="message-type-select" id="message-type-select"> 325 <option value=""></option> 326 <option value="read"><?php _e('Read', 'buddypress') ?></option> 327 <option value="unread"><?php _e('Unread', 'buddypress') ?></option> 328 <option value="all"><?php _e('All', 'buddypress') ?></option> 329 </select> 362 <?php _e( 'Select:', 'buddypress' ) ?> 363 <select name="message-type-select" id="message-type-select"> 364 <option value=""></option> 365 <option value="read"><?php _e('Read', 'buddypress') ?></option> 366 <option value="unread"><?php _e('Unread', 'buddypress') ?></option> 367 <option value="all"><?php _e('All', 'buddypress') ?></option> 368 </select> 369 <?php if ( $bp->current_action != 'sentbox' && $bp->current_action != 'notices' ) : ?> 330 370 <a href="#" id="mark_as_read"><?php _e('Mark as Read', 'buddypress') ?></a> 331 371 <a href="#" id="mark_as_unread"><?php _e('Mark as Unread', 'buddypress') ?></a> 332 <?php }?>372 <?php endif; ?> 333 373 <a href="#" id="delete_<?php echo $bp->current_action ?>_messages"><?php _e('Delete Selected', 'buddypress') ?></a> 334 374 <?php … … 418 458 419 459 $notice = BP_Messages_Notice::get_active(); 420 $closed_notices = get_usermeta( $userdata->ID, 'closed_notices'); 460 461 if ( empty( $notice ) ) 462 return false; 463 464 $closed_notices = get_usermeta( $userdata->ID, 'closed_notices' ); 421 465 422 466 if ( !$closed_notices ) … … 426 470 if ( !in_array( $notice->id, $closed_notices ) && $notice->id ) { 427 471 ?> 428 <div class="notice" id="<?php echo $notice->id ?>"> 429 <h5><?php echo stripslashes($notice->subject) ?></h5> 430 <?php echo stripslashes($notice->message) ?> 431 <a href="#" id="close-notice"><?php _e( 'Close', 'buddypress' ) ?></a> 472 <div id="message" class="info notice" rel="n-<?php echo $notice->id ?>"> 473 <p> 474 <strong><?php echo stripslashes( wp_filter_kses( $notice->subject ) ) ?></strong><br /> 475 <?php echo stripslashes( wp_filter_kses( $notice->message) ) ?> 476 <a href="#" id="close-notice"><?php _e( 'Close', 'buddypress' ) ?></a> 477 </p> 432 478 </div> 433 479 <?php
Note: See TracChangeset
for help on using the changeset viewer.