Changeset 2076 for branches/1.1/bp-status/bp-status-templatetags.php
- Timestamp:
- 11/02/2009 06:56:42 PM (17 years ago)
- File:
-
- 1 edited
-
branches/1.1/bp-status/bp-status-templatetags.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1/bp-status/bp-status-templatetags.php
r2038 r2076 11 11 if ( 'clear' == $_GET['status'] && is_user_logged_in() ) 12 12 bp_status_clear_status(); 13 13 14 14 echo bp_get_the_status( $args ); 15 15 } … … 17 17 function bp_get_the_status( $args = false ) { 18 18 global $bp; 19 19 20 20 $defaults = array( 21 21 'user_id' => $bp->displayed_user->id, … … 24 24 'no_anchor' => false 25 25 ); 26 26 27 27 $r = wp_parse_args( $args, $defaults ); 28 28 extract( $r, EXTR_SKIP ); 29 29 30 30 if ( !$user_id ) 31 31 $user_id = $bp->displayed_user->id; 32 33 $status = apply_filters( 'bp_status_from_usermeta', get_usermeta( $user_id, 'bp_status' ) ); 34 32 33 $status = apply_filters( 'bp_status_from_usermeta', get_usermeta( $user_id, 'bp_status' ) ); 34 35 35 if ( empty($status) ) 36 36 return bp_get_update_status_button( 'text=' . $new_button_text ); 37 37 38 38 $time_since = sprintf( __( '%s ago', 'buddypress' ), bp_core_time_since( $status['recorded_time'] ) ); 39 39 $content = apply_filters( 'the_status_content', $status['content'] ); 40 40 41 41 if ( !(int)$no_anchor && $user_id == $bp->loggedin_user->id ) 42 42 $content = '<a href="' . bp_core_get_user_domain( $user_id ) . '?status=new" id="status-new-status">' . $content . '</a>'; … … 44 44 $content .= ' <span class="time-since">' . $time_since . '</span>'; 45 45 $content .= ' ' . bp_get_clear_status_button( 'text=' . $clear_button_text ); 46 46 47 47 return apply_filters( 'bp_get_the_status', $content ); 48 48 } 49 49 50 50 function bp_update_status_button( $args = false ) { 51 51 echo bp_get_update_status_button( $args ); … … 58 58 'text' => __( 'Update Your Status', 'buddypress' ) 59 59 ); 60 60 61 61 $r = wp_parse_args( $args, $defaults ); 62 62 extract( $r, EXTR_SKIP ); 63 63 64 64 if ( !$user_id ) 65 65 $user_id = $bp->displayed_user->id; 66 66 67 67 if ( $user_id != $bp->loggedin_user->id ) 68 68 return false; 69 69 70 70 return apply_filters( 'bp_get_update_status_button', '<div class="generic-button"><a href="' . bp_core_get_user_domain( $user_id ) . '?status=new" id="status-new-status">' . $text . '</a></div>' ); 71 71 } … … 81 81 'text' => __( 'Clear', 'buddypress' ) 82 82 ); 83 83 84 84 $r = wp_parse_args( $args, $defaults ); 85 85 extract( $r, EXTR_SKIP ); 86 86 87 87 if ( !$user_id ) 88 88 $user_id = $bp->displayed_user->id; 89 89 90 90 if ( $user_id != $bp->loggedin_user->id ) 91 91 return false; 92 92 93 93 return apply_filters( 'bp_get_clear_status_button', '<a href="' . bp_core_get_user_domain( $user_id ) . '?status=clear" id="status-clear-status">' . $text . '</a>' ); 94 94 } … … 96 96 function bp_status_form_action( $user_id = false ) { 97 97 global $bp; 98 98 99 99 if ( !$user_id ) 100 100 $user_id = $bp->loggedin_user->id; 101 101 102 102 echo apply_filters( 'bp_status_form_action', bp_core_get_user_domain( $user_id ) . BP_STATUS_SLUG . '/add' ); 103 103 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)