Skip to:
Content

BuddyPress.org

Changeset 3171


Ignore:
Timestamp:
08/10/2010 12:04:25 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Hard code component ID's to ensure proper display of secondary avatars if component is deactivated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-themes/bp-default/functions.php

    r3170 r3171  
    141141
    142142function bp_dtheme_activity_secondary_avatars( $action, $activity ) {
    143     global $bp;
    144143
    145144    switch ( $activity->component ) {
    146         case $bp->groups->id :
    147         case $bp->blogs->id :
    148         case $bp->friends->id :
    149             $reverse_content = strrev( $action );
    150             $position        = strpos( $reverse_content, 'a<' );
    151             $action          = substr_replace( $action, bp_get_activity_secondary_avatar(), -$position - 2, 0 );
     145        case 'groups' :
     146        case 'blogs' :
     147        case 'friends' :
     148            // Only insert avatar if one exists
     149            if ( $secondary_avatar = bp_get_activity_secondary_avatar() ) {
     150                $reverse_content = strrev( $action );
     151                $position        = strpos( $reverse_content, 'a<' );
     152                $action          = substr_replace( $action, $secondary_avatar, -$position - 2, 0 );
     153            }
    152154            break;
    153155    }
Note: See TracChangeset for help on using the changeset viewer.