Hi, Khách!
![]() | ![]() ![]() ![]() ![]() |
Mô tả: mỗi lần load lại trang nó sẽ đổi màu...
Có thể chôm css của wapit hoặc m4v
hoặc không cần css nó cũng có màu
Code hơi dài nhưng không sao..
Dùng ngon nhé...
echo '<div class="mainblok"><div class="phdr">• <b>Chuyên mục</b></div>';
$req = mysql_query("SELECT * FROM `forum` WHERE `type` = 'f' ORDER BY `realid` ASC");
$i = 0;
while ($res = mysql_fetch_assoc($req)) {
echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
$a = array();
$a[ = '<span class="prefix prefixPrimary"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixSecondary"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixRed"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixGreen"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixOlive"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixLightGreen"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixBlue"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixRoyalBlue"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixSkyBlue"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixGray"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixSilver"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixYellow"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixOrange"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
echo $a[rand(0, count($a)-1);
echo '</div>';
++$i;
}
echo '</div>';
Copy code
$req = mysql_query("SELECT * FROM `forum` WHERE `type` = 'f' ORDER BY `realid` ASC");
$i = 0;
while ($res = mysql_fetch_assoc($req)) {
echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
$a = array();
$a[ = '<span class="prefix prefixPrimary"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixSecondary"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixRed"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixGreen"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixOlive"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixLightGreen"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixBlue"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixRoyalBlue"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixSkyBlue"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixGray"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixSilver"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixYellow"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
$a[ = '<span class="prefix prefixOrange"> <a href="'.$home.'/forum/' . functions::nguyen($res['text') . '_'.$res['id'.'.html" title="' . $res['text' . '">' . $res['text' . '</span></a>';
echo $a[rand(0, count($a)-1);
echo '</div>';
++$i;
}
echo '</div>';
Copy code
Yêu cầu mod rewrite nhé... thay biến ' . functions::nguyen
thành của bạn!
Nguồn: wapIT.Mobi

Trực Tuyến:
Khách: 1