Info
- 8 posts
- 2 voices
- Started 4 years ago by vlp
- Latest reply from vlp
- This topic is not resolved
How to link to favorites of logged user
-
- Posted 4 years ago #
Hi,
I would like to implement the favorites link for logged user on front-page, forum pages and topic pages.
I tried several ways, but without success.
It would be a lot easier for user to find his favorites on front-page like looking for it on profile (useless click).Anybody figure it out? Would it be possible?
-
- Posted 4 years ago #
one quick & dirty way:
<? if (bb_is_user_logged_in()) { ?><a href="<? echo $bb->uri.'profile.php?id='.bb_get_current_user_info( 'id' ); ?>&tab=favorites">favorites</a><? } ?> -
- Posted 4 years ago #
I don't mind that it is dirty way:))
thanks very much:)
-
- Posted 4 years ago #
Actually, forget that way.
I just checked the source and it's right there for us:<? if (bb_is_user_logged_in()) { echo '<a href="'.get_profile_tab_link(bb_get_current_user_info( 'id' ), 'favorites' ).'">favorites</a>'; } ?>much better
-
- Posted 4 years ago #
thx, but...
I want to use it in my user menu - outside a forum directory
example, I have forum at http://www.tasty.sk/forum and I want to show this link on entire website http://www.tasty.sk in menu (in header) . If I use this function, it get me error:
Fatal error: Call to undefined function bb_is_user_logged_in() in /home/tasty.sk/tasty.sk/www/wp-content/themes/tasty/header.php on line 94
-
- Posted 4 years ago #
Oh if you are trying to do it from an integrated WordPress you'll need to do this:
<? if function_exists("get_currentuserinfo") {global $user_ID;} else { $user_ID=bb_get_current_user_info( 'id' )} if ($user_ID) { echo '<a href="/forums/profile.php?id='.$user_ID.'&tab=favorites">favorites</a>';} ?>untested - change /forums/ to whatever your bbpress path is.
-
- Posted 4 years ago #
thanks, I found another way when integrating with wordpress
< a href="http://www.tasty.sk/forum/profile/<?php echo $user_identity; ?>/favorites">
I get the same results:)
-
- Posted 4 years ago #
My solution from my last comment worked fine, but it stops I don't know why.
Right know, if I point to "http://www.tasty.sk/forum/profile/<?php echo $user_identity; ?>/favorites" it takes me to "http://www.tasty.sk/user/vlp//favorites"Any ideas why could be this happening?
Or how to integrate favorites page (what url) to show it inside wordpress? -
You must log in to post.