We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Rank system based on time on board
Topic Started: Dec 28 2011, 05:58 PM (312 Views)
kevinertia
Member
[ * ]
Board address: s11.zetaboards.com/Guardsmen/
Board software: Zetaboards
Description: I'd like to have a rank system that is based on how long a person has been a member on my board. For example, once a user joins my board he/she starts out as "New". Then after a week or two, that user becomes "Active". Then maybe after two months, the user becomes a "Regular". And probably after six months, the user becomes "Dedicated".
Offline Profile Goto Top
 
RyuraGS-ZNR
Member Avatar
Generation Studio
[ *  * ]
Where would you like a member's rank to be displayed?
Offline Profile Goto Top
 
kevinertia
Member
[ * ]
Below the member title pip/icon and above the posts count, but not in the box with the post count, group, member #, and join date. It should be shown in every post.
Offline Profile Goto Top
 
RyuraGS-ZNR
Member Avatar
Generation Studio
[ *  * ]
Here you go. Put this in Javascripts.

Code:
 

<script type="text/javascript">
$(function() {
var RankSystem = {
ranks: ["New","Active","Regular","Dedicated","Incredible"],
days: [0,7,60,180,360]
}
$('.user_info').each(function(){
RankSystem.days.push(36000);
var $this = $(this);
var joindate = new Date($this.find("dt:contains('Joined:')").next().text());
var currentdate = new Date();
var daysince = Math.floor((currentdate - joindate)/86399999.99980646);
$.each(RankSystem.days,function(i,value){
if(value > daysince) {
$this.before('<div style="text-align: center;" class="userrank">Rank: '+RankSystem.ranks[i-1]+'</div>');
return false;
};
});
});
});
</script>


Find these lines (they're near the top):
Code:
 
ranks: ["New","Active","Regular","Dedicated","Incredible"],
days: [0,7,60,180,360]

And just edit those as you want. The first rank corresponds to the first day value and so on, so if you wanted to add a rank "Cool" at 90 days you'd do:
Code:
 
ranks: ["New","Active","Regular","Cool","Dedicated","Incredible"],
days: [0,7,60,90,180,360]


Make sure you put the days in order from least to greatest. The code assumes that you've done that.
Offline Profile Goto Top
 
kevinertia
Member
[ * ]
Thank you so much!
Offline Profile Goto Top
 
Brendan
Member Avatar


Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic