Файл: test.otwap.aux.su/iframe.php
Строк: 173
<?
require("lib/config.php");
require("lib/functions.php");
if ($_GET[id]) {
if (empty($_GET[b])) $_GET[b] = 1;
$query = "SELECT b.id, b.cols, b.row, b.background, b.link_color, b.border, b.align, s.id_user, s.id, s.url FROM `blocks` b, `sites` s WHERE b.id = '$_GET[id]' AND b.number = '$_GET[b]' AND s.id = b.id";
$set = select($query);
$row = mysql_fetch_row($set);
$limit = $row[1];
@mysql_query("SET CHARACTER SET cp1251");
@mysql_query("SET NAMES cp1251");
$query = "SELECT t.id, t.name, t.url, t.description FROM sites t, user b WHERE t.id_user = b.id AND t.status IN ('2', '1') AND LOCATE('$row[9]', t.url) = 0 AND b.balance >= t.clickwmz AND t.clickwmz >= 0.01 ORDER BY t.clickwmz DESC LIMIT $limit";
$set = select($query);
$count = mysql_num_rows($set);
$min = min($limit, $count);
if ($row[2] == 1) {
$frame_height = 30;
$frame_width = 180*$row[1];
$td_width = round(100/$limit);
}
else {
$frame_height = 30*$row[1];
$frame_width = 180;
$td_height = round($frame_height/$limit);
}
// if ($row[7] == 0) $height = $height*1.5;
if ($row[2] == 1) {
$output = "<table width=$frame_width height=$frame_height cellpadding=1 style='font-size=12;font-family:arial' align='center'><tr><td colspan=$min align=left><a href='" . BASE_URL . "'>" . SITE_NAME . "</a></td></tr><tr>";
for ($i=0; $i<$min; $i++) {
$id = mysql_result($set, $i, 0);
$name = mysql_result($set, $i, 1);
$url = mysql_result($set, $i, 2);
$description = mysql_result($set, $i, 3);
$output .= "<TD width='$td_width%' valign='top' style='border:solid $row[5]px $row[4];color:$row[3];' height=90><b><a href='".BASE_URL."/redirect.php?id=$id&from=$row[8]' style='color:$row[4]'>$name</a></b><br>$description<br><a href='".BASE_URL."/redirect.php?id=$id&from=$row[8]' style='color:$row[4]'>$url</a></td>";
}
for ($i=0; $i<($limit-$min); $i++) {
$output .= "<TD width='$td_width%' valign='top' style='border:solid $row[5]px $row[4];color:$row[3];' height=90><b><a href='http://wmsuper.com/' style='color:$row[4]'>Реклама от WmSuper.com</a></b><br>Рекламное место сдаётся, низкие цены, высокий эффект!<br><b><font color=red>Реклама от 1 (!) копейки</font></B><br><a href='http://wmsuper.com/' style='color:$row[4]'>http://WmSuper.com</a></td>";
}
$output .= "</tr></table>";
} else {
$output = "<center><a href=http://wmsuper.com><b><font color='#0000FF' style=' font-family:tahoma; font-size:7pt;'>Реклама от WmSuper.com</b></font></a><center><table width=$frame_width height=$frame_height cellpadding=1 style='font-size=12;font-family:arial' align='center'>";
for ($i=0; $i<$min; $i++) {
$id = mysql_result($set, $i, 0);
$name = mysql_result($set, $i, 1);
$url = mysql_result($set, $i, 2);
$description = mysql_result($set, $i, 3);
$output .= "<tr><TD width='$td_width%' valign='top' style='border:solid $row[5]px $row[4];color:$row[3]; background-color:#transparent ' height='$td_height'><b><a href='".BASE_URL."/redirect.php?id=$id&from=$row[8]' style='color:$row[4]'>$name</a></b><br>$description<br><a href='".BASE_URL."/redirect.php?id=$id&from=$row[8]' style='color:$row[4]'>$url</a></td></tr>";
}
for ($i=0; $i<($limit-$min); $i++) {
$output .= "<tr><TD width='$td_width%' valign='top' style='border:solid $row[5]px $row[4];color:$row[3]; background-color:#transparent ;' height=90 ><b><a href='http://wmsuper.com/' style='color:$row[4]'>Реклама от WmSuper.com</a></b><br>Рекламное место сдаётся, низкие цены, высокий эффект!<br><b><font color=red>Реклама от 1 (!) копейки</font></b><br><a href='http://wmsuper.com/' style='color:$row[4]'>http://WmSuper.com</a></td></tr>";
}
$output .= "</table>";
}
if ($row[6] == 1) {
echo "document.write("$output");";
} else {
?>
document.writeln("<DIV id='wmlinkrud' class='wmlinkrud' style='position:absolute; background-color:#FFFFFF; top:100; left:300; z-index:99999;'><?=$output?>"+
""+"<a href='#' onclick="javascript: wmlinkrud.style.visibility='hidden';"><b><font color='#0000FF' style='color: #0000FF; font-family:tahoma; font-size:7pt;'>Закрыть [x]</font></b></a></DIV>");
var wmlink_height=0;
var wmlink_width=0;
var z=0;
var b=0;
var wmlink_width_start=0;
var wmlink_height_start=0;
var dhi=5;
function wmlink_dh(){
if (dhi > 1){
dhi--;
if (dh < 1){
if (document.getElementById("wmlinkrud").offsetHeight > 0){
dh = document.getElementById("wmlinkrud").offsetHeight;
clearInterval(wmlinkdh);
wmlink_start();
}
}else {
clearInterval(wmlinkdh);
wmlink_start();
}
} else {
clearInterval(wmlinkdh);
dh=400;
wmlink_start();
}
}
function wmlink_start(){
z=wh-dh;
if (z<0)z=0;
document.getElementById("wmlinkrud").style.top=z;
wmlink_height=z;
b=ww-dw;
if (b<0)b=0;
document.getElementById("wmlinkrud").style.left=b;
wmlink_width=b;
wmlinkmove=setInterval("wmlink_move()",1);
}
function wmlink_move(){
if(document.all){ydiff=wmlink_height_start-document.body.scrollTop; xdiff=wmlink_width_start-document.body.scrollLeft}
else{ydiff=wmlink_height_start-window.pageYOffset; xdiff=wmlink_width_start-window.pageXOffset}
if(ydiff!=0){movey=Math.round(ydiff/10);wmlink_height_start-=movey}
if(xdiff!=0){movex=Math.round(xdiff/10);wmlink_width_start-=movex}
if(document.getElementById("wmlinkrud")){document.getElementById("wmlinkrud").style.top=wmlink_height_start+wmlink_height;document.getElementById("wmlinkrud").style.left=wmlink_width_start+wmlink_width}
}
if (document.body.clientWidth < document.body.offsetWidth){
if (document.body.clientWidth > 0)
var ww=document.body.clientWidth;
else
var ww=document.body.offsetWidth;
} else {
if (document.body.offsetWidth > 0)
var ww=document.body.offsetWidth - 2;
else
var ww=document.body.clientWidth;
}
var wh=document.body.clientHeight;
document.getElementById("wmlinkrud").style.width=ww*0;
var dw=document.getElementById("wmlinkrud").offsetWidth;
if (dw < 1)dw=<?=$frame_width?>;
var dh=document.getElementById("wmlinkrud").offsetHeight;
if (dh < 1){
// dh=100;
wmlinkdh=setInterval("wmlink_dh()",100);
} else {
wmlink_start();
}
<? }
} else exit;
?>