<?php

##Анекдот по запросу
if ($msg=="!anekdot"||$msg=="!анекдот"){
$rs = mysql_query("select count(klu4) as num from anekdot");
$as = mysql_fetch_array($rs);
$rnds = rand(1,$as['num']);
$rs = mysql_query ("SELECT message FROM anekdot WHERE klu4 = '".$rnds."' LIMIT 1;");
$bs = mysql_fetch_array($rs);
$mes = '[b]'.$us.'[/b],'.$bs['message'];
$bot8 = @mysql_query ("Select user from users where id='6' LIMIT 1;");
$zz1 = @mysql_fetch_array ($bot8);
$bot81 = $zz1['user'];
$rnd = rand(0,99999999);
$today=date ("H:i");


mysql_query ("Insert into forum_message set topic='".$id."', section='".$f."', subfor = '".$sf."', login ='6', msg='".$mes."',time='".(time()+1)."', privat = '0'");
mysql_query("update `forum_topic` set time='".(time()+1)."' where id='".$id."';");
}
?>