WordPress.org

Ready to get started?Download WordPress

Forums

Achievements for WordPress
[resolved] Change from 2.4 to 3.0, points value in the code? (2 posts)

  1. rastinha
    Member
    Posted 1 year ago #

    Hi there,

    I was using version 2.4 to set up a community site for my classroom, and because I am using CubePoints on the website, and wanted my students to be awarded the equivalent of the achievement's karma points value in cube points, I modified achievements-core.php to add one line that ran the cp_points function and used the $userID variable, and the dpa_get_achievement_points() to add the correct amount of points to the user's cubepoints total:

    // Update points, insert unlocked record into DB and send notifications.
    	if ( $unlocked ) {
    		dpa_points_increment( dpa_get_achievement_points(), $user_id );
    ###############################I Edited this bit ###################
    		cp_points('cp_achievement', $user_id, dpa_get_achievement_points(), $achievement_id);
    
    ###################################################################

    Things are obviously very different in the new version, and I have no idea where to find the equivalent place in the new files/code, or what to use in the cp_points function now to get the karma points value for the award.

    Do you have any idea which file I would look in, and what the equivalent is of dpa_get_achievement_points()?

    Thanks a lot if you can help me out, I really want to upgrade because you've obviously put some awesome effort in, but school starts on Monday and I'm running out of time to get this set up!

    Hannah

    http://wordpress.org/extend/plugins/achievements/

  2. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 1 year ago #

    dpa_get_achievement_points() still exists :)

    It's in includes/achievements/template.php

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic