
Admin
Well-Known Member
Staff member
Administrator
PHP:
///////////////////show list/////////////////////////
if (!$is_mobile){
$bonguyen = mysql_query("SELECT `id`, `text`, `soft` FROM `forum` WHERE `type`='f' ORDER BY `realid`");
while (($dd = mysql_fetch_array($bonguyen)) !== false) {
echo '<div class="mainblok"><div class="phdr"><table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="50%"><b>'.$dd['text'].'</b></td>
<td width="20%"><div align="center">Thống kê</div></td>
<td width="30%"><div align="center">Bài viết cuối</div></td>
</tr>
</table></div>';
$req = mysql_query("SELECT `id`, `text`, `soft` FROM `forum` WHERE `refid`='" . $dd['id'] . "' ORDER BY `realid`");
while (($res = mysql_fetch_array($req)) !== false) {
$chude = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='t' and `refid`='" . $res['id'] . "'"), 0);
$baiviet = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='m' and `refid`='" . $res['refid'] . "'"), 0);
echo '<table width="100%" class="list2" cellspacing="0" cellpadding="0">
<tr>
<td width="50%">
<a href="/forum/index.php?id=' . $res['id'] . '">' . $res['text'] . '</a>
'.$res['soft'].'</td>
<td width="20%" class="tong"><div align="center">Chủ đề: '.$chude.'
Bài viết: ' . $baiviet . '</div></td>
<td width="30%">';
$req1 = mysql_query("SELECT `id`, `text`, `from`, `soft` FROM `forum` WHERE `refid`='" . $res['id'] . "' ORDER BY `id` DESC LIMIT 1");
while (($res1 = mysql_fetch_array($req1)) !== false) {
$colmes = mysql_query("SELECT * FROM `forum` WHERE `refid` = '" . $res1['id'] . "' AND `type` = 'm'" . ($rights >= 7 ? '' : " AND `close` != '1'") . " ORDER BY `time` DESC");
$colmes1 = mysql_num_rows($colmes);
$cpg = ceil($colmes1 / $kmess);
$nick = mysql_fetch_array($colmes);
if ($res1['edit'])
echo '<img src="images/tz.gif" alt="" width="13" height="13"/>';
elseif ($res1['close'])
echo '<img src="images/dl.gif" alt="" width="13" height="13"/>';
else
echo '<img src="images/np.gif" alt="" width="13" height="13"/>';
if ($res1['realid'] == 1)
echo '*<img src="images/rate.gif" alt="" width="13" height="13"/>';
echo '*<a href="/forum/index.php?id=' . $res1['id'] . '">' . $res1['text'] . '</a>*';
if ($cpg > 1)
echo '*<a href="index.php?id=' . $res['id'] . '&page=' . $cpg . '"><img src="images/viewpost.png"/></a>';
echo '<div>Bởi: '.$res1['from'].' - ';
if ($colmes1 > 1) {
echo '' . $nick['from'];
}else
echo $res1['from'];
echo '</div>';
}
echo '</td>
</tr>
</table>';
}
echo '</div>';
}
}else{
}
///////////////////showlist/////////////////////////