1

Topic: Different rank images

As the topic says, is it possible to have different images for each rank?
I already got the "duplicate image" thing, but I want it to display different images for each ranks.

2

Re: Different rank images

set the ammount it goes up by so its the same as the ammount your ranks go up.

3

Re: Different rank images

Eh, can you explain that another way? I didnt understand, sorry.

4

Re: Different rank images

http://wiki.punres.org/Add_rank_icons

5

Re: Different rank images

I dont think you understand what I mean.

I want it to change between different pictures.
Like 10 posts is a red square and 100 posts is a green square, not 10 red squares.

6 (edited by pogenwurst 2006-04-30 15:25)

Re: Different rank images

Skip step 1 of the tutorial, replace the code in step 2 with:

if ($cur_post['num_posts'] >= 100) {$rank_icon = 'senior_member.png'; $rank_alt = 'Senior Member';}
elseif ($cur_post['num_posts'] > 10 && $cur_post['num_posts'] < 100) {$rank_icon = 'member.png'; $rank_alt = 'Member';}
else {$rank_icon = 'new_member.png'; $rank_alt = 'New Member';}

(change as necessary for your rankings)

Then change the code in step 3 to:

<dd class="usertitle"><img src="<?php echo $rank_icon; ?>" alt="<?php echo $rank_alt; ?>" /></dd>

Please try it out and let me know how it works, then I'll probably add it to the wiki or something.

EDIT: FYI, I'm not sure what step one is supposed to do, so I just skipped it. I dunno, it might be necessary. Someone smart want to fill me in?

Looking for a certain modification for your forum? Please take a look here before posting.

7

Re: Different rank images

Thank you big_smile
It worked perfect!

You can see it "live" here: http://tibia.no/forum/viewtopic.php?id=148

8

Re: Different rank images

Would it be possible to make it change image on different usergroup too?
I tried some stuff but couldnt make it work.

Re: Different rank images

I want to do the same but I am a not that good with programing.

I want to add 10 different start at certan number of posts. star images is called "star.gif", "star1.gif", "star2.gif", "star3.gif" and so on up till "star10.gif". I want first star at 50 posts, second at 100, third at 250 forth at 500 and so on.

Could someone help me with the code for that system

Re: Different rank images

Never mind I found out how I was suppos do.

    if ($cur_post['num_posts'] >= 5000) {$rank_icon = 'star10.gif'; $rank_alt = 'King of the Forum';}
    elseif ($cur_post['num_posts'] > 2000 && $cur_post['num_posts'] < 5000) {$rank_icon = 'star9.gif'; $rank_alt = 'Elite Master Troller';}
    elseif ($cur_post['num_posts'] > 1500 && $cur_post['num_posts'] < 2000) {$rank_icon = 'star8.gif'; $rank_alt = 'Grand Master Flamer';}
    elseif ($cur_post['num_posts'] > 1000 && $cur_post['num_posts'] < 1500) {$rank_icon = 'star7.gif'; $rank_alt = 'MAster TRoller';}
    elseif ($cur_post['num_posts'] > 750 && $cur_post['num_posts'] < 1000) {$rank_icon = 'star6.gif'; $rank_alt = 'Master Flamer';}
    elseif ($cur_post['num_posts'] > 500 && $cur_post['num_posts'] < 750) {$rank_icon = 'star5.gif'; $rank_alt = 'Troller';}
    elseif ($cur_post['num_posts'] > 250 && $cur_post['num_posts'] < 500) {$rank_icon = 'star4.gif'; $rank_alt = 'Flamer';}
    elseif ($cur_post['num_posts'] > 100 && $cur_post['num_posts'] < 250) {$rank_icon = 'star3.gif'; $rank_alt = 'Senior Member';}
    elseif ($cur_post['num_posts'] > 50 && $cur_post['num_posts'] < 100) {$rank_icon = 'star2.gif'; $rank_alt = 'Member';}
    elseif ($cur_post['num_posts'] > 0 && $cur_post['num_posts'] < 50) {$rank_icon = 'star.gif'; $rank_alt = 'Rookie';}
    else {$rank_icon = 'star.gif'; $rank_alt = 'Rookie';}