Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbPress 1.0-alpha-6 : Favorites problem

  • Hi all,

    I have a bbPress 1.0-alpha-6 running, and I don’t know why the favorites link on a topic doesn’t entirely work.

    When I click on the link “Add this topic to your favorites”, it creates a meta on the database “bb_favorites” with the proper id, BUT, the link still shows “add this topic to your favorites” instead of a link to the favorite page.

    AND, if I add another topic to my favs, it doesn’t add the id with the previous ones, but overrides the meta_value with the new one :/

    Is it a known bug or is something wrong with my bbpress ..?

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

  • chrishajer
    Participant

    @chrishajer

    At this point, I would suggest upgrading to bbPress 1.0 and troubleshoot from there. No sense rehashing alpha bugs.

    Ok thanks.

    Flag this resolved plz.

    Cleaning the house for V1 issues.

    Done!

    Ok just so you know, about the problem with the meta value :

    ” if I add another topic to my favs, it doesn’t add the id with the previous ones, but overrides the meta_value with the new one”, found the bug :

    in the functions.bb-users.php , $user->favorites is used instead of $user->bb_favorites.

    That solves the problem.

    <br />
    function bb_add_user_favorite( $user_id, $topic_id ) {<br />
    global $bbdb;<br />
    $user_id = (int) $user_id;<br />
    $topic_id = (int) $topic_id;<br />
    $user = bb_get_user( $user_id );<br />
    $topic = get_topic( $topic_id );<br />
    if ( !$user || !$topic )<br />
    return false;</p>
    <p> $fav = $user->bb_favorites ? explode(',', $user->bb_favorites) : array();<br />
    if ( ! in_array( $topic_id, $fav ) ) {<br />
    $fav[] = $topic_id;<br />
    $fav = implode(',', $fav);<br />
    bb_update_usermeta( $user->ID, $bbdb->prefix . 'favorites', $fav);<br />
    }<br />
    do_action('bb_add_user_favorite', $user_id, $topic_id);<br />
    return true;<br />
    }<br />

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

You must be logged in to reply to this topic.