• Resolved Mike

    (@iskon47)


    Is there a simple way to display monthly, weekly, yearly and overall leaderboards that maintain overall points but can also display these other point time periods? This would be a fantastic feature and enable us to hold regular contests for users to win prizes by gaining points over a set time period.

    We would want to make sure that overall points are maintained so that loyal users can feel rewarded for their continued support, but also allow for shorter time period leaderboards so that new users have the ability to get involved and compete as well.

    Thanks for the great work!

    https://www.ads-software.com/plugins/mycred/

Viewing 15 replies - 1 through 15 (of 25 total)
  • I am looking for this as well. That would have been so great!

    Thanks a lot for the awesome plugin!

    Plugin Author myCred

    (@designbymerovingi)

    I will try and add in a custom leaderboard widget to give you better options for leaderboards based on a specific timeframe. I have created one example of how to make a custom leaderboard widget that works on weekly basis that you might like.

    Fantastic, Gabriel! Thank you.
    I don’t know a lot about coding, so I am wondering if it’s easy to change the code you provided so that it works on a monthly basis instead of a weekly?

    Plugin Author myCred

    (@designbymerovingi)

    Hey.

    Here you go. I copied the weekly leaderboard widget and adjusted it to work with the current month instead.

    Thank you very much, Gabriel!
    Will try it out.

    Thread Starter Mike

    (@iskon47)

    Awesome, thank you! I will try it as well.

    This may sound like a dumb question, but I know even less about coding than Chakelan haha. So where and how exactly do I place that code to create the widget?

    Thanks for the help! Can’t wait for 1.5!

    You place it in the functions.php of your theme if you know how to do that? ??

    I tried it and it seems to be working great! I have two questions:

    I would like to add a <div> around it to make it look nicer (I want it to have a color). Is it an easy way to do this? I normally just put it in the text box widget around the text I want to colorize.

    Also, the widget didn’t exclude users that I had put in the core settings of myCred. If it is an easy fix to this, that would also have been great!

    Thank you very much!

    This is my input just to make sure I can keep an eye on this as it evolves…

    User avatars would be an awesome addition to this widget ??

    @chakelan – You may be able to get what you are looking for by using the ul class “mycred-this-months-leaderboard” in either MyCred’s, or possibly your theme’s own, stylesheet.

    Thread Starter Mike

    (@iskon47)

    Welcome MFSAM ??

    I love the idea of displaying the avatars in the leaderboards! Maybe also be able to turn it on and off though because it could take up a considerable amount of extra space and some people wouldn’t like that.

    Also (and I had suggested this as another topic a few weeks back) linking from the names on the leaderboards to user bbPress profiles instead of user article posts since, at least on my site, users don’t have the ability to post articles and clicking their name takes you to an empty page stating “No Posts”. This also encourages people to enhance their profiles especially if they’re ranked highly since they know people will be checking them out.

    Sorry if that’s off-topic for this thread, just wanted to see what the others in here thought since we all seem to be in the same mindset ??

    I’m excited to see how it evolves as well! Everyone that has used it so far loves it!

    Thread Starter Mike

    (@iskon47)

    I should add that Gabriel did create some code to do what I just suggested already (thanks again Gabriel!) that can be found here: bbPress Profiles From Leaderboard

    I’m just horrible with code so I’m hoping it will become a built-in feature ??

    Plugin Author myCred

    (@designbymerovingi)

    I have updated both code snippets shown in this topic to show the users avatar as well. It will show a 32 x 32 pixel version but you can always adjust this in your copy to a size that suits you. You can find more information on the get_avatar function in the WP Codex.

    @ Chakelan: You can add in your own HTML code on line 65 just before the unorganized list (ul) element and then close it on line 69.

    Thanks a lot for your help!

    Gabriel, I have tried several variations and I can’t find out where to place the <div>-element. Should it be inside the echo or outside for example?

    // Construct unorganized list for each row
    				echo '<ul class="mycred-this-months-leaderboard">';
    				foreach ( $leaderboard as $position => $data ) {
    					$avatar = get_avatar( $data->user_id, 32 );
    					echo '<li>' . $avatar . $data->display_name . ' with ' . $mycred->format_creds( $data->total ) . '</li>';
    				}
    Plugin Author myCred

    (@designbymerovingi)

    You always place it inside the string you want to echo or you basically try and tell your server that for example <div> is a php code. Your server will disagree and render a white screen.

    So for example change this line:

    echo '<ul class="mycred-this-months-leaderboard">';

    to:

    echo '<div id="myowndiv"><ul class="mycred-this-months-leaderboard">';

    And then of course close the tag after the unsorted list element is closed.

    Hey it would be good if this widget can be like the one that comes with cubepoints. One table with tabs on the top “today”, “week”, “month’ and user can switch between them.

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘Weekly/Monthly/Yearly/Overall Leaderboards’ is closed to new replies.