<? 
ob_start();
echo "<? ";
$r7 = mysql_query("SELECT * FROM rec  WHERE opl='1' AND opl_data > NOW()");
$mesto_kol_blok=array();

$super=array();
while($rr7 = mysql_fetch_array($r7))
{
echo "\n";
echo '$arr_rec_blok['.$rr7['id_rec'].'][\'id_rec\']='.$rr7['id_rec'].';';
echo "\n";
echo '$arr_rec_blok['.$rr7['id_rec'].'][\'content_rec\']=\''.$rr7['rec_cont'].'\';';
echo "\n";
echo '$arr_rec_blok['.$rr7['id_rec'].'][\'typ_rec\']='.$rr7['rec_typ'].';';
echo "\n";
echo '$arr_rec_blok['.$rr7['id_rec'].'][\'banner\']=\''.$rr7['banner'].'\';';
echo "\n";

if($rr7['str'])
	{
	$nm = unserialize($rr7['str']);
	foreach($nm as $k=>$nma)
		{
		foreach($nma as $kk=>$nmb)
			{
			$mesto_z[$k.'_'.$kk][$rr7['id_rec']] = $rr7['id_rec'];
			$i++;
			}
		}
	}
}	


if($mesto_z)
{
ksort($mesto_z);

$i=0;
foreach ($mesto_z as $index=>$mes)
	{
		foreach($mes as $ind=>$m)
		{
		echo "\n";
		echo '$mesto[\''.$index.'\']['.$ind.'] = '.$m.';';
		$i++;
		}
	}
}

echo "\n";
echo "?>";

$buf = ob_get_contents();
ob_end_clean();

$file1 = fopen ($bp."connect/_svod_rec.php", "w");
flock($file1, LOCK_EX);
fputs($file1, $buf);
fclose($file1);

?>
