Файл: banner/banner.php
Строк: 39
<?
/*
#=====================================================#
# (c) 2006 Banner Rotate v.1 #
#=====================================================#
# WAP site http://mega-wap.com.ru #
# WEB site http://art-tech.net.ru #
#=====================================================#
# Programmed By Demonaz #
# demonaz@mail.ru #
#=====================================================#
*/
include "config.php";
$banner_query = "SELECT * FROM user ORDER BY time ASC LIMIT 1";
if (!$banner_query) {
}$res = mysql_query($banner_query) or die(mysql_error());
$number = mysql_num_rows($res);if ($number == 0) {
print '<a href="add_banner.php"><img src="banner.gif" alt="Повесь Баннер!" /></a>';
exit;
}else{while ($row=mysql_fetch_array($res)){
$link = $row['link'];
$banner_link = $row['banner_link'];
$alt = $row['alt'];
$all = $row['all'];
$total = $row['total'];
$time = $row['time'];
}}
print '<a href="'.$link.'"><img src="'.$banner_link.'" alt="'.$alt.'" /></a>';
$total_plus = $total + 1;
@mysql_query("UPDATE user SET `total`=$total_plus WHERE time=$time;");
if ($total == $all){
$banner_delete_query = "DELETE FROM user WHERE time=$time LIMIT 1";
@mysql_query("$banner_delete_query");
}
?>