• Resolved RLL18

    (@rll18)


    First, I want to say that I LOVE your plugin!

    Next, I want to know how to display a total number of karma points a person has earned on the /members/USER/achievements page?

    For example it shows:

    Achievement 1 5 karma points description
    Achievement 2 2 karma points description

    7 total karma

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter RLL18

    (@rll18)

    The reason I want this is because I may manually award points. Points that aren’t gained through achievements…

    Plugin Author Paul Wong-Gibbs

    (@djpaul)

    The dpa_user_points() function will print the number of karma points a user has.

    Thread Starter RLL18

    (@rll18)

    I’m not 100% familiar with coding. I type just that piece of code where I want it and it will work?

    I have tried in several different files both with <php> coding as well as stand alone, and I haven’t been able to get it to work how I want it. I want it to display a total number of points earned on the table that shows the acheivements earned (either at the top or bottom). Can you help me with the file that I need to add the code to?

    My ultimate goal is to have the table located on the achievements page look like this:

    achievement >> karma points >> description
    achievement >> karma points >> description
    achievement >> karma points >> description
    Total achievements completed >> total karma points earned

    Oh, and thank you for the response!!

    Plugin Author Paul Wong-Gibbs

    (@djpaul)

    Because the results can be paginated, do you want to overall total karma points number, or just add the karma points together for the displayed results?

    Thread Starter RLL18

    (@rll18)

    overall total karma points. I would like it to be displayed in the acievements table.

    Plugin Author Paul Wong-Gibbs

    (@djpaul)

    I can’t walk you through customising the templates step-by-step (if you’re not familiar with PHP and WordPress development/theming, it could be tricky), but basically you need to do this:

    1) Copy /plugins/achievements/templates/achievements/achievements/loop-achievements.php to /themes/YOUR_THEME/achievements/loop-achievements.php

    1) Copy /plugins/achievements/templates/achievements/achievements/loop-single-achievement.php to /themes/YOUR_THEME/achievements/loop-single-achievement.php

    2) Open the new loop-achievements.php in a text editor, and add a new column to the table (the th elements).

    3) Open the new loop-single-achievement, and add in the new cell (td, this time). For the value, use the dpa_user_points() function to print the row’s user’s points total, something like this: <td><?php dpa_user_points(); ?></td>.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display total amount of points’ is closed to new replies.