Skip to:
Content
Pages
Categories
Search
Top
Bottom

$bp->current_component problem in directory member view


  • Sven Lehnert
    Participant

    @svenl77

    If I use $bp->current_component in the directory members view, it gives me back ” ” .

    In the other views (groups, blogs …) it give me back the correct component name.

    Somebody know way I cant use it in the members view ? but everywhere else it is working.

Viewing 2 replies - 1 through 2 (of 2 total)

  • Burt Adsit
    Participant

    @burtadsit

    It’s a bug in function bp_core_set_uri_globals() in the file bp-core-catchuri.php. That var gets trashed when the directory is launched.

    bp builds the vars $bp->current_component, $bp->current_action and $bp->action_variables for us but in case of emergency, like this, we still have $bp_unfiltered_uri which bp_core_set_uri_globals() builds for us. $bp_unfiltered_uri is an array of strings that is all the individual pieces of the url in sequence:

    http://members/burtadsit/wire’ becomes:

    array(3) { [0]=> string(7) “members” [1]=> string(5) “burtadsit” [2]=> string(4) “wire” }

    So anywhere you really want to see what got you to some spot in bp, use:

    global $bp_unfiltered_uri;

    In the case of the directories the first element of the array is what you are looking for. So: $bp_unfiltered_uri[0] gets you what you want.


    Sven Lehnert
    Participant

    @svenl77

    Thanks for the detailed explanation :-Sven

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘$bp->current_component problem in directory member view’ is closed to new replies.
Skip to toolbar