The Soda Pop
Wapsite đang trong quá trình nâng cấp các bạn hãy chờ đợi nhé. Cảm ơn !
19/10/2015 - 20:50


Share Mod New Advanced Statistics Giống Vbb Cho JohnCMS



Cái này khá giống New Advanced Statistics của vbb
Dán đoạn code sau vào pages/mainmenu.php (chỗ nào thì bạn chọn cho thích hợp vs code của mình nhé)
<?php
///New Advanced Statistics///
echo '<div class="phdr">New Advanced Statistics</div>';
if (!$is_mobile){
echo '<table width="100%" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<td>';
$req = mysql_query("SELECT * FROM `users` WHERE `postforum` > 0 ORDER BY `postforum` DESC LIMIT 15");
if (mysql_num_rows($req)) {
$i = 0;
while ($res = mysql_fetch_assoc($req)) {
echo '<div class="list2">';
echo '<table width="100%" cellpadding="0" cellspacing="0"><tr><td>'.$res['name'].'</td><td width="auto" align="right">'.$res['postforum'].'</td></tr></table></div>';
++$i;
}
} else {
echo '<div class="menu"><p>Trống</p></div>';
}
echo '</td>';
echo '<td width="1px" bgcolor="#000000"></td>';
echo '<td>';
$req = mysql_query("SELECT * FROM `forum` WHERE `type` = 't' and kedit='0' AND `close`!='1' ORDER BY `time` DESC LIMIT 12");
while ($arr = mysql_fetch_array($req)) {
$q3 = mysql_query("select `id`, `refid`, `text` from `forum` where type='r' and id='" . $arr['refid'] . "'");
$razd = mysql_fetch_array($q3);
$q4 = mysql_query("select `id`, `refid`, `text` from `forum` where type='f' and id='" . $razd['refid'] . "'");
$frm = mysql_fetch_array($q4);
$nikuser = mysql_query("SELECT `from`,`id`, `time` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $arr['id'] . "'ORDER BY time DESC");
$colmes1 = mysql_num_rows($nikuser);
$cpg = ceil($colmes1 / $kmess);
$nam = mysql_fetch_array($nikuser);
echo is_integer($i / 2) ? '<div class="list1">' : '<div class="list2">';
echo '<img src="images/' . ($arr['edit'] == 1 ? 'tz' : 'np') . '.gif" alt=""/>';
if ($arr['realid'] == 1)
echo ' <img src="images/rate.gif" alt=""/>';
if ($cpg > 1) {
echo ' <a href="/forum/index.php?id=' . $arr['id'] . ($cpg > 1 && $_SESSION['uppost'] ? '&clip&page=' . $cpg : '') . '">' . $arr['text'] . '</a> (<a href="/forum/index.php?id=' . $arr['id'] . ($_SESSION['uppost'] ? '' : '&clip&page=' . $cpg) . '#' . $nam['id'].'">' . $colmes1 . '</a>)';
} else {
echo ' <a href="/forum/index.php?id=' . $arr['id'] . ($cpg > 1 && $_SESSION['uppost'] ? '&clip&page=' . $cpg : '') . '">' . $arr['text'] . '</a> (' . $colmes1 . ')';
}
if (!empty ($nam['from'])) {
echo ' <font color="Deeppink">' . $nam['from']. '</font><br>';
}
echo '</div>';
$i++;

}
echo '</td>';
echo '</tr>';
echo '</table>';
}else{
$req = mysql_query("SELECT * FROM `forum` WHERE `type` = 't' and kedit='0' AND `close`!='1' ORDER BY `time` DESC LIMIT 12");
while ($arr = mysql_fetch_array($req)) {
$q3 = mysql_query("select `id`, `refid`, `text` from `forum` where type='r' and id='" . $arr['refid'] . "'");
$razd = mysql_fetch_array($q3);
$q4 = mysql_query("select `id`, `refid`, `text` from `forum` where type='f' and id='" . $razd['refid'] . "'");
$frm = mysql_fetch_array($q4);
$nikuser = mysql_query("SELECT `from`,`id`, `time` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $arr['id'] . "'ORDER BY time DESC");
$colmes1 = mysql_num_rows($nikuser);
$cpg = ceil($colmes1 / $kmess);
$nam = mysql_fetch_array($nikuser);
echo is_integer($i / 2) ? '<div class="list1">' : '<div class="list2">';
echo '<img src="images/' . ($arr['edit'] == 1 ? 'tz' : 'np') . '.gif" alt=""/>';
if ($arr['realid'] == 1)
echo ' <img src="images/rate.gif" alt=""/>';
if ($cpg > 1) {
echo ' <a href="/forum/index.php?id=' . $arr['id'] . ($cpg > 1 && $_SESSION['uppost'] ? '&clip&page=' . $cpg : '') . '">' . $arr['text'] . '</a> (<a href="/forum/index.php?id=' . $arr['id'] . ($_SESSION['uppost'] ? '' : '&clip&page=' . $cpg) . '#' . $nam['id'].'">' . $colmes1 . '</a>)';
} else {
echo ' <a href="/forum/index.php?id=' . $arr['id'] . ($cpg > 1 && $_SESSION['uppost'] ? '&clip&page=' . $cpg : '') . '">' . $arr['text'] . '</a> (' . $colmes1 . ')';
}
if (!empty ($nam['from'])) {
echo ' <font color="Deeppink">' . $nam['from']. '</font><br>';
}
echo '</div>';
$i++;

}
}
///New Advanced Statistics///
?>


Facebook Google Plus Twitter
Chuyển Qua GD Mobile
C-STAT