<?
  ##########################################
## Àâòîð: -=ØÀÕÒÅÐ=-                        #                                                                                                                                                                                      ## Ñàéò: http://masteram.us                 #                 															                      ## ICQ  :  46-92-90                         #                 														 		           ## Âåðñèÿ 4.0 Ëèöåíçèîííàÿ                  #
## Äàííàÿ âåðñèÿ ñêðèïòà ÿâëÿåòñÿ ÏËÀÒÍÎÉ,  #
## âû ÍÅ ÈÌÅÅÒÅ ÏÐÀÂÀ ðàñïðîñòðÿíÿòü äàííûé #
##  ñêðèïò èëè êàêèå-ëèáî ÷àñòè åãî êîäà... #
  #########################################

$intervzzn = $set['znatoktime'];

$printanzn=0;
$bz = $db->sql_fetchrow($db->sql_query ("Select znatok from botst where id='1'"));
$zndata = $bz['znatok'];
if ($zndata < $time){
$zndata = $time + $intervzzn;
$db->sql_query ("Update botst set znatok='".$zndata."' where id='1'");
$printanzn=1;
}


if($printanzn==1){
$zn1=file(H.'bots/doyouknow.txt');
$zn2=file(H.'bots/info.txt');
$rand1=rand(0,count($zn1)-1);
$rand2=rand(0,count($zn2)-1);
$mes = ''.$zn1[$rand1].$zn2[$rand2];

$mes = preg_replace("#\n#i", '', $mes);
$mes = preg_replace("#\r#i", '', $mes);

$z_post=$db->sql_fetchfield($db->sql_query("select COUNT(*) from rooms WHERE `znatok` != '0';"),0);
$k_page=k_page($z_post,$z_post);
$page=page($k_page);
$z1=$z_post*$page-$z_post;

$num = @$db->sql_query("SELECT * from rooms WHERE `znatok` != '0' order by rm DESC limit $z1, $z_post;" );
while($nums = @$db->sql_fetchrow($num)){
$db->sql_query ("INSERT INTO message (user,user_id,time,msg,rm) VALUES ('$user_znatok','0','$time','$mes','$nums[rm]')");
}

}
?>