1

Topic: small problem with the stars

see this:
http://guistyles.com/forum/viewtopic.php?id=285
http://guistyles.com/forum/viewtopic.php?id=286

the Guest have a stars , this is a bug , any idea how to solve that ?

Re: small problem with the stars

Hard to tell without some piece of code, where did you add the stars?

Anyhow you probably have to exclude users that have id 1.

3

Re: small problem with the stars

yee sure, standard from this forum help:

viewtopic.php

{
    $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)
    {
        $rank_pips = "";
        if($cur_post['num_posts'] > 1000) { $num_pips = 10; }
        elseif($cur_post['num_posts'] > 600) { $num_pips = 9; }
        elseif($cur_post['num_posts'] > 450) { $num_pips = 8; }
        elseif($cur_post['num_posts'] > 300) { $num_pips = 7; }
        elseif($cur_post['num_posts'] > 225) { $num_pips = 6; }
        elseif($cur_post['num_posts'] > 150) { $num_pips = 5; }
        elseif($cur_post['num_posts'] > 100) { $num_pips = 4; }
        elseif($cur_post['num_posts'] > 65) { $num_pips = 3; }
        elseif($cur_post['num_posts'] > 25) { $num_pips = 2; }
        else { $num_pips = 1; }

and the same file:

<dl>
                    <dt><strong><?php echo $username ?></strong></dt>
                    <dd class="postavatar"><?php echo $user_avatar ?></dd>
                    <?php echo "<dd class=\"usertitle\">".$rank_pips."</dd>\n"; ?>
                    <dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>
                    <?php if (count($user_info)) echo "\t\t\t\t\t".implode('</dd>'."\n\t\t\t\t\t", $user_info).'</dd>'."\n"; ?>
                    <?php if (count($user_contacts)) echo "\t\t\t\t\t".'<dd class="usercontacts">'.implode('  ', $user_contacts).'</dd>'."\n"; ?>
                </dl>


like here: http://punbb.org/forums/viewtopic.php?id=7293

Re: small problem with the stars

Since Guests posts are not counted try this

        $rank_pips = "";
        if($cur_post['num_posts'] > 1000) { $num_pips = 10; }
        elseif($cur_post['num_posts'] > 600) { $num_pips = 9; }
        elseif($cur_post['num_posts'] > 450) { $num_pips = 8; }
        elseif($cur_post['num_posts'] > 300) { $num_pips = 7; }
        elseif($cur_post['num_posts'] > 225) { $num_pips = 6; }
        elseif($cur_post['num_posts'] > 150) { $num_pips = 5; }
        elseif($cur_post['num_posts'] > 100) { $num_pips = 4; }
        elseif($cur_post['num_posts'] > 65) { $num_pips = 3; }
        elseif($cur_post['num_posts'] > 25) { $num_pips = 2; }
        elseif($cur_post['num_posts'] > 0)  { $num_pips = 1; }

5 (edited by coxis 2006-04-20 11:11)

Re: small problem with the stars

yes i add this, change old one to this one but still doesn't work:
http://guistyles.com/forum/viewtopic.php?id=285
http://guistyles.com/forum/viewtopic.php?id=286

In the second link guest Sista in the first post got zero stars and the second post from Sista got 7 stars .

6 (edited by StevenBullen 2006-04-20 12:11)

Re: small problem with the stars

Erm... Common sense factor.

The variable is not clearing.... So that means the guest post will have the same amount of pips as the post above.

I would probably say that your if statement is not closed properly... or the

 for($pip=0; $pip<$num_pips; $pip++) { etc

is not in the if statement.

Make sense...

7

Re: small problem with the stars

ooo ok
but not clear how to make it work hehe

code is:

{
    $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)
    {
        $rank_pips = "";
        if($cur_post['num_posts'] > 1000) { $num_pips = 10; }
        elseif($cur_post['num_posts'] > 600) { $num_pips = 9; }
        elseif($cur_post['num_posts'] > 450) { $num_pips = 8; }
        elseif($cur_post['num_posts'] > 300) { $num_pips = 7; }
        elseif($cur_post['num_posts'] > 225) { $num_pips = 6; }
        elseif($cur_post['num_posts'] > 150) { $num_pips = 5; }
        elseif($cur_post['num_posts'] > 100) { $num_pips = 4; }
        elseif($cur_post['num_posts'] > 65) { $num_pips = 3; }
        elseif($cur_post['num_posts'] > 25) { $num_pips = 2; }
        elseif($cur_post['num_posts'] > 0)  { $num_pips = 1; }

        for($pip=0; $pip<$num_pips; $pip++) {
            $rank_pips .= '<img src="img/guiStar.png" alt="" />';
        }
        $username = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['username']).'</a>';

Re: small problem with the stars

Here is changed version...

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

    // If the poster is a registered user.
    if ($cur_post['poster_id'] > 1)
    {
        if($cur_post['num_posts'] > 1000) { $num_pips = 10; }
        elseif($cur_post['num_posts'] > 600) { $num_pips = 9; }
        elseif($cur_post['num_posts'] > 450) { $num_pips = 8; }
        elseif($cur_post['num_posts'] > 300) { $num_pips = 7; }
        elseif($cur_post['num_posts'] > 225) { $num_pips = 6; }
        elseif($cur_post['num_posts'] > 150) { $num_pips = 5; }
        elseif($cur_post['num_posts'] > 100) { $num_pips = 4; }
        elseif($cur_post['num_posts'] > 65) { $num_pips = 3; }
        elseif($cur_post['num_posts'] > 25) { $num_pips = 2; }
        elseif($cur_post['num_posts'] > 0)  { $num_pips = 1; }

        for($pip=0; $pip<$num_pips; $pip++) {
            $rank_pips .= '<img src="img/guiStar.png" alt="" />';
        }
        $username = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['username']).'</a>';

9

Re: small problem with the stars

great ! thanx for help smile
as always the support for punbb is great smile

Re: small problem with the stars

No problem.. Found the same bug on mine lol
So thanx as well.