WordPress.org

Ready to get started?Download WordPress

Forums

Achievements for WordPress
[resolved] Show 'x' most recent achievements from user_id (4 posts)

  1. AKTDev
    Member
    Posted 8 months ago #

    HI Paul,

    Big fan of the plugin. Would create a plugin that shows a small grid of the achievement image for the last 'x' amount of achievements unlocked by a user with user_id = 'y'

    Was hoping to jump into the docs for methods etc but having a hard time trying to find what does what. Was thinking of using the [dpa-user-achievements-index] shortcode but whenever I try it it comes back with an error like "This is somewhat embarrassing, isn’t it? No achievements were found."

    I also stumbled across a snippet of code in another forum post about code like:

    echo dpa_get_user_points( bp_displayed_user_id() );

    and was hoping there might be something to the tune of:

    $achs = dpa_get_user_list($user_id);

    which would give the progress of the user and i would then be able to manipulate this into UI.

    Is there an easy/any way to get the API calls or methods of the plugin?

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

  2. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 8 months ago #

    Hi AKTDev,

    Is there an easy/any way to get the API calls or methods of the plugin?

    One way is to read the code :) If you're asking for a specific area or process, I can tell you which file/where.

    If you generally asking about nicely-written up guides and generated phpDoc documentation, no, the plugin has none of that at the moment. I want to try to make time to make this better soon.

    So: a plugin that shows a grid of achievement images for the 'x' amount of most recent achievements unlocked by a specific user? Like the "Photo Grid" widget that comes with Achievements, but for a specific user?

  3. AKTDev
    Member
    Posted 8 months ago #

    Ah now the Photo Grid widget, how would one go about finding what the hell the actual shortcode is?! More to the point is there a shortcode for this? If not what are the codes I should be looking at to bang one together?

    Yeah basically I was asking if you could point me to which files / methods would give me a list/array of what achievements a specific user, designated by id, has unlocked/progressed through...?

  4. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 8 months ago #

    The shortcodes are registered in the code, here: https://github.com/paulgibbs/achievements/blob/master/src/includes/class-dpa-shortcodes.php#L40

    The photo grid widget is at https://github.com/paulgibbs/achievements/blob/master/src/includes/class-dpa-available-achievements-widget.php

    There isn't a shortcode for this widget. I have seen plugins before that allow you to embed a widget via a shortcode, so that might be an easy option.

    Take a look at this, hopefully it's enough to get you started. I'm here if you have any more follow-up questions.

Reply

You must log in to post.

About this Plugin

About this Topic