• Resolved allmyleagues

    (@allmyleagues)


    Paul,

    I absolutely love this plugin! Do you accept donations for your work? You should!

    I have a couple feature requests that I brought up a couple months ago and would like to restructure them now that I see what you’ve done with Achievements 3.2.

    1) Option to change the name “Karma”

    I’d simply be fine even with the name “Points”, but I think it would be a good idea for individual WordPress site owners to be able to change the name to what they want.

    2) Leaderboard request based on points

    By assigning higher point values to the more difficult achievements, I think having a leaderboard based on points would develop some friendly competition among website members. I know others have requested the leaderboard feature, so I am basically reinforcing the interest for it ?? Not all achievements are equal and as such, the leaderboard should reflect the quality and quantity of achievements earned, not just the quantity.

    3) Option to put the Achievements list into categories

    A few people have requested in support tickets that the achievements be sorted in specific ways (Karma values, alphabetical, importance of achievement). I think it’s fair to say that the organization of Achievements would be optimally categorized by each WordPress site owner. If Achievements could be placed into a category and the categories could be assigned a custom order, people can sort the achievements how they like. What do you think?

    4) Allow users to request that an achievement is awarded to them

    Beside the achievements list, it would be great to see an option for a member to formally request they get awarded an achievement.

    5) Designate a wordpress “moderator rank” that would allow a user to award achievements to others.

    If the main administrator is busy with other things, it would be nice to have a designated person be able to award achievements to people without that person having access to the entire WordPress back end.

    Thanks so much for taking the time to read these suggestions! If you do accept donations just point me to the link man. You do amazing work!

    This is by far the best rewards-style plugin I’ve ever seen. I cannot thank you enough for it!

    Mark H.

    https://www.ads-software.com/extend/plugins/achievements/

Viewing 10 replies - 1 through 10 (of 10 total)
  • I second the category option. I have different types of achievements that need to be grouped.
    I’m trying to figure out a way to do this without to much coding, but it’s not looking good.

    One other thing I was looking for was to see if we can award an achievement multiple times to a user.

    Here’s how you can categorize your achievements — however, I haven’t figured out yet how to include the categories in the results (working on that part).

    Edit /wp-content/plugins/achievements/achievements.php and add
    'taxonomies' => array('category'),
    near line 478 in the $cpt['achievement'] object.

    This will let you assign your achievements to WP categories.

    I think I found a solution. So now to display get a certain category of achievements, make the following changes in /wp-content/plugins/achievements/includes/progress/template.php:

    1. Around line 120, change $achievement_ids = wp_list_pluck( (array) achievements()->progress_query->posts, 'post_parent' );
      to: $achievement_ids = wp_list_pluck( (array) achievements()->progress_query->posts, 'ID' );
    2. When calling dpa_has_progress in your child theme template file, content-author-achievement.php, for example, replace dpa_has_progress() with this:
      dpa_has_progress(array("category_name"=>"[slug of category here]", "post_type"=>"achievement", "post_status"=>"publish"))

    This worked for me. Paul, can you verify if changing post_parent to ID will have any adverse effects?

    Thanks!
    ~Mike

    To order by category, you will have to do something like the following:

    1. Around line 324, after $achievement_args = …, add
      $args = dpa_parse_args( $args, $achievement_args, 'has_achievement' );
    2. Replace dpa_has_achievements( $achievement_args ); with
      dpa_has_achievements( $args );

    This will tie in the order-by args into the achievements list, as otherwise only the progress list is ordered, which isn’t displayed.

    Paul, can you confirm that this logic won’t break anything as well? So far it appears to be working for me.

    Just found a flaw in my “solution” above. It now returns ALL achievements, instead of only the ones actually awarded. Will work on this more tomorrow.

    OK, solution to group by (do not make the changes in the previous two posts suggested above):

    1. Edit /wp-content/plugins/achievements/achievements.php and add
      'taxonomies' => array('category'),
      near line 478 in the $cpt[‘achievement’] object.
    2. Edit content/plugins/achievements/includes/progress/template.php and replace
      $achievement_args = array(
      			'post__in'       => $achievement_ids,  // Only get achievements that relate to the progressses we've got.
      			'posts_per_page' => -1,                // No pagination
      		);

      With:

      $achievement_args = array(
      			'post__in'       => $achievement_ids,  // Only get achievements that relate to the progressses we've got.
      			'posts_per_page' => -1,                // No pagination
      			'orderby' => $args["orderby"],
      			'order' => $args["order"],
      		);

    3. When calling dpa_has_progress in your child theme template file, content-author-achievement.php, for example, replace dpa_has_progress() with this:
      dpa_has_progress(array(“orderby”=>”term_taxonomy_id”))

    I will work on figuring out how to filter by category tomorrow.

    Example can be viewed here: https://konb.info/forums/users/mike-bronner/

    ~Mike

    Plugin Author Paul Wong-Gibbs

    (@djpaul)

    Not changing the core code of a plugin is my recommendation! If you need more filters or actions to be able to do this via a helper plugin, let me know what/where.

    I’ll investigate what consequences adding support for the categories taxonomy has. Particularly about any new rewrite rules/URLs it’d add, and what happens if a regular post and an achievement has the same categroy, etc.

    Plugin Author Paul Wong-Gibbs

    (@djpaul)

    As for the other questions (& thanks for the feedback! you can paypal me as many millions of dollars that you have spare, no problem!):

    1) Option to change the name “Karma”
    You should be able to do this via template files. I know I need to document how to do this properly. ??

    4) Allow users to request that an achievement is awarded to them
    This sound more like a contact form, so I’d recommend using a contact form plugin ??

    5) Designate a wordpress “moderator rank” that would allow a user to award achievements to others.
    This might be something I do in future. You’re the second person to have asked, so we’ll see if any more requests come in over the next while ??

    Not changing the core code of a plugin is my recommendation! If you need more filters or actions to be able to do this via a helper plugin, let me know what/where.

    I’ll investigate what consequences adding support for the categories taxonomy has. Particularly about any new rewrite rules/URLs it’d add, and what happens if a regular post and an achievement has the same categroy, etc.

    Thanks Paul! ?? I agree, changing the core code isn’t optimal … it would be recommended to make an alternate version of dpa_has_progress in the child theme’s function.php file. And like you mentioned, adding the taxonomy in by altering the achievements.php file is less than optimal as well. Perhaps it can be hooked in via the functions file, but that would be something that needs research.

    I haven’t experimented with adding normal posts to categories used for achievements. I did however notice one little bug int he process, in that the categories admin page is now a sub-item of achievements, instead of standing on its own. Not quite sure what caused that — something else to look into as well.

    Admittedly this is a hack work-around to get categories functioning ASAP, and this will break once the plugin is updated.

    ~Mike

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘A few humble requests’ is closed to new replies.