Skip to:
Content

BuddyPress.org

Changeset 3337


Ignore:
Timestamp:
11/02/2010 03:01:31 AM (14 years ago)
Author:
boonebgorges
Message:

Relativizes various URL creation and current_component/current_action checks to use slugs rather than string literals. Fixes #2338

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r3300 r3337  
    428428    global $bp, $wp_query;
    429429
    430     if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'friends' || $bp->action_variables[0] != 'feed' )
     430    if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->friends->slug || $bp->action_variables[0] != 'feed' )
    431431        return false;
    432432
     
    442442    global $bp, $wp_query;
    443443
    444     if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'groups' || $bp->action_variables[0] != 'feed' )
     444    if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->groups->slug || $bp->action_variables[0] != 'feed' )
    445445        return false;
    446446
  • trunk/bp-activity/bp-activity-templatetags.php

    r3318 r3337  
    992992    echo bp_get_member_activity_feed_link();
    993993}
    994 function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link(); }
     994function bp_activities_member_rss_link() {
     995    echo bp_get_member_activity_feed_link();
     996}
    995997
    996998    function bp_get_member_activity_feed_link() {
     
    9991001        if ( $bp->current_component == $bp->profile->slug || 'just-me' == $bp->current_action )
    10001002            $link = $bp->displayed_user->domain . $bp->activity->slug . '/feed/';
    1001         else if ( 'friends' == $bp->current_action )
    1002             $link = $bp->displayed_user->domain . $bp->activity->slug . '/friends/feed/';
    1003         else if ( 'groups' == $bp->current_action )
    1004             $link = $bp->displayed_user->domain . $bp->activity->slug . '/groups/feed/';
     1003        else if ( $bp->friends->slug == $bp->current_action )
     1004            $link = $bp->displayed_user->domain . $bp->activity->slug . '/' . $bp->friends->slug . '/feed/';
     1005        else if ( $bp->groups->slug == $bp->current_action )
     1006            $link = $bp->displayed_user->domain . $bp->activity->slug . '/' . $bp->groups->slug . '/feed/';
    10051007        else if ( 'favorites' == $bp->current_action )
    10061008            $link = $bp->displayed_user->domain . $bp->activity->slug . '/favorites/feed/';
  • trunk/bp-blogs.php

    r3332 r3337  
    5353
    5454    /* Set up the component options navigation for Blog */
    55     if ( 'blogs' == $bp->current_component ) {
     55    if ( $bp->blogs->slug == $bp->current_component ) {
    5656        if ( bp_is_my_profile() ) {
    5757            if ( function_exists('xprofile_setup_nav') ) {
  • trunk/bp-core/bp-core-templatetags.php

    r3329 r3337  
    16141614    global $bp;
    16151615
    1616     if ( $bp->activity->name == $bp->current_component )
     1616    if ( $bp->activity->slug == $bp->current_component )
    16171617        return true;
    16181618
     
    16231623    global $bp;
    16241624
    1625     if ( $bp->activity->name == $bp->current_component && 'my-friends' == $bp->current_action )
     1625    if ( $bp->activity->slug == $bp->current_component && 'my-friends' == $bp->current_action )
    16261626        return true;
    16271627
     
    16681668    global $bp;
    16691669
    1670     if ( $bp->groups->name == $bp->current_component )
     1670    if ( $bp->groups->slug == $bp->current_component )
    16711671        return true;
    16721672
     
    17951795    global $bp;
    17961796
    1797     if ( $bp->blogs->name == $bp->current_component )
     1797    if ( $bp->blogs->slug == $bp->current_component )
    17981798        return true;
    17991799
     
    18041804    global $bp;
    18051805
    1806     if ( $bp->blogs->name == $bp->current_component && 'recent-posts' == $bp->current_action )
     1806    if ( $bp->blogs->slug == $bp->current_component && 'recent-posts' == $bp->current_action )
    18071807        return true;
    18081808
     
    18131813    global $bp;
    18141814
    1815     if ( $bp->blogs->name == $bp->current_component && 'recent-comments' == $bp->current_action )
     1815    if ( $bp->blogs->slug == $bp->current_component && 'recent-comments' == $bp->current_action )
    18161816        return true;
    18171817
Note: See TracChangeset for help on using the changeset viewer.