table {
  max-width: 100%;
  background-color: transparent;
  border-collapse: collapse;
  border-spacing: 0;
}

.table {
  width: 100%;
  margin-bottom: 20px;
}

.table th,
.table td {
  padding: 8px;
  line-height: 20px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid #dddddd;
}

.table th {
  font-weight: bold;
}

.table thead th {
  vertical-align: bottom;
}

.table caption + thead tr:first-child th,
.table caption + thead tr:first-child td,
.table colgroup + thead tr:first-child th,
.table colgroup + thead tr:first-child td,
.table thead:first-child tr:first-child th,
.table thead:first-child tr:first-child td {
  border-top: 0;
}

.table tbody + tbody {
  border-top: 2px solid #dddddd;
}

.table-condensed th,
.table-condensed td {
  padding: 4px 5px;
}

.table-bordered {
  border: 1px solid #dddddd;
  border-collapse: separate;
  *border-collapse: collapse;
  border-left: 0;
  -webkit-border-radius: 4px;
     -moz-border-radius: 4px;
          border-radius: 4px;
}

.table-bordered th,
.table-bordered td {
  border-left: 1px solid #dddddd;
}

.table-bordered caption + thead tr:first-child th,
.table-bordered caption + tbody tr:first-child th,
.table-bordered caption + tbody tr:first-child td,
.table-bordered colgroup + thead tr:first-child th,
.table-bordered colgroup + tbody tr:first-child th,
.table-bordered colgroup + tbody tr:first-child td,
.table-bordered thead:first-child tr:first-child th,
.table-bordered tbody:first-child tr:first-child th,
.table-bordered tbody:first-child tr:first-child td {
  border-top: 0;
}

.table-bordered thead:first-child tr:first-child th:first-child,
.table-bordered tbody:first-child tr:first-child td:first-child {
  -webkit-border-top-left-radius: 4px;
          border-top-left-radius: 4px;
  -moz-border-radius-topleft: 4px;
}

.table-bordered thead:first-child tr:first-child th:last-child,
.table-bordered tbody:first-child tr:first-child td:last-child {
  -webkit-border-top-right-radius: 4px;
          border-top-right-radius: 4px;
  -moz-border-radius-topright: 4px;
}

.table-bordered thead:last-child tr:last-child th:first-child,
.table-bordered tbody:last-child tr:last-child td:first-child,
.table-bordered tfoot:last-child tr:last-child td:first-child {
  -webkit-border-radius: 0 0 0 4px;
     -moz-border-radius: 0 0 0 4px;
          border-radius: 0 0 0 4px;
  -webkit-border-bottom-left-radius: 4px;
          border-bottom-left-radius: 4px;
  -moz-border-radius-bottomleft: 4px;
}

.table-bordered thead:last-child tr:last-child th:last-child,
.table-bordered tbody:last-child tr:last-child td:last-child,
.table-bordered tfoot:last-child tr:last-child td:last-child {
  -webkit-border-bottom-right-radius: 4px;
          border-bottom-right-radius: 4px;
  -moz-border-radius-bottomright: 4px;
}

.table-bordered caption + thead tr:first-child th:first-child,
.table-bordered caption + tbody tr:first-child td:first-child,
.table-bordered colgroup + thead tr:first-child th:first-child,
.table-bordered colgroup + tbody tr:first-child td:first-child {
  -webkit-border-top-left-radius: 4px;
          border-top-left-radius: 4px;
  -moz-border-radius-topleft: 4px;
}

.table-bordered caption + thead tr:first-child th:last-child,
.table-bordered caption + tbody tr:first-child td:last-child,
.table-bordered colgroup + thead tr:first-child th:last-child,
.table-bordered colgroup + tbody tr:first-child td:last-child {
  -webkit-border-top-right-radius: 4px;
          border-top-right-radius: 4px;
  -moz-border-radius-topleft: 4px;
}

.table-striped tbody tr:nth-child(odd) td,
.table-striped tbody tr:nth-child(odd) th {
  background-color: #f9f9f9;
}

.table-hover tbody tr:hover td,
.table-hover tbody tr:hover th {
  background-color: #f5f5f5;
}

table [class*=span],
.row-fluid table [class*=span] {
  display: table-cell;
  float: none;
  margin-left: 0;
}

.table .span1 {
  float: none;
  width: 44px;
  margin-left: 0;
}

.table .span2 {
  float: none;
  width: 124px;
  margin-left: 0;
}

.table .span3 {
  float: none;
  width: 204px;
  margin-left: 0;
}

.table .span4 {
  float: none;
  width: 284px;
  margin-left: 0;
}

.table .span5 {
  float: none;
  width: 364px;
  margin-left: 0;
}

.table .span6 {
  float: none;
  width: 444px;
  margin-left: 0;
}

.table .span7 {
  float: none;
  width: 524px;
  margin-left: 0;
}

.table .span8 {
  float: none;
  width: 604px;
  margin-left: 0;
}

.table .span9 {
  float: none;
  width: 684px;
  margin-left: 0;
}

.table .span10 {
  float: none;
  width: 764px;
  margin-left: 0;
}

.table .span11 {
  float: none;
  width: 844px;
  margin-left: 0;
}

.table .span12 {
  float: none;
  width: 924px;
  margin-left: 0;
}

.table .span13 {
  float: none;
  width: 1004px;
  margin-left: 0;
}

.table .span14 {
  float: none;
  width: 1084px;
  margin-left: 0;
}

.table .span15 {
  float: none;
  width: 1164px;
  margin-left: 0;
}

.table .span16 {
  float: none;
  width: 1244px;
  margin-left: 0;
}

.table .span17 {
  float: none;
  width: 1324px;
  margin-left: 0;
}

.table .span18 {
  float: none;
  width: 1404px;
  margin-left: 0;
}

.table .span19 {
  float: none;
  width: 1484px;
  margin-left: 0;
}

.table .span20 {
  float: none;
  width: 1564px;
  margin-left: 0;
}

.table .span21 {
  float: none;
  width: 1644px;
  margin-left: 0;
}

.table .span22 {
  float: none;
  width: 1724px;
  margin-left: 0;
}

.table .span23 {
  float: none;
  width: 1804px;
  margin-left: 0;
}

.table .span24 {
  float: none;
  width: 1884px;
  margin-left: 0;
}

.table tbody tr.success td {
  background-color: #dff0d8;
}

.table tbody tr.error td {
  background-color: #f2dede;
}

.table tbody tr.warning td {
  background-color: #fcf8e3;
}

.table tbody tr.info td {
  background-color: #d9edf7;
}

.table-hover tbody tr.success:hover td {
  background-color: #d0e9c6;
}

.table-hover tbody tr.error:hover td {
  background-color: #ebcccc;
}

.table-hover tbody tr.warning:hover td {
  background-color: #faf2cc;
}

.table-hover tbody tr.info:hover td {
  background-color: #c4e3f3;
}

2

(4 replies, posted in Discussions)

toni0 wrote:

Hey sir,

Hm yes according to the CSS code it looks like a hardly modified PunBB! You'd rather contact the webmaster just to make sure of this smile

FluxBB is a fork project of PunBB 1.2, in my opinion it's still very similar. Their community is a bit more active but it's hard to compare both solutions.


No, punbb's community is alot more active.

3

(2 replies, posted in Discussions)

hcs wrote:

reCAPTCHA - a mockery of the forum users.
Use the fancy_stop_spam

hahaah

4

(2 replies, posted in Discussions)

All of them,

5

(2 replies, posted in Discussions)

Functions.php

Instead of the update function you use that uses like 2 queries and calls alot of bull crap, just use this instead,

For replies (around 204 line)

find the update_forum function and replace it with it.

//@@@@@@@@@@@@@@@@@@@@@@FIX
$db->query('UPDATE '.$db->prefix.'forums SET num_posts=num_posts+1, last_post='.$now.', last_post_id='.$pun_user['id'].', last_poster=\''.$db->escape($username).'\' WHERE id='.$cur_posting['id']) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
    


And for the New Topic display,

find update forum function around line 313:

find update_forum function

replace it with:

//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
            $db->query('UPDATE '.$db->prefix.'forums SET num_topics=num_topics+1, num_posts=num_posts+1, last_post='.$now.', last_post_id='.$pun_user['id'].', last_poster=\''.$db->escape($username).'\' WHERE id='.$fid) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());

Like if u have a site like mine that has over 40 Active users and we use this method instead, it saves me alot of server CPU Usage, more then 29% actually, Please fix if you actually have a new update, Thanks.

You guys have 1 major flaw in your software,

why Do you use update_forum function in functions.php FOR EACH each replie, your selecting 2 Queries + the 3 already from replying when u just can add replies=+1 and just when people create a topic just add 1 query to add to num_topic..
This could save major query performance.. i hope they fixed this in the new punbb.

I'll get back to my custom forum software, lol just trying to let u know u guys need to update ur code. way to many mysql performance efficiency issues.

7

(4 replies, posted in PunBB 1.2 troubleshooting)

You got hacked. lolol

8

(3 replies, posted in PunBB 1.2 troubleshooting)

Hi i need the installation structions like manifest.xml ? I dont know how to read that? Is there a install.txt?? woww

Also looking at the code it has a field name "prev_url" in table online.. Witch punb 1.2.21 does not have? what should i do to about that because once i got that done the mod will work fine on my 1.2.21 : ) I m reading thru the xml and making it a installation i'll release it for punbb  1.2.21 too if u can help me on that prev_url field

$query = array(
        'SELECT'    => 'user_id, ident, logged, topic_online_users_tid, prev_url',

see i dont have that..

I have all this:
ELECT'    => 'user_id, ident, logged, topic_online_users_tid,

but not prev url lol

Tieguy wrote:
NiCk Newman wrote:
MattF wrote:

The column(s) type has absolutely no bearing on the query. You have already had an explanation of what the column types mean.

Why u keep posting stuff that u dont understand? lol

Like I said in previous posts..

From Smartys

For instance, in your query, you join the users table twice. You join on two columns which are TEXT, which will make your query incredibly slow. Those columns should be INTs, just like their corresponding columns in the users table.


SO TEXT MAKES THEM SLOW HUH? REALLY? NOW I MADE THEM VARCHAR AND STUFF SHOULD THE QUERY BE THE SAME ? OR DOES IT JUST AUTOMATICALLY SPEED IT UP SINCE NOT ALL TEXT?S??

Thanks.

It actually does speed up because of using the correct types.  MattF is right, you don't need to modify the query at all.

thanks that's all i needed to know, and utchin plz come to my house

*Content removed*

//Watch it NiCk Newman, Any more of that talk and your be banned. 1st Warning. /Utchin

MattF wrote:

The column(s) type has absolutely no bearing on the query. You have already had an explanation of what the column types mean.

Why u keep posting stuff that u dont understand? lol

Like I said in previous posts..

From Smartys

For instance, in your query, you join the users table twice. You join on two columns which are TEXT, which will make your query incredibly slow. Those columns should be INTs, just like their corresponding columns in the users table.


SO TEXT MAKES THEM SLOW HUH? REALLY? NOW I MADE THEM VARCHAR AND STUFF SHOULD THE QUERY BE THE SAME ? OR DOES IT JUST AUTOMATICALLY SPEED IT UP SINCE NOT ALL TEXT?S??

Thanks.

Slovak, thanks. I changed them all to that,  I Really appreciate your help.  Is it true now since I change it like that that my query will be less harder on the database and less joining tables is there a way please post that I am In search of that.. MY friend gave me this query but told me that If I changed all my stuff to

from_name VARCHAR(200);
from_id INT(10) UNSIGNED;
page TINYINT(3);
amount FLOAT(5, 2);
to_name VARCHAR(200);
time INT(10) UNSIGNED;
type TEXT;
msg TEXT;
to_id INT(10) UNSIGNED;

then the query will look different.  this is the current query:

SELECT cl.*, f.imgaward AS from_imgaward, t.imgaward AS to_imgaward
FROM cashlogs AS cl
INNER JOIN users AS f ON f.id = cl.from_id
INNER JOIN users AS t ON t.id = cl.to_id
ORDER By cl.time
DESC LIMIT '.$start_from.', 25

Holy sht, 3 tables just for this? Slavok, thanks for posting the query! but dont u think there's a better way then not using 3 more queryes like what If i changed my tables from text to int field be better?

Thank u sir

http://i25.tinypic.com/s3imp3.jpg
That's my table structure if your interested.

here is my query that pull's up from my table "cashlogs"

$result = $db->query('SELECT * FROM cashlogs ORDER By time DESC LIMIT '.$start_from.', 25') or error('Unable to fetch log info', __FILE__, __LINE__, $db->error());
        

Here is a screenshot on what I pull smile

http://i32.tinypic.com/28u04xy.jpg

I would love it  so I can pull my field imgaward from the user's table and apply them to each from_name and to_name fields in my cashlogs table. smile Possible?

I am trying to act professional and nice as i can please help me on this what, thanks!

I am asking you for help because I don't want to use WHERE Statement. because then I Would have like 250 Querys.. lol

16

(4 replies, posted in PunBB 1.2 troubleshooting)

MattF wrote:

I obviously understand better than yourself, (again). Did you actually read the whole of my post?

Yes!! I got it to work omg this is epic..

$user_info[] = '<br>'.ucwords($pun_config['cm_cur_name']).': '.number_format($cur_post['cm_cash'], 2, '.', ',');
            

number_format isn't even a function haha it's just php, damn bro this is epic now it results:

on my viewtopic
Cash: 2,521,421.00

i love it looks sexy..  just like usd currency

thanks matt. :"dddddddddddd

17

(4 replies, posted in PunBB 1.2 troubleshooting)

MattF wrote:

Do you really have to do the drama queen type posts?

http://uk3.php.net/manual/en/function.number-format.php

WOW U dont understand..

$user_info[] = '<br>'.ucwords($pun_config['cm_cur_name']).': '.number_format($cur_post['cm_cash']);
            

WERE IS .number_format function coming from not includes/functions.php i cant find i searched all .php inside include directory..

18

(4 replies, posted in PunBB 1.2 troubleshooting)

number_format WERE IS THIS FUNCTION AT WOW??

IT"S NOT IN INCLUDES/functions.php im looking everywere holy sht help

19

(3 replies, posted in PunBB 1.2 troubleshooting)

Slavok wrote:

There is a similar extension for PunBB 1.3. Study the code of this extension: perhaps, it will help you to create yours.

What iw ant.. i just need  the install.txt.. thx

Sorry  dont know that kinda of talk, so the query i posted is what you mean right ? {sorry im french}

<?php echo "Thanks slovak"; ?>

Garciat wrote:

You could store the imgaward info in a variable for each user:

if(!isset($imgaward[$cur_topic['last_poster']])
{
$result4 = $db->query('SELECT imgaward FROM users WHERE username="'.$cur_topic['last_poster'].'" ') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

$post_user = $db->fetch_assoc($result4);
$imgaward[$cur_topic['last_poster']] = $post_user;
}
else
$post_user = $imgaward[$cur_topic['last_poster']];

would that be the most efficient waY?

so u think it will be better just the way i had it? [on the database? faster] ?

yo, im using this 1

$query = 'SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, p.poster_id AS last_poster_id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON (p.id=t.last_post_id) WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
}

is that good can u make it betteR?

Slavok wrote:

$sql = 'SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, p.poster_id AS last_poster_id, u.imgaward INNER JOIN '.$db->prefix.'users AS u ON u.username = t.last_poster FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON (p.id=t.last_post_id) WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 't.posted' : 't.last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];

Hi sir.. thanks so much for replying and trying to help but i get this error:

File: C:\wamp\www\forums\viewforum.php
Line: 261

PunBB reported: Unable to fetch topic list

Database reported: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN users AS u ON u.username = t.last_poster FROM topics AS t INNER JOIN ' at line 1 (Errno: 1064)

Failed query: SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, p.poster_id AS last_poster_id, u.imgaward INNER JOIN users AS u ON u.username = t.last_poster FROM topics AS t INNER JOIN posts AS p ON (p.id=t.last_post_id) WHERE forum_id=1 ORDER BY sticky DESC, t.last_post DESC LIMIT 0, 20

sad

Help me GOD.


0.00057      SELECT u.*, g.*, o.logged, o.idle FROM users AS u INNER JOIN groups AS g ON u.group_id=g.g_id LEFT JOIN online AS o ON o.user_id=u.id WHERE u.id=2
0.00021     UPDATE online SET logged=1247640127 WHERE user_id=2
0.00017     UPDATE online SET current_page='/forums/viewforum.php', current_ip='127.0.0.1', current_page_id='1' WHERE user_id='2'
0.00015     SELECT * FROM online WHERE logged<1247639827
0.00027     SELECT f.forum_name, pf.forum_name AS parent_forum, f.redirect_url, f.moderators, f.num_topics, f.sort_by, f.parent_forum_id, fp.post_topics FROM forums AS f LEFT JOIN forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=1) LEFT JOIN forums AS pf ON f.parent_forum_id=pf.id WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id=1
0.00035     SELECT COUNT(id) FROM reports WHERE zapped IS NULL
0.01845     SELECT COUNT(id) FROM messages WHERE showed=0 AND owner=2
-0.01855     SELECT f.forum_desc, f.forum_name, f.id, f.last_post, f.last_post_id, f.last_poster, f.moderators, f.num_posts, f.num_topics, f.redirect_url, p.poster_id AS last_poster_id FROM forums AS f LEFT JOIN posts AS p ON (p.id=f.last_post_id) WHERE parent_forum_id=1 ORDER BY disp_position
0.01836     SELECT imgaward FROM users WHERE username="monkuar"
0.00073     SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, p.poster_id AS last_poster_id FROM topics AS t INNER JOIN posts AS p ON (p.id=t.last_post_id) WHERE forum_id=1 ORDER BY sticky DESC, last_post DESC LIMIT 0, 20
-0.00389     SELECT imgaward FROM users WHERE username="monkuar"
      SELECT imgaward,id FROM users WHERE username="monkuar"
0.01822     SELECT imgaward FROM users WHERE username="monkuar"
0.00019     SELECT imgaward,id FROM users WHERE username="monkuar"
-0.01910     SELECT imgaward FROM users WHERE username="monkuar"
0.01838     SELECT imgaward,id FROM users WHERE username="monkuar"
0.00023     SELECT imgaward FROM users WHERE username="monkuar"
0.00016     SELECT imgaward,id FROM users WHERE username="monkuar"
0.00014     SELECT imgaward FROM users WHERE username="monkuar"
0.00015     SELECT imgaward,id FROM users WHERE username="monkuar"
-0.02070     SELECT imgaward FROM users WHERE username="monkuar"
0.01833     SELECT imgaward,id FROM users WHERE username="monkuar"
0.00025     SELECT imgaward FROM users WHERE username="monkuar"
0.01824     SELECT imgaward,id FROM users WHERE username="monkuar"
0.00014     SELECT imgaward FROM users WHERE username="monkuar"
0.00016     SELECT imgaward,id FROM users WHERE username="monkuar"
-0.01942     SELECT imgaward FROM users WHERE username="monkuar"
0.01833     SELECT imgaward,id FROM users WHERE username="monkuar"
0.00023     SELECT imgaward FROM users WHERE username="monkuar"
-0.01919     SELECT imgaward,id FROM users WHERE username="monkuar"
0.01833     SELECT imgaward FROM users WHERE username="monkuar"
0.01822     SELECT imgaward,id FROM users WHERE username="monkuar"
-0.01855     SELECT imgaward FROM users WHERE username="monkuar"
0.01830     SELECT imgaward,id FROM users WHERE username="monkuar"
0.00020     SELECT imgaward FROM users WHERE username="monkuar"
0.00015     SELECT imgaward,id FROM users WHERE username="monkuar"
0.00015     SELECT imgaward FROM users WHERE username="monkuar"
0.00015     SELECT imgaward,id FROM users WHERE username="monkuar"
-0.02048     SELECT imgaward FROM users WHERE username="monkuar"
0.01829     SELECT imgaward,id FROM users WHERE username="monkuar"
0.01822     SELECT imgaward FROM users WHERE username="monkuar"
0.00017     SELECT imgaward,id FROM users WHERE username="monkuar"
0.00016     SELECT imgaward FROM users WHERE username="monkuar"
-0.01947     SELECT imgaward,id FROM users WHERE username="monkuar"
0.01836     SELECT imgaward FROM users WHERE username="monkuar"
0.00024     SELECT imgaward,id FROM users WHERE username="monkuar"
0.00016     SELECT imgaward FROM users WHERE username="monkuar"
0.00015     SELECT imgaward,id FROM users WHERE username="monkuar"
0.00014     SELECT imgaward FROM users WHERE username="monkuar"
0.00016     SELECT imgaward,id FROM users WHERE username="monkuar"
Total query time: 0.08461 s

Im using imgawards mod here is a picture:


http://i27.tinypic.com/k0lk7m.jpg

I mean that's what i want it look like but why does it loop through the query ..

here is my code:


<?php

// Fetch list of topics to display on this page
if ($pun_user['is_guest'] || $pun_config['o_show_dot'] == '0')
{
    // Without "the dot"
    $sql = 'SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, p.poster_id AS last_poster_id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON (p.id=t.last_post_id) WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
}
   

$result = $db->query($sql) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

// If there are topics in this forum.
if ($db->num_rows($result))
{
    while ($cur_topic = $db->fetch_assoc($result))
    {
        $icon_text = $lang_common['Normal icon'];
        $item_status = '';
        $icon_type = 'e2';
$result4 = $db->query('SELECT imgaward FROM users WHERE username="'.$cur_topic['last_poster'].'" ') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

    
    $post_user = $db->fetch_assoc($result4);

             // Image Award Mod Block Start
            //figure out the size of the award (Name of award should be in teh form:  Test_Award_100x20.png ... where png is format, 100x20 is dimensions and Test_Award is name of award (seen in admin interface)
            $lol2=$post_user['imgaward'];
            
            if ($post_user['imgaward'] == "") { 
            $lol12 = "";
            }
            else {
            $lol12 = "<img src='img/stars/$lol2'>";
            }
        if ($cur_topic['moved_to'] == null)
        
            $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a><br /><span class="byuser">'.$lang_common['by'].'&nbsp;<a href="profile.php?id='.$cur_topic['last_poster_id'].'">'.pun_htmlspecialchars($cur_topic['last_poster']).'</a>'.$lol12.'</span>';
else
            $last_post = '&nbsp;';

            
            
            $result4 = $db->query('SELECT imgaward,id FROM users WHERE username="'.($cur_topic['poster']).'" ') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

    
    $post_user = $db->fetch_assoc($result4);

             // Image Award Mod Block Start
            //figure out the size of the award (Name of award should be in teh form:  Test_Award_100x20.png ... where png is format, 100x20 is dimensions and Test_Award is name of award (seen in admin interface)
            $lol23=$post_user['imgaward'];
            
            if ($post_user['imgaward'] == "") { 
            $lol123 = "";
            }
            else {
            $lol123 = "<img src='img/stars/$lol23'>";
            }
        if ($pun_config['o_censoring'] == '1')
            $cur_topic['subject'] = censor_words($cur_topic['subject']);

        if ($cur_topic['moved_to'] != 0)
        
            $subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].'&nbsp;'.pun_htmlspecialchars($cur_topic['poster']).''.$lol123.'</span>';
        else if ($cur_topic['closed'] == '0')
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.'';
        //monk@
        else
        {
            $subject = '<font color=red>Closed: <a href="viewtopic.php?id='.$cur_topic['id'].'">'.$cur_topic['subject'].'</a></font>'.'';
            $icon_text = '<tr class="cl bc1"> 
    ';
        }

        if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && $cur_topic['moved_to'] == null)
        {
            
            $item_status .= ' inew';
            $icon_type = 'e1';
            $subject = '<strong>'.$subject.'</strong>';
            $subject_new_posts = '[&nbsp;<a href="viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a>&nbsp;]';
        }
        else
            $subject_new_posts = null;

        // Should we display the dot or not? :)
        if (!$pun_user['is_guest'] && $pun_config['o_show_dot'] == '1')
        {
            if ($cur_topic['has_posted'] == $pun_user['id'])
                $subject = '<strong>&middot;</strong>&nbsp;'.$subject;
            else
                $subject = '&nbsp;&nbsp;'.$subject;
        }

        if ($cur_topic['sticky'] == '1')
        {
            $subject = '<b>'.'Pinned'.':</b> '.$subject;
            
    
        }


        $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);

        if ($num_pages_topic > 1)
            $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]';
        else
            $subject_multipage = null;

        // Should we show the "New posts" and/or the multipage links?
        if (!empty($subject_new_posts) || !empty($subject_multipage))
        {
            $subject .= '&nbsp; '.(!empty($subject_new_posts) ? $subject_new_posts : '');
            $subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';
        }
        $rowbg = $rowbg == 'ce' ? 'ce bc1' : 'ce';

?>

<tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
<tr class="<?php echo $rowbg ?>">
<?php echo trim($icon_text) ?>
    <td align="left"><div class="<?php echo $icon_type ?>"><div class="nosize"></div></td> 
    
    <td align="left"> <?php echo $subject ?><br><span class="desc">Objective</span></td> 
    <td align="left">
    
    <?php echo '<a href=profile.php?id='.$post_user['id'].'>'.($cur_topic['poster']).''.$lol123.'</a>' ?>
    
    
    <br><span class="desc"><?php echo format_time($cur_topic['posted']) ?></span></td> 
    <td align="left"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_replies'] : '&nbsp;' ?></td> 
    <td align="left"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_views'] : '&nbsp;' ?></td> 
    <td align="left"><?php echo $last_post ?></td> 
</tr>    

See how it's in the while function? but i have to have in the while function because that way I can use my $cur_post variable for my MYSQL WHERE Clause, otherwise it wont bring up the right image,

Im talking about this query

$result4 = $db->query('SELECT imgaward FROM users WHERE username="'.$cur_topic['last_poster'].'" ') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

Anyone know any ideas on how to make it's only 1 Query or maybe im doing something totally wrong?? please help thx..