Skip to:
Content
Pages
Categories
Search
Top
Bottom

Building Link to My Friends Activity

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

  • Burt Adsit
    Participant

    @burtadsit

    $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()


    jvinch
    Participant

    @jvinch

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


    Burt Adsit
    Participant

    @burtadsit

    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.


    jvinch
    Participant

    @jvinch

    Works like a champ. Thanks.


    jvinch
    Participant

    @jvinch

    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