Skip to:
Content
Pages
Categories
Search
Top
Bottom

Achievements Plugin Not Working


  • kharla
    Participant

    @kharla

    I have the achievements plugin running on a buddypress community at http://www.clubgummy.com. I’ve been told by numerous members that their achievements are not unlocking.

    Here’s just one example email:

    “I’m having a couple problems under achievements. under profile welcome I’ve activated my account but the box won’t check, and she’s got that mona lisa smile I’ve cupdated my avatar photo twice and it will not check that box either. under group open social I’ve created two groups and the box wont check.”

    Other emails from members mention the same problems. Does anyone know why this may be happening or how to fix it?

    Buddypress 1.1.3

    WPMU 2.9.1

    Any information would be helpful.

    I have a group of beta testers currently test driving the website and I have promised them real prizes for earning a certain number of achievements.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Was this on a new install or did you upgrade from a previous version? I haven’t tested it on 1.1.3 since WPMU 2.8.*. Either way, I’m going to give it a quick once-over for BP 1.2/WPMU 2.9 so will check this then (I have not heard of this before now).


    kharla
    Participant

    @kharla

    Yes, I recently upgraded both Buddypress and WPMU.


    kharla
    Participant

    @kharla

    Okay, I’ve been able to correct most of the problems like the avatar achievement, blog creation achievement, account activation achievement, etc by correcting the code in the dp-achievements-defaultachievements.php file.

    However, there are two sets of achievements that are still not working.

    Starting A Forum Topic (one, thirty, and 100) – this hooks into action – bp_forums_new_topic

    function dpa_register_forumranked() { add_action( ‘bp_forums_new_topic’, ‘dpa_handle_forumranked’, 10, 0 ); }

    Replying To A Forum Topic (one, thirty, and 100) – this hooks into action – bp_forums_new_post

    function dpa_register_replyranked() { add_action( ‘bp_forums_new_post’, ‘dpa_handle_replyranked’, 10, 0 ); }

    I’ve been checking all of the code both in this file and in the bp-forums.php file and cannot see why it’s not working. The actions are correct, I can’t find any typos, why is it not unlocking the achievements?

    function dpa_handle_forumranked() {

    global $bp;

    if ( !function_exists( ‘bp_forums_is_installed_correctly’ ) || !bp_forums_is_installed_correctly() || defined( ‘DPA_CHECKING’ ) )

    return;

    $user_id = $bp->loggedin_user->id;

    $one = new dpa_achievement( array( ‘user_id’ => $user_id, ‘name’ => ‘forumranked_1’, ‘counter’ => true ) );

    $thirty = new dpa_achievement( array( ‘user_id’ => $user_id, ‘name’ => ‘forumranked_30’ ) );

    $hundred = new dpa_achievement( array( ‘user_id’ => $user_id, ‘name’ => ‘forumranked_100’ ) );

    if ( $hundred->is_unlocked() )

    return;

    $one->increment_counter();

    if ( $one->counter >= 1 && !$one->is_unlocked() ) { $one->unlock_achievement(); }

    if ( $one->counter >= 30 && !$thirty->is_unlocked() ) { $thirty->unlock_achievement(); }

    if ( $one->counter >= 100 && !$hundred->is_unlocked() ) { $hundred->unlock_achievement(); }

    }

    function dpa_handle_replyranked() {

    global $bp;

    if ( !function_exists( ‘bp_forums_is_installed_correctly’ ) || !bp_forums_is_installed_correctly() || defined( ‘DPA_CHECKING’ ) )

    return;

    $user_id = $bp->loggedin_user->id;

    $one = new dpa_achievement( array( ‘user_id’ => $user_id, ‘name’ => ‘replyranked_1’, ‘counter’ => true ) );

    $thirty = new dpa_achievement( array( ‘user_id’ => $user_id, ‘name’ => ‘replyranked_30’ ) );

    $hundred = new dpa_achievement( array( ‘user_id’ => $user_id, ‘name’ => ‘replyranked_100’ ) );

    if ( $hundred->is_unlocked() )

    return;

    $one->increment_counter();

    if ( $one->counter >= 1 && !$one->is_unlocked() ) { $one->unlock_achievement(); }

    if ( $one->counter >= 30 && !$thirty->is_unlocked() ) { $thirty->unlock_achievement(); }

    if ( $one->counter >= 100 && !$hundred->is_unlocked() ) { $hundred->unlock_achievement(); }

    }

    Any help would be appreciated.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Achievements Plugin Not Working’ is closed to new replies.
Skip to toolbar