File size: 890B
<?php
$asd2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `aforism` WHERE `type`='yes';"), 0);
$strt = mt_rand(1, $asd2);
$nst = mysql_fetch_assoc(mysql_query("SELECT * FROM `aforism` WHERE `type`='yes' LIMIT $strt, 1"));
if ($asd2 > 0 && !empty($nst['text'])) {
echo '<div class="maintxt"><div class="phdr"><b>Коллекция Афоризмов</b></div>';
$novm = mysql_result(mysql_query("SELECT COUNT(*) FROM `aforism` WHERE `type`='no';"), 0);
if ($user_id && $rights >= 6 && $novm > 0) {
echo '<div class="menu">» <a href="' .$home. '/str/afor_admin.php">Есть Новые</a> [' .$novm. ']</div>';
}
echo '<div class="c">' . $nst['text'] . ' (<span class="green"><b>' . $nst['name'] . '</b></span>)</div>';
if ($user_id) {
echo '<div class="menu">» <a href="' .$home. '/str/add_afor.php">Добавить свой</a></div>';
}
echo '</div>';
}
?>