Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Paul Wong-Gibbs

    (@djpaul)

    Can you show the code you’re using to build the category list on your page at the moment?

    Thread Starter pmcvicker

    (@pmcvicker)

    Hey Paul,

    I put this page together from scratch, rather than dynamically pulling in available categories. The previous plugin I was using was too slow at loading data for the 150+ achievements I have. An example for one of the categories (art) is:

    <li>
    <div class="item-avatar"><a href="http://challengebeta.mypcls.org/challenges/art-challenges/"><img class="avatar group-6-avatar avatar-150 photo" title="Art" alt="Group logo of Art" src="http://challengebeta.mypcls.org/wp-content/uploads/group-avatars/6/845c924e6b03ada716fb49d6fbdb43a8-bpfull.jpg" width="150" height="150" /></a></div>
    <div class="item">
    <div class="item-title groups-directory-title"><a href="http://challengebeta.mypcls.org/challenges/art-challenges/">Art</a></div>
    </div>
    <div class="clear"></div></li>

    Plugin Author Paul Wong-Gibbs

    (@djpaul)

    🙁

    If you construct the list dynamically with get_categories, I think it returns the count for each object. See “List Categories and Descriptions” on http://codex.wordpress.org/Function_Reference/get_categories

    Thread Starter pmcvicker

    (@pmcvicker)

    Will that return a count of how many achievements exist within a given category or how many have been earned by users?

    Thread Starter pmcvicker

    (@pmcvicker)

    Although, thinking back on my last look at how progress is being recorded, achievement unlocks are “posts” in a loose sense, and in this way they’d apply towards the count?

    Plugin Author Paul Wong-Gibbs

    (@djpaul)

    > Will that return a count of how many achievements exist within a given category
    This.

    Thread Starter pmcvicker

    (@pmcvicker)

    Ah, what I’m looking for is a count of how many users have earned a particular achievement, and beyond this, how many have been earned in a whole category. Such as: “237 users have unlocked achievements in the Art category.”

    I see that dpa_progress is the post-type with a post-status of dpa_unlocked that is registering completion.

    So I guess what I’m looking for is a way to query all of the posts of dpa_progress type which have dpa_unlocked status within a specific category and output that as a number.

    Plugin Author Paul Wong-Gibbs

    (@djpaul)

    Unfortunately, this is non-trivial and not something I have figured out before which I can post on.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Number of Achievements Earned in a Category’ is closed to new replies.