Ngẫu nhiên
<b>PHP Code:</b><?php
$req = mysql_query ( "SELECT * FROM `forum` WHERE `type`='t' AND `refid`=' $type1 [ refid ] ' AND`id`!=' $id ' ORDER BY RAND() LIMIT 5" );
$total = mysql_num_rows ( $req );
if( $total != 0 ) {
echo '<div class="mainblok"><div class="phdr"><b>Ngẫu nhiên</b></div>' ;
while ( $res = mysql_fetch_assoc ( $req )) {
echo '<div class="menu"><imgsrc="/images/ic.png"/> <a href="' . rw ( notags ( $res [ 'text' ])) . '-' . $res [ 'id' ] . '.htm">' . tags ( $res [ 'text' ]) . '</a></div>' ;
++ $i ;
}
echo '</div>' ;
}
?>
xem nhiều
<b>PHP Code:</b><?php
echo '<div class="phdr"><b>Xem nhiều</b></div>' ;
$sql = mysql_query ( "SELECT * FROM `forum` WHERE `type` = 't' && `close` = '0' order by view desc limit 5 " );
while( $row = mysql_fetch_assoc ( $sql )){
echo '<div class="list1"><img src="/images/new.gif"> <a href="' . $home . '/forum/' . rw ( notags ( $row [ 'text' ])) . '_' . $row [ 'id' ]. '.html" title="' . $row [ 'text' ]. '"><b>' . tags ( $row [ 'text' ]) . '</b></a>* ' . $row [ 'xem' ]. ' lượtxem</div>' ;
}
?>
<b>PHP Code:</b><?php
$req = mysql_query ( "SELECT * FROM `forum` WHERE `type`='t' AND `refid`=' $type1 [ refid ] ' AND`id`!=' $id ' ORDER BY RAND() LIMIT 5" );
$total = mysql_num_rows ( $req );
if( $total != 0 ) {
echo '<div class="mainblok"><div class="phdr"><b>Ngẫu nhiên</b></div>' ;
while ( $res = mysql_fetch_assoc ( $req )) {
echo '<div class="menu"><imgsrc="/images/ic.png"/> <a href="' . rw ( notags ( $res [ 'text' ])) . '-' . $res [ 'id' ] . '.htm">' . tags ( $res [ 'text' ]) . '</a></div>' ;
++ $i ;
}
echo '</div>' ;
}
?>
xem nhiều
<b>PHP Code:</b><?php
echo '<div class="phdr"><b>Xem nhiều</b></div>' ;
$sql = mysql_query ( "SELECT * FROM `forum` WHERE `type` = 't' && `close` = '0' order by view desc limit 5 " );
while( $row = mysql_fetch_assoc ( $sql )){
echo '<div class="list1"><img src="/images/new.gif"> <a href="' . $home . '/forum/' . rw ( notags ( $row [ 'text' ])) . '_' . $row [ 'id' ]. '.html" title="' . $row [ 'text' ]. '"><b>' . tags ( $row [ 'text' ]) . '</b></a>* ' . $row [ 'xem' ]. ' lượtxem</div>' ;
}
?>