Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/12/2009 06:19:36 PM (18 years ago)
Author:
apeatling
Message:

Friend and Group template tag updates.

File:
1 edited

Legend:

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

    r1138 r1205  
    122122}
    123123
    124         function bp_has_users() {
    125                 bp_has_friendships();
    126         }
    127 
    128124function bp_the_friendship() {
    129125        global $friends_template;
    130126        return $friends_template->the_friendship();
    131127}
    132         function bp_the_user() {
    133                 bp_the_friendship();
    134         }
    135128
    136129function bp_user_friendships() {
    … …  
    138131        return $friends_template->user_friendships();
    139132}
    140         function bp_friends_user_users() {
    141                 bp_friends_user_friendships();
    142         }
    143133
    144134function bp_friend_avatar_thumb( $template = false ) {
    … …  
    150140        echo apply_filters( 'bp_friend_avatar_thumb', $template->avatar_thumb );
    151141}
    152         function bp_user_avatar_thumb() {
    153                 global $friends_template;
    154                 bp_friend_avatar_thumb( $friends_template->friendship );
    155         }
    156142
    157143function bp_friend_status( $template = false ) {
    … …  
    164150                echo apply_filters( 'bp_friend_status', $template->status );
    165151}
    166         function bp_user_status_message() {
    167                 global $friends_template;
    168                 bp_friend_status( $friends_template->friendship );
    169         }
    170 
     152
     153function bp_friend_name( $template = false ) {
     154        global $friends_template;
     155       
     156        if ( !$template )
     157                $template = &$friends_template->friendship->friend;
     158       
     159        echo apply_filters( 'bp_friend_name', strip_tags( $template->user_link ) );     
     160}
     161       
    171162function bp_friend_link( $template = false ) {
    172163        global $friends_template;
    … …  
    177168        echo apply_filters( 'bp_friend_link', $template->user_link );
    178169}
    179         function bp_user_url() {
    180                 global $friends_template;
    181                 bp_friend_link( $friends_template->friendship );
    182         }
     170
     171function bp_friend_url( $template = false ) {
     172        global $friends_template;
     173
     174        if ( !$template )
     175                $template = &$friends_template->friendship->friend;
     176
     177        echo apply_filters( 'bp_friend_url', $template->user_url );
     178}
    183179
    184180function bp_friend_last_active( $time = false, $template = false ) {
    … …  
    193189        echo apply_filters( 'bp_friend_last_active', $time );
    194190}
    195         function bp_user_last_active( $time = false ) {
    196                 global $friends_template;
    197                 bp_friend_last_active( $time, $friends_template->friendship );
    198         }
    199191
    200192function bp_friend_last_profile_update( $template = false ) {
    … …  
    206198        echo apply_filters( 'bp_friend_last_profile_update', $template->profile_last_updated );
    207199}
    208         function bp_user_last_profile_update() {
    209                 global $friends_template;
    210                 bp_friend_last_profile_update( $friends_template->friendship );
    211         }
    212200
    213201function bp_friend_last_status_update( $template = false ) {
    … …  
    219207        echo apply_filters( 'bp_friend_last_status_update', $template->profile_last_updated );
    220208}
    221         function bp_user_last_status_update() {
    222                 global $friends_template;
    223                 bp_friend_last_status_update( $friends_template->friendship );
    224         }
     209
    225210
    226211function bp_friend_last_content_update( $template = false ) {
    … …  
    232217        echo apply_filters( 'bp_friend_last_content_update', $template->content_last_updated );
    233218}
    234         function bp_user_last_content_update() {
    235                 global $friends_template;
    236                 bp_friend_last_content_update( $friends_template->friendship );
    237         }
    238219
    239220function bp_friend_time_since_requested() {
Note: See TracChangeset for help on using the changeset viewer.