WordPress.org

Ready to get started?Download WordPress

Forums

Achievements for WordPress
[resolved] Link to achievements? (14 posts)

  1. amoldejong
    Member
    Posted 1 year ago #

    Hi there, nice plugin!

    Is there a way i can put a link into a page or widget that connect to the user overview of achievements, now when you have an achievement you'll get an option to view your achievements (below the pop-up.

    Is there a way to put this link somewhere else, so that every user can click it (since it is a user gnerated link: /author/user/achievements/

    I would like to put a link somewhere that says, click here for your already gained achievements or such.

    I tried the short code for the overview, but that one does not work.

    Is there a solution to this?

    thanks in advance.

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

  2. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 1 year ago #

    Hi; thanks!

    There is always a solution for anything involving code ;) though this is going to require some basic PHP and a little WordPress API knowledge in order to do this. If this is you, I will pull out a couple of pieces and give them to you, otherwise you'll need to track down a developer to help you.

  3. amoldejong
    Member
    Posted 1 year ago #

    Hi Paul,

    Thank you for the quick reply! Well unfortunately thats not me ;-( my knowledge about code is quite small. I tried it with a php code widget, and copied the lines from the loop-achievements file. I did get the link, but when i click it, it reloads the page and nothing happens.

    Can you support me in what to put in this widget to get the link working?

    Or, is there an other way to display the overview of achieved achievements with a direct link? (without the need for achieving something first or entering a code for a achievement, this feature i really like btw ;-))

  4. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 1 year ago #

    I haven't time to step-by-step through a change of this size, sorry. You'll need to find a developer to give you a hand, or spend some time learning some PHP + WordPress :)

  5. amoldejong
    Member
    Posted 1 year ago #

    To bad, No developers around me...
    Any other suggestion in order to create an overview page with achieved achievements?

    Or is this only do-able with coding?

  6. Peter Hudson
    Member
    Posted 1 year ago #

    Hi amoldejong,

    I hope Paul doesn't mind me chopping in again. Maybe there is an easier way which I couldn't figure out but for anyone looking to do this, and has a little knowledge of php...

    I have knocked up a little solution to this problem , although it does require a small edit to your wordpress files (Coding..). You should read up on editing your functions.php file before doing this!!!!!!

    To get the link for the currently logged in user - so for example I have added a link to the users profile page you could use the following function and shortcode:

    function get_user_achievement_page ($user_id) {
    $user_profile_url = dpa_get_user_avatar_link( array(
    		'type'    => 'url',
    		'user_id' => get_current_user_id(),
    	) );
    return $user_profile_url;
    }
    
    add_shortcode ('get_user_ach_link','get_user_achievement_page');

    My use of this was rather unique for me. I created a 'Home Page' for logged in users which contained links to things like the articles a user has written, their profile etc. This shortcode allowed me add to that page a link to their achievements as well.
    So I used this shortcode on the page of links I created... edit as text, not visual editor, so as an example:

    <a href="[get_user_ach_link]">Click to view all of your achievements</a>

    I have used an image link instead of text, but you get the idea.

    A more sensible way to use this is to return the link for any user. You could then put it on the users profile page or author page. Using the function you just need to pass the user ID to it, which would be done in php. So for example on my authors page I have put a link at the top of the page to view the listed authors achievements, like this...

    <?php $userID =  get_the_author_meta('ID');
    $author = get_the_author_meta('display_name');
    echo '<div id="ach_link"><a href="'.get_user_achievement_page ($userID).'">See '.$author.'\'s achievements</a></div>';?>

    None of this is endorsed I'm sure by Paul, but it might help someone?

  7. dacai
    Member
    Posted 1 year ago #

    +1 for a working, integrated solution for this.

    I swear, sometimes this plugin (which is great overall) just doesn't make any sense to me as an end-user. With 3.X it moved away from buddypress in a couple of ways...fine, i need the functionality more than any other, so i also say goodbye to buddypress.

    I install a theme that should complement the plugin nicely (but doesn't work with buddypress) only to discover that there is no default way to view earned achievements without buddypress? Sure, there is a link in the admin bar (or so i hear), but let's be honest...how many of you have disable the bar within minutes of a fresh install?

    It has come to the point that i spend more time trying to implement the achievement/badge system than i do working on my course-content (run a e-learning site).

    PS. This is not meant as an attack against the plugin. It is, hand down, the best at what it does. I just wished it did it in a bit more user friendly fashion.

  8. dacai
    Member
    Posted 1 year ago #

    @Peter Hudson; Your solution worked like a charm. Greatly appreciate you sharing it!

  9. amoldejong
    Member
    Posted 1 year ago #

    Thank you Peter Hudson! This works like a charm!
    This is within my limits of php editing ;-)

    This is exactly what i needed! you made my day. For me the plugin is now useable, since i work with rewards with codes. And i wanted users to be able to get back to a reward they got. So this is now possible in the way i wanted.

    thanks again.

  10. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 1 year ago #

    I install a theme that should complement the plugin nicely... only to discover that there is no default way to view earned achievements without buddypress? Sure, there is a link in the admin bar...

    Nice contradiction. BuddyPress makes Achievements much better, because WordPress just does not do user profiles or user-centric navigation; it's just not built for that. BuddyPress is, however, and so works great.

    The best Achievements experience will always be running it with BuddyPress.

    Any feature that needs to be well-integrated into a website will always need adjustments to its template and CSS, even if it tries to work off-the-shelf the best it can.
    From my perspective, it's reasonable to require that people spend a little time making tweaks if they want something slightly different from out the box.

    My favourite example of Achievements that I've seen is http://teensummerchallenge.org/ -- just how good is that?

  11. Peter Hudson
    Member
    Posted 1 year ago #

    Glad it sorted that problem for a few people. I keep looking at teensummerchallenge... it's a brilliant set up, my efforts are somewhat poor in comparison. It's an excellent example of how tweaks to templates and css can create a whole unique experience.

    For me, and as Paul says, there will always need to be tweaks here and there if we need it to work for some specific feature of our site.

    Achievements makes most sense with Buddypress, but the site I'm developing is for quite young children. I have used Buddypress on a couple of sites, but for several reasons found I didn't want it for my current one. The fact that Achievements now runs without it is a huge plus for me.

    The system itself is so well designed and extendable by Paul, that it seems he has anticipated the need for many things already. The link above for example taps into a function already provided by the plugin.

    Also I have received the best support from any free plugin ever from him.

  12. dacai
    Member
    Posted 1 year ago #

    I fail to see the contradiction in my statement. I made clear before that certain buddypress features were missing after the 3.X rebuilds. As a result i no longer saw the need for buddypress (use a theme with integrated user profiles).

    Support is indeed good for a free plugin (second only to advanced iframe imo). However, many topics get the "if you are/have a coder" response. The site mentioned looks great because of heavy tweaking. Many users cannot do this. A lot of plugins do work great out of the box (just a bit of css styling)...although those have a smaller scope of course.

    I cannot begin to imagine the work you put into a plugin of this scale, and i respect that. But in a way the grand scope of the plugin seems to push it toward a few technical inclined users, while risking to loose the majority of base-level wp users if/when it loses it's de facto monopoly position.

  13. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 1 year ago #

    > However, many topics get the "if you are/have a coder" response

    Yes. I don't have time to spend doing what would essentially be custom development work for people, which is why I ask if they've got some technical background. If so, I'm happy to share some specific tips to guide people how to do something, I just can't build solutions for everyone :)

  14. dacai
    Member
    Posted 1 year ago #

    I understand. I was not suggesting you custom-build for every user, rather that you build a backend that allows them to do it themselves. The average user is not a coder (and doesn't have one available), which is why they look to you for help.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.