Файл: test.otwap.aux.su/margue.php
Строк: 142
<?
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 = "<a href='" . BASE_URL . "' class=wmsuper ><font color=$row[3]> " . SITE_NAME . "</a> : </font>";
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 .= "<left><a href='".BASE_URL."/redirect.php?id=$id&from=$row[8]' class=wmsuper target=_blanck><font color=$row[3]>$row[4]$description</font></a></left>";
}
for ($i=0; $i<($limit-$min); $i++) {
$output .= "<a href='http://wmsuper.com/' class=wmsuper target=_blanck><font color=$row[3]> Рекламное место здается от <b>0.01</b> WMR</font></a>";
}
$output .= "";
} else {
$output = "<center><a href=http://wmsuper.com target=_blanck class=wmsuper ><font color=$row[3]> <b>Реклама от WmSuper.com</b></font></a></center><br>";
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 .= "<left><a href='".BASE_URL."/redirect.php?id=$id&from=$row[8]' class=wmsuper style='color:$row[3]' target=_blanck>$row[4]$description</a></left><br>";
}
for ($i=0; $i<($limit-$min); $i++) {
$output .= "<a href='http://wmsuper.com/' class=wmsuper target=_blanck><font color=$row[3]> $row[4] Рекламное место здается от <b>0.01</b> WMR</a></font><br> ";
}
$output .= "";
}
if ($row[6] == 1) {
echo "document.write("$output");";
} else {
?>
document.writeln("");
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;
?>