<?php $req = mysql_query(\"SELECT `id`,`text`, `from` FROM `forum` where type=\'t\' ORDER BY time DESC LIMIT 5; \"); while ($arr = mysql_fetch_array($req)){ $nikuser = mysql_query(\"SELECT `from`,`time`,`text` FROM `forum` WHERE `type` = \'m\' AND `close` != \'1\' AND `refid` = \'\" . $arr[\'id\'] . \"\'ORDER BY time DESC LIMIT 1;\"); $nam = mysql_fetch_array($nikuser); $colmes = mysql_query(\"SELECT COUNT(*) FROM `forum` WHERE `type`=\'m\' AND `refid`=\'\" . $arr[\'id\'] . \"\'\" . ($rights >= 7 ? \'\' : \" AND `close` != \'1\'\")); $colmes1 = mysql_result($colmes, 0); echo\'<div class=\"menu\">\'; echo \"<img src=\'images/op.gif\' alt=\'\' align=\'left\' width=\'15\' height=\'15\' /> <a href=\'forum/index.php?id=\".$arr[\'id\'].\"\'> $arr[text]</a>[$colmes1] >> \".$nam[\'from\'].\"\"; $vrp = $nam[\'time\'] + $set_user[\'sdvig\'] * 3600; echo \' <span class=\"gray\"><small> (\' . date(\"d.m.y / H:i\", $vrp) . \")</small></span>\"; echo\'</div>\'; } ?>