Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to link to favorites of logged user


  • vlp
    Member

    @vlp

    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?

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

  • _ck_
    Participant

    @_ck_

    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><? } ?>


    vlp
    Member

    @vlp

    I don’t mind that it is dirty way:))

    thanks very much:)


    _ck_
    Participant

    @_ck_

    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


    vlp
    Member

    @vlp

    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


    _ck_
    Participant

    @_ck_

    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.


    vlp
    Member

    @vlp

    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:)

    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?

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

You must be logged in to reply to this topic.