1 (edited by shaul26 2005-04-27 15:33)

Topic: Ranks w/ stars ?

You know, new member will have 1 star, active 2, addicted 3 etc..

Is there a mod like this for punbb ?

2

Re: Ranks w/ stars ?

There is a french guy who coded something like that.
Go to to PunBB.fr to see the code,
and to CtrlAltSuppr.com to view the demo.

3 (edited by shaul26 2005-04-28 15:09)

Re: Ranks w/ stars ?

Didn't understand exactly what to do..
Can anyone please translate it for me ?

Thanks in Advance ! smile

btw, that forum (CtrlAltSuppr.com) is amazing! didn't know you can make punbb look like this...

Re: Ranks w/ stars ?

http://translate.google.com/translate?s … 3Fid%3D184

Re: Ranks w/ stars ?

I talked with the mod creator (Ju) very nice person!

and he told me what to do..

this is the mod:

open "viewtopic.php"

find:

    $post_count++;
    $user_avatar = '';
    $user_info = array();
    $user_contacts = array();
    $post_actions = array();
    $is_online = '';
    $signature = '';

    // If the poster is a registered user.
    if ($cur_post['poster_id'] > 1)
    {

after add:

        $rank_pips = "";
        if($cur_post['num_posts'] > 5000) { $num_pips = 10; }
        elseif($cur_post['num_posts'] > 3000) { $num_pips = 9; }
        elseif($cur_post['num_posts'] > 2000) { $num_pips = 8; }
        elseif($cur_post['num_posts'] > 1000) { $num_pips = 7; }
        elseif($cur_post['num_posts'] > 500) { $num_pips = 6; }
        elseif($cur_post['num_posts'] > 300) { $num_pips = 5; }
        elseif($cur_post['num_posts'] > 100) { $num_pips = 4; }
        elseif($cur_post['num_posts'] > 50) { $num_pips = 3; }
        elseif($cur_post['num_posts'] > 10) { $num_pips = 2; }
        else { $num_pips = 1; }

        for($pip=0; $pip<$num_pips; $pip++) {
            $rank_pips .= '<img src="img/pip.gif" alt="" />';
        }

Find:

           <dl>
                    <dt><strong><?php echo $username ?></strong></dt>
                    <dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>

After, add :

                    <?php echo "<dd class=\"usertitle\">".$rank_pips."</dd>\n"; ?>

Save viewtopic.php and upload (overwrite)

I didn't creat this mod... all the credit goes to "Ju" !

6 (edited by miowpro 2005-05-01 18:21)

Re: Ranks w/ stars ?

ooo nice one, i added

http://www.strictlyleft.co.uk/forum

7

Re: Ranks w/ stars ?

cool works really good

Re: Ranks w/ stars ?

added to the punres wiki smile http://punres.org/doku.php?id=how-tos:adding_rank_icons

Re: Ranks w/ stars ?

there should be a default image supplyed with it for those who are graphicaly challanged (and lazy)

Re: Ranks w/ stars ?

shinko_metsuo wrote:

there should be a default image supplyed with it for those who are graphicaly challanged (and lazy)

lol

11 (edited by buzzkill 2005-05-02 19:13)

Re: Ranks w/ stars ?

shinko_metsuo wrote:

there should be a default image supplyed with it for those who are graphicaly challanged (and lazy)

big_smile  Which one takes precidence?  graphically challenged or lazy?  j/j.

BTW Love the Michael Savage Quote.

Re: Ranks w/ stars ?

buzzkill wrote:
shinko_metsuo wrote:

there should be a default image supplyed with it for those who are graphicaly challanged (and lazy)

big_smile  Which one takes precidence?  graphically challenged or lazy?  j/j.

BTW Love the Michael Savage Quote.

for me its lazyness (I took the red IF ones)

Micheal Savage ownz w00t!

Re: Ranks w/ stars ?

Connorhd wrote:

added to the punres wiki smile http://punres.org/doku.php?id=how-tos:adding_rank_icons

The last step needs changed to

<?php echo "<dd class=\"usertitle\">".$rank_pips."</dd>\n"; ?>

else it gives a parse error.

14 (edited by almost_there 2005-05-03 09:05)

Re: Ranks w/ stars ?

Here's a little star if anybody wants it.

http://www.sellerscircle.com/forum/img/pip.gif

15 (edited by Goober 2005-05-03 20:42)

Re: Ranks w/ stars ?

Ok, the programming part is solved...now we just need some good rank images... wink

If anyone has any good likes, please share them... big_smile

This image is from Proboards -> http://4d5.net/boardimages/star.gif

16

Re: Ranks w/ stars ?

almost_there wrote:
<?php echo "<dd class=\"usertitle\">".$rank_pips."</dd>\n"; ?>

else it gives a parse error.

weird i did not get any error

Re: Ranks w/ stars ?

I did when I used the one from punres because the double quotes weren't escaped.

18

Re: Ranks w/ stars ?

You can use this special character ? , but I'm afraid iexplorer doesn't likes it hmm

Re: Ranks w/ stars ?

simkin wrote:

You can use this special character ? , but I'm afraid iexplorer doesn't likes it hmm

works in my IE6 at least...

20

Re: Ranks w/ stars ?

Frank H wrote:
simkin wrote:

You can use this special character ? , but I'm afraid iexplorer doesn't likes it hmm

works in my IE6 at least...

Ok, good to know then. When I tested it, ie wasn't showing this character, but could be caused by the OS.

I've Installed this little mod, and seems there is some kind of problem with the rank of guests. They were getting more rank than the members. I didn't know how to solve this, so I moved the rank bar to the bottom of the user info, together with post count, and this way the rank is not being displayed for guests. ^^

21

Re: Ranks w/ stars ?

Hello. I had the same problem, but now everything is working OK. Thank you.

What if... im the admin and i decide to give all the stars to mods and admins without the need to the post counter?.

thank you in advance.

22 (edited by HMEternity 2005-07-13 05:58)

Re: Ranks w/ stars ?

I've made some pips you may use. You can download the files here:

http://punres.org/files.php?pid=98

This is what you're getting (separate of course):

http://punres.org/files/projects/pr_98/rid_0/pips_sampler.gif

23

Re: Ranks w/ stars ?

if you wana update your ranks, you have to update it in the options and than change the code, maybe there should be a way to rank set up thats in the database, like adding an option like how many pips do you to show with each rank

24

Re: Ranks w/ stars ?

i have this error. please help me resolve it... thanks in advance

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\Xitami\xxx\_forums\viewtopic.php on line 363

25

Re: Ranks w/ stars ?

Just for style/redability reasons, this here

shaul26 wrote:

after add:

        $rank_pips = "";
        if($cur_post['num_posts'] > 5000) { $num_pips = 10; }
        elseif($cur_post['num_posts'] > 3000) { $num_pips = 9; }
        elseif($cur_post['num_posts'] > 2000) { $num_pips = 8; }
        elseif($cur_post['num_posts'] > 1000) { $num_pips = 7; }
        elseif($cur_post['num_posts'] > 500) { $num_pips = 6; }
        elseif($cur_post['num_posts'] > 300) { $num_pips = 5; }
        elseif($cur_post['num_posts'] > 100) { $num_pips = 4; }
        elseif($cur_post['num_posts'] > 50) { $num_pips = 3; }
        elseif($cur_post['num_posts'] > 10) { $num_pips = 2; }
        else { $num_pips = 1; }

        for($pip=0; $pip<$num_pips; $pip++) {
            $rank_pips .= '<img src="img/pip.gif" alt="" />';
        }

IMHO should be more like this :

$postct_split = array(10,50,100,300,500,1000,2000,3000,5000);
$pip_img = '<img src="img/pip.gif" alt="" />';
$rank_pips = $pip_img;
foreach($postct_split as $stars) {
  if($cur_post['num_posts'] > $stars) { $rank_pips .= $pip_img;}
  }

Saves 9 lines of code smile

The German PunBB Site:
PunBB-forum.de