Skip to:
Content
Pages
Categories
Search
Top
Bottom

Building Link to My Friends Activity

Viewing 5 replies - 1 through 5 (of 5 total)
  • @burtadsit

    Participant

    $bp['loggedin_userid'] is the global userid for the logged in user.

    So that url you described above would be:


    <a href="<?php echo bp_core_get_userurl($bp['loggedin_userid']) ?>activity/my-friends">Your Friends Activity</a>


    Because bp_core_get_userurl() returns this:


    return $bp['root_domain'] . '/' . MEMBERS_SLUG . '/' . $ud->user_login . '/';


    bp-core.php, bp_core_get_userurl()

    @anonymized-303747

    Inactive

    Hmmm Burt – that generates http://domain.com/activity/my-friends – and obviously an error page.

    @burtadsit

    Participant

    lemme try it in the browser…

    Yep. I see the problem:


    <a href="<?php global $bp; echo bp_core_get_userurl($bp['loggedin_userid']) ?>activity/my-friends">Your Friends Activity</a>


    That works. Wasn’t working for me either. I’m not trying this in a bp theme. Because I hadn’t declared that I wanted to play with $bp it resolves to nothing.

    Don’t know where you are using this but withing the scope of usage of that var you have to declare you want to use it.

    @anonymized-303747

    Inactive

    Works like a champ. Thanks.

    @anonymized-303747

    Inactive

    While we’re at it, Burt – what would the code be if I wanted to print the name of the currently logged in user on screen?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Building Link to My Friends Activity’ is closed to new replies.
Skip to toolbar