Skip to:
Content

BuddyPress.org

Changeset 569


Ignore:
Timestamp:
11/21/2008 10:11:59 PM (17 years ago)
Author:
apeatling
Message:

Function updates to support translation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-wire/bp-wire-templatetags.php

    r531 r569  
    225225}
    226226
    227 function bp_wire_post_date( $date_format = null ) {
     227function bp_wire_post_date( $date_format = null, $echo = true ) {
    228228    global $wire_posts_template;
    229229
     
    231231        $date_format = get_option('date_format');
    232232       
    233     echo mysql2date( $date_format, $wire_posts_template->wire_post->date_posted ); 
    234 }
    235 
    236 function bp_wire_post_author_name() {
     233    if ( $echo )
     234        echo mysql2date( $date_format, $wire_posts_template->wire_post->date_posted );
     235    else
     236        return mysql2date( $date_format, $wire_posts_template->wire_post->date_posted );
     237}
     238
     239function bp_wire_post_author_name( $echo = true ) {
    237240    global $wire_posts_template;
    238241   
     
    274277}
    275278
    276 function bp_wire_poster_name() {
    277     global $bp;
    278    
    279     echo '<a href="' . $bp['loggedin_domain'] . $bp['profile']['slug'] . '">' . __('You', 'buddypress') . '</a>';
    280 }
    281 
    282 function bp_wire_poster_date( $date_format = null ) {
     279function bp_wire_poster_name( $echo = true ) {
     280    global $bp;
     281   
     282    if ( $echo )
     283        echo '<a href="' . $bp['loggedin_domain'] . $bp['profile']['slug'] . '">' . __('You', 'buddypress') . '</a>';
     284    else
     285        return '<a href="' . $bp['loggedin_domain'] . $bp['profile']['slug'] . '">' . __('You', 'buddypress') . '</a>';
     286}
     287
     288function bp_wire_poster_date( $date_format = null, $echo = true ) {
    283289    if ( !$date_format )
    284290        $date_format = get_option('date_format');
    285291
    286     echo mysql2date( $date_format, date("Y-m-d H:i:s") );   
     292    if ( $echo )
     293        echo mysql2date( $date_format, date("Y-m-d H:i:s") );
     294    else
     295        return mysql2date( $date_format, date("Y-m-d H:i:s") );
    287296}
    288297
Note: See TracChangeset for help on using the changeset viewer.