forum_th mysql_query SELECT FROM forum_post WHERE type them ORDER BY l

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<?
$forum_th=mysql_query("SELECT * FROM `forum_post` WHERE `type` = 'them' ORDER BY last_up DESC LIMIT 5");
while ($them = mysql_fetch_assoc($forum_th))
{
if ($them['open'] == 1 && $them['zakl'] == 1) { echo '<img src="/style/icons/forum/zk.png"> '; }
elseif ($them['open'] == 1) { echo '<img src="/style/icons/forum/zk.png">'; }
elseif ($them['zakl'] == 1) { echo '<img src="/style/icons/forum/sv.png">'; }
elseif ($them['open'] == 0 && $them['open'] == 0) { echo '<img src="/style/icons/forum/them.png">'; }
echo '<a href="/forum/them/'.$them['id'].'/" class="mego">'. $them['name'] .' </a><a href="/forum/them/'.$them['id'].'/?page=end" class="mego">ยป</a><span class="count"><b>'. (mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_post` WHERE `refid` = '".$them['id']."' AND `type` = 'post'"),0)+1) .'</b></span></div>';
}
?>