Файл: inc/_banner100.php
Строк: 80
<?php
######################################
#плагин реклама - баннер 100x100
#Автор daranger
#url :wm-scripts.ru
#icq: 403-964-898
######################################
error_reporting (E_ALL);
$db->Query("SELECT `url`, `urlbanner` FROM `wm_ads_banner` WHERE `type`='100x100' ORDER BY `id` DESC");
if($db->NumRows() > 0){
while($rowss = $db->FetchArray())
{$banners100_array[] = array('url' => $rowss['url'], 'img' => $rowss['urlbanner']);}
}
else{echo 'банеров нету';}
if(isset($banners100_array[0])) {
$cnt2 = count($banners100_array);
$banner2 = $banners100_array[rand(0, ($cnt2-1))];
?><script language="JavaScript">
href100Array = new Array ('<?php for($i=0; $i<$cnt2; $i++){ echo $banners100_array[$i]['url']; if($i!=($cnt2-1)) {echo "','";} } ?>');
img100Array = new Array ('<?php for($i=0; $i<$cnt2; $i++){ echo $banners100_array[$i]['img']; if($i!=($cnt2-1)) {echo "','";} } ?>');
function ban2(t) {
time = 10000;
document.getElementById('ban2').innerHTML = '<a href="'+href100Array[t]+'" target="_blank"><img src="'+img100Array[t]+'" width="100" height="100" border="0" alt="Ротатор баннеров 100x100" /></a>';
t = t + 1;
if (t == img100Array.length) {
t = 0;
}
x = t;
timerID = setTimeout("ban2(x)",time);
}
</script>
<center><span id="ban2"><a rel="nofollow" href="<?php echo $banner2['url'];?>" target="_blank"><img src="<?php echo $banner2['img'];?>" width="100" height="100" border="0" alt="Ротатор баннеров 100x100" /></a></span><br />
<br>
<!--div align="center"><a href="banners_100x100.php">Смотреть все</a> | <a href="advs_banner100x100.php">Разместить баннер</a></div-->
<script language="JavaScript">ban(<?php echo rand(0,($cnt2-1));?>);</script>
<?php
}else{
echo '<div align="center"><a href="/baner100zakaz"><img src="/img/banner100_free.gif" width="100" height="100" alt="" /></a></div><br>';
echo '<div align="right"><a href="/baner100zakaz">Разместить</a></div>';
}
unset($banners100_array, $cnt2, $banner2);
?>