Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/02/2009 06:56:42 PM (17 years ago)
Author:
apeatling
Message:

Merging last few trunk changes and stripping all whitespace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1/bp-status/bp-status-templatetags.php

    r2038 r2076  
    1111                if ( 'clear' == $_GET['status'] && is_user_logged_in() )
    1212                        bp_status_clear_status();
    13                
     13
    1414                echo bp_get_the_status( $args );
    1515        }
    … …  
    1717        function bp_get_the_status( $args = false ) {
    1818                global $bp;
    19        
     19
    2020                $defaults = array(
    2121                        'user_id' => $bp->displayed_user->id,
    … …  
    2424                        'no_anchor' => false
    2525                );
    26        
     26
    2727                $r = wp_parse_args( $args, $defaults );
    2828                extract( $r, EXTR_SKIP );
    29                
     29
    3030                if ( !$user_id )
    3131                        $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
    3535                if ( empty($status) )
    3636                        return bp_get_update_status_button( 'text=' . $new_button_text );
    37                
     37
    3838                $time_since = sprintf( __( '%s ago', 'buddypress' ), bp_core_time_since( $status['recorded_time'] ) );
    3939                $content = apply_filters( 'the_status_content', $status['content'] );
    40                
     40
    4141                if ( !(int)$no_anchor && $user_id == $bp->loggedin_user->id )
    4242                        $content = '<a href="' . bp_core_get_user_domain( $user_id ) . '?status=new" id="status-new-status">' . $content . '</a>';
    … …  
    4444                $content .= ' <span class="time-since">' . $time_since . '</span>';
    4545                $content .= ' ' . bp_get_clear_status_button( 'text=' . $clear_button_text );
    46                
     46
    4747                return apply_filters( 'bp_get_the_status', $content );
    4848        }
    49        
     49
    5050function bp_update_status_button( $args = false ) {
    5151        echo bp_get_update_status_button( $args );
    … …  
    5858                        'text' => __( 'Update Your Status', 'buddypress' )
    5959                );
    60        
     60
    6161                $r = wp_parse_args( $args, $defaults );
    6262                extract( $r, EXTR_SKIP );
    63                
     63
    6464                if ( !$user_id )
    6565                        $user_id = $bp->displayed_user->id;
    66                
     66
    6767                if ( $user_id != $bp->loggedin_user->id )
    6868                        return false;
    69                
     69
    7070                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>' );
    7171        }
    … …  
    8181                        'text' => __( 'Clear', 'buddypress' )
    8282                );
    83        
     83
    8484                $r = wp_parse_args( $args, $defaults );
    8585                extract( $r, EXTR_SKIP );
    86                
     86
    8787                if ( !$user_id )
    8888                        $user_id = $bp->displayed_user->id;
    89                
     89
    9090                if ( $user_id != $bp->loggedin_user->id )
    9191                        return false;
    92                
     92
    9393                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>' );
    9494        }
    … …  
    9696function bp_status_form_action( $user_id = false ) {
    9797        global $bp;
    98        
     98
    9999        if ( !$user_id )
    100100                $user_id = $bp->loggedin_user->id;
    101                
     101
    102102        echo apply_filters( 'bp_status_form_action', bp_core_get_user_domain( $user_id ) . BP_STATUS_SLUG . '/add' );
    103103}
Note: See TracChangeset for help on using the changeset viewer.