vForums Support > Programming & Coding :: Code Requests & Support :: > [F] Member Group & Rank

[F] Member Group & Rank - Posted By Fel!x (felix) on 18th Jan 08 at 11:51am
I was wondering if there is a way to allow your rank and your member group to show [Such as Administrator then below that Junior Member].

If this is possible many thanks!

Re: Member Group & Rank - Posted By Marc (cr0w) on 21st Jan 08 at 11:19pm
So you mean for a staff member to also have their posting rank? {Smile}

Re: Member Group & Rank - Posted By Fel!x (felix) on 22nd Jan 08 at 5:56am
Yes, exactly XD

Re: Member Group & Rank - Posted By Ross (admin) on 22nd Jan 08 at 11:45am
Try this {Smile}

Global Header:
Blue = Required Posts
Red = # of Stars

<script type="text/javascript">
<!--
var ranks = Array(); var r=0;

ranks[r++] = Array(0, 'New Member', 1, 'http://virtualforums.co.uk/images/orange_star.gif');
ranks[r++] = Array(40, 'Junior Member', 2, 'http://virtualforums.co.uk/images/orange_star.gif');
ranks[r++] = Array(100, 'Full Member', 3, 'http://virtualforums.co.uk/images/orange_star.gif');
ranks[r++] = Array(500, 'Senior Member', 4, 'http://virtualforums.co.uk/images/orange_star.gif');

function assign_rank(display_name, posts) {
if(!display_name.match(/group0/i)) {
posts = parseInt(posts.replace(/,/g, ''));
r = 0;
while(ranks[r] && ranks[r][0] < posts) {
r++;
}
if(r > 0)
r--;
var rank_str = "<br />" + ranks[r][1] + "<br />";
for(c=0; c<ranks[r][2]; c++) {
rank_str += "<img src=\""+ ranks[r][3] +"\" alt=\"*\" />";
}
document.write(rank_str);
}
}
//-->
</script>



And then place this into your mini-profile template where you want it to appear:

<script type="text/javascript">
assign_rank('{display_name}', '{posts}');
</script>

Re: Member Group & Rank - Posted By Fel!x (felix) on 22nd Jan 08 at 1:19pm
EDIT: Never mind, its great! Thanks heaps Ross!