$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()
Hmmm Burt – that generates http://domain.com/activity/my-friends – and obviously an error page.
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.
Works like a champ. Thanks.
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?