bbPress

Simple, Fast, Elegant

bbPress support forums » Themes

How to link to favorites of logged user

(8 posts)
  • Started 1 year ago by vlp
  • Latest reply from vlp
  • This topic is not resolved
  1. 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 1 year ago #
  2. 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 1 year ago #
  3. I don't mind that it is dirty way:))

    thanks very much:)

    Posted 1 year ago #
  4. 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 1 year ago #
  5. thx, but...

    I want to use it in my user menu - outside a forum directory

    example, I have forum at www.tasty.sk/forum and I want to show this link on entire website 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 1 year ago #
  6. 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 1 year ago #
  7. 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 1 year ago #
  8. 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?

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.