$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > '".(time()-600)."'"
, 0);
$q = mysql_query("SELECT `id` FROM `user` WHERE `date_last` > '".(time()-600)."' ORDER BY rand() DESC LIMIT тут количество вывода на страницу"
;
$ank = get_user($ank['id']);
while ($ank = mysql_fetch_assoc($q))