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 ?
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 troubleshooting → 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 ?
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.
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>
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; }
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 .
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...
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>';
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>';
great ! thanx for help
as always the support for punbb is great
No problem.. Found the same bug on mine
So thanx as well.
PunBB Forums → PunBB 1.2 troubleshooting → small problem with the stars
Powered by PunBB, supported by Informer Technologies, Inc.