Здравейте как мога да сложа реклами на следните места:

На загреданото с червено.
Ето index-a:
TBdev
На загреданото с червено.
Ето index-a:
Код:
<?
ob_start("ob_gzhandler");
require "include/bittorrent.php";
dbconn(true);
if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
{
$choice = $_POST["choice"];
if ($CURUSER && $choice != "" && $choice < 256 && $choice == floor($choice))
{
$res = mysql_query("SELECT * FROM polls ORDER BY added DESC LIMIT 1") or sqlerr();
$arr = mysql_fetch_assoc($res) or die("No poll");
$pollid = $arr["id"];
$userid = $CURUSER["id"];
$dead = number_format(get_row_count("torrents", "WHERE visible='no'"));
$res = mysql_query("SELECT * FROM pollanswers WHERE pollid=$pollid && userid=$userid") or sqlerr();
$arr = mysql_fetch_assoc($res);
if ($arr) die("Dupe vote");
mysql_query("INSERT INTO pollanswers VALUES(0, $pollid, $userid, $choice)") or sqlerr();
if (mysql_affected_rows() != 1)
stderr("Error", "An error occured. Your vote has not been counted.");
header("Location: $BASEURL/");
die;
}
else
stderr("Error", "Please select an option.");
}
$a = @mysql_fetch_assoc(@mysql_query("SELECT id,username FROM users WHERE status='confirmed' ORDER BY id DESC LIMIT 1")) or die(mysql_error());
if ($CURUSER)
$latestuser = "<a href=userdetails.php?id=" . $a["id"] . ">" . $a["username"] . "</a>";
else
$latestuser = $a['username'];
{
$totalonline = $row["totalol"];
}
/*
$a = @mysql_fetch_assoc(@mysql_query("SELECT id,username FROM users WHERE status='confirmed' ORDER BY id DESC LIMIT 1")) or die(mysql_error());
if ($CURUSER)
$latestuser = "<a href=userdetails.php?id=" . $a["id"] . ">" . $a["username"] . "</a>";
else
$latestuser = $a['username'];
*/
// Totalspeed mod
$resSpeed = mysql_query("SELECT seeders,leechers,id FROM torrents WHERE visible='yes' ORDER BY added DESC") or sqlerr(__FILE__, __LINE__);
while ($rowTmp = mysql_fetch_array ($resSpeed)) {
$seedersTmp = $rowTmp['seeders'];
$leechersTmp = $rowTmp['leechers'];
$torrentId = $rowTmp['id'];
if ($seedersTmp >= 1 && $leechersTmp >= 1){
$spd = mysql_query("SELECT (t.size * t.times_completed + SUM(p.downloaded)) / (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(added)) AS totalspeed FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent AND p.torrent = '$torrentId' WHERE p.seeder = 'no' GROUP BY t.id ORDER BY added ASC") or sqlerr(__FILE__, __LINE__);
$a = mysql_fetch_assoc($spd);
$tmpSpeed += $a["totalspeed"];
}
}
$registered = number_format(get_row_count("users"));
$unverified = number_format(get_row_count("users", "WHERE status='pending'"));
$torrents = number_format(get_row_count("torrents"));
$dead = number_format(get_row_count("torrents", "WHERE visible='no'"));
$totaldownloaded = mksize($row["totaldl"]);
$totaluploaded = mksize($row["totalul"]);
$r = mysql_query("SELECT value_u FROM avps WHERE arg='seeders'") or sqlerr(__FILE__, __LINE__);
$a = mysql_fetch_row($r);
$seeders = 0 + $a[0];
$r = mysql_query("SELECT value_u FROM avps WHERE arg='leechers'") or sqlerr(__FILE__, __LINE__);
$a = mysql_fetch_row($r);
$leechers = 0 + $a[0];
$seeders = number_format(get_row_count("peers", "WHERE seeder='yes'"));
$leechers = number_format(get_row_count("peers", "WHERE seeder='no'"));
$peers = number_format($seeders + $leechers);
if ($leechers == 0)
$ratio = 0;
else
$ratio = round($seeders / $leechers * 100);
$warnedu = number_format(get_row_count("users", "WHERE warned='yes'"));
$disabled = number_format(get_row_count("users", "WHERE enabled='no'"));
$VIP = number_format(get_row_count("users", "WHERE class='2'"));
//$peers = number_format($seeders + $leechers);
//$seeders = number_format( get_row_count("peers", "WHERE seeder='yes'"));
//$leechers = number_format( get_row_count("peers", "WHERE seeder='no'"));
$result = mysql_query("SELECT SUM(downloaded) AS totaldl, SUM(uploaded) AS totalul FROM users") or sqlerr(__FILE__, __LINE__);
$row = mysql_fetch_assoc($result);
$totaldownloaded = $row["totaldl"];
$totaluploaded = $row["totalul"];
$totaldata = $totaldownloaded+$totaluploaded;
$dt = gmtime() - 180;
$dt = sqlesc(get_date_time($dt));
$result = mysql_query("SELECT SUM(last_access >= $dt) AS totalol FROM users") or sqlerr(__FILE__, __LINE__);
while ($row = mysql_fetch_array ($result))
{
$totalonline = $row["totalol"];
}
$dt = gmtime() - 600;
$dt = sqlesc(get_date_time($dt));
$res = mysql_query("SELECT id, username, class, donor, warned FROM users WHERE last_access >= $dt ORDER BY username") or print(mysql_error());
while ($arr = mysql_fetch_assoc($res))
{
if ($activeusers) $activeusers .= ",\n";
switch ($arr["class"])
{
case UC_SYSOP:
$arr["username"] = "<font color=#2587A7>" . $arr["username"] . "</font>";
break;
case UC_ADMINISTRATOR:
$arr["username"] = "<font color=#B000B0>" . $arr["username"] . "</font>";
break;
case UC_MODERATOR:
$arr["username"] = "<font color=#ff5151>" . $arr["username"] . "</font>";
break;
case UC_UPLOADER:
$arr["username"] = "<font color=#6464FF>" . $arr["username"] . "</font>";
break;
case UC_VIP:
$arr["username"] = "<font color=#009F00>" . $arr["username"] . "</font>";
break;
case UC_POWER_USER:
$arr["username"] = "<font color=#f9a200>" . $arr["username"] . "</font>";
break;
}
$donator = $arr["donor"] === "yes";
if ($donator)
$activeusers .= "<nobr>";
$warned = $arr["warned"] === "yes";
if ($warned)
$activeusers .= "<nobr>";
if ($CURUSER)
$activeusers .= "<a href=userdetails.php?id={$arr["id"]}><b>{$arr["username"]}</b></a>";
else
$activeusers .= "<b>{$arr["username"]}</b>";
if ($donator)
$activeusers .= "<img src={$pic_base_url}star.gif alt='Donated {$$arr["donor"]}'></nobr>";
if ($warned)
$activeusers .= "<img src={$pic_base_url}warned.gif alt='Warned {$$arr["warned"]}'></nobr>";
}
if (!$activeusers)
$activeusers = "No online users now";
stdhead();
echo "\n";
?>
<IMG SRC="/banners/1.jpg" WIDTH=735 HEIGHT=80 border=0>
<br>
<?
print("<table width=737 class=main border=0 cellspacing=0 cellpadding=0><font class=small>Добре дошъл най новия потребител, <b>$latestuser</b>!</font><tr><td class=embedded><br>");
print("<table width=737 class=main border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>");
print("<h2>Новини");
if (get_user_class() >= UC_ADMINISTRATOR)
print(" - <font class=small>[<a class=altlink href=news.php><b>Нова</b></a>]</font>");
print("</h2>\n");
$res = mysql_query("SELECT * FROM news WHERE ADDDATE(added, INTERVAL 45 DAY) > NOW() ORDER BY added DESC LIMIT 10") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) > 0)
{
print("<table width=100% border=1 cellspacing=0 cellpadding=10><tr><td class=text>\n<ul>");
while($array = mysql_fetch_array($res))
{
$user = mysql_fetch_assoc(mysql_query("SELECT username FROM users WHERE id = $array[userid]")) or sqlerr();
if ($news_flag == 0) {
print("<a href=\"javascript: klappe_news('a".$array['id']."')\"><br><img border=\"0\" src=\"pic/minus.gif\" id=\"pica".$array['id']."\" alt=\"Show/Hide\"> " . gmdate("d.m.Y",strtotime($array['added'])) . " - " ."<b>". $array['title'] . "</b> </a>");
print("<div id=\"ka".$array['id']."\" style=\"display: block;\"> ".format_comment($array["body"],0)." </div><br> ");
$news_flag = 1;
}
else {
print("<a href=\"javascript: klappe_news('a".$array['id']."')\"><br><img border=\"0\" src=\"pic/plus.gif\" id=\"pica".$array['id']."\" alt=\"Show/Hide\"> " . gmdate("M-d-y",strtotime($array['added'])) . " - " ."<b>". $array['title'] . "</b></a>");
print("<div id=\"ka".$array['id']."\" style=\"display: none;\"> ".format_comment($array["body"],0)." </div><br> ");
}
if (get_user_class() >= UC_ADMINISTRATOR)
{
print(" <font size=\"-2\"> [<a class=altlink href=news.php?action=edit&newsid=" . $array['id'] . "&returnto=" . urlencode($_SERVER['PHP_SELF']) . "><b>E</b></a>]</font>");
print(" <font size=\"-2\">[<a class=altlink href=news.php?action=delete&newsid=" . $array['id'] . "&returnto=" . urlencode($_SERVER['PHP_SELF']) . "><b>D</b></a>]</font>"); }
print("<div id=\"ka".$array['id']."\" style=\"display: none;\"> ".format_comment($array["body"],0)."</div>");
}
print("</ul></td></tr></table>\n");
}
?>
<? if ($CURUSER)
{
// Get current poll
$res = mysql_query("SELECT * FROM polls ORDER BY added DESC LIMIT 1") or sqlerr();
if($pollok=(mysql_num_rows($res)))
{
$arr = mysql_fetch_assoc($res);
$pollid = $arr["id"];
$userid = $CURUSER["id"];
$question = $arr["question"];
$o = array($arr["option0"], $arr["option1"], $arr["option2"], $arr["option3"], $arr["option4"],
$arr["option5"], $arr["option6"], $arr["option7"], $arr["option8"], $arr["option9"],
$arr["option10"], $arr["option11"], $arr["option12"], $arr["option13"], $arr["option14"],
$arr["option15"], $arr["option16"], $arr["option17"], $arr["option18"], $arr["option19"]);
// Check if user has already voted
$res = mysql_query("SELECT * FROM pollanswers WHERE pollid=$pollid AND userid=$userid") or sqlerr();
$arr2 = mysql_fetch_assoc($res);
}
print("<h2>Анкета");
if (get_user_class() >= UC_MODERATOR)
{
print("<font class=small>");
print(" - [<a class=altlink href=makepoll.php?returnto=main><b>Нова</b></a>]\n");
if($pollok) {
print(" - [<a class=altlink href=makepoll.php?action=edit&pollid=$arr[id]&returnto=main><b>Редактиране</b></a>]\n");
print(" - [<a class=altlink href=polls.php?action=delete&pollid=$arr[id]&returnto=main><b>Изтрий</b></a>]");
}
print("</font>");
}
print("</h2>\n");
if($pollok) {
print("<table width=100% border=1 cellspacing=0 cellpadding=10><tr><td align=center>\n");
print("<table class=main border=1 cellspacing=0 cellpadding=0><tr><td class=text>");
print("<p align=center><b>$question</b></p>\n");
$voted = $arr2;
if ($voted)
{
// display results
if ($arr["selection"])
$uservote = $arr["selection"];
else
$uservote = -1;
// we reserve 255 for blank vote.
$res = mysql_query("SELECT selection FROM pollanswers WHERE pollid=$pollid AND selection < 20") or sqlerr();
$tvotes = mysql_num_rows($res);
$vs = array(); // array of
$os = array();
// Count votes
while ($arr2 = mysql_fetch_row($res))
$vs[$arr2[0]] += 1;
reset($o);
for ($i = 0; $i < count($o); ++$i)
if ($o[$i])
$os[$i] = array($vs[$i], $o[$i]);
function srt($a,$b)
{
if ($a[0] > $b[0]) return -1;
if ($a[0] < $b[0]) return 1;
return 0;
}
// now os is an array like this: array(array(123, "Option 1"), array(45, "Option 2"))
if ($arr["sort"] == "yes")
usort($os, srt);
print("<table class=main width=100% border=0 cellspacing=0 cellpadding=0>\n");
$i = 0;
while ($a = $os[$i])
{
if ($i == $uservote)
$a[1] .= " *";
if ($tvotes == 0)
$p = 0;
else
$p = round($a[0] / $tvotes * 100);
if ($i % 2)
$c = "";
else
$c = " bgcolor=#ECE9D8";
print("<tr><td width=1% class=embedded$c><nobr>" . $a[1] . " </nobr></td><td width=99% class=embedded$c>" .
"<img src=/pic/bar_left.gif><img src=/pic/bar.gif height=9 width=" . ($p * 3) .
"><img src=/pic/bar_right.gif> $p%</td></tr>\n");
++$i;
}
print("</table>\n");
$tvotes = number_format($tvotes);
print("<p align=center>Votes: $tvotes</p>\n");
}
else
{
print("<form method=post action=index.php>\n");
$i = 0;
while ($a = $o[$i])
{
print("<input type=radio name=choice value=$i>$a<br>\n");
++$i;
}
print("<br>");
print("<p align=center><input type=submit value='Vote!' class=btn></p>");
}
?>
</td></tr></table>
<?
if ($voted)
print("<p align=center><a href=polls.php>Previous polls</a></p>\n");
?>
</td></tr></table>
<?
} else {
echo "<table width=100% border=1 cellspacing=0 cellpadding=10><tr><td align=center>\n";
echo "<table class=main border=1 cellspacing=0 cellpadding=0><tr><td class=text>";
echo"<p align=center><H3>No active poll</h3></p>\n";
echo "</td></tr></table></td></tr></table>";
}
}
?>
<h2>Последните 5 торента
<?
$rezfive = mysql_query("SELECT id, seeders, leechers, name, poster FROM torrents ORDER BY added DESC LIMIT 5") or sqlerr(__FILE__, __LINE__);
print '<table width=100% border=1 cellspacing=0 cellpadding=10><tr>';
if (mysql_num_rows($rezfive) > 0) {
while ($fiverow = mysql_fetch_assoc($rezfive)) {
$poster = (!empty($fiverow["poster"]) ? (str_replace(" ", "%20", htmlentities($fiverow['poster']))) : 'pic/poster.jpg');
print ("<td><a href=\"".$BASEURL."/details.php?id=".$fiverow['id']."\" /><img src=\"".$poster."\" width=\"150\" height=\"200\" border=0 /></a><br>");
}
}
echo "</tr></table>";
?>
<br>
<br>
Условия за ползване: Никой от показваните файлове не се хоства на този сървър. Линковете се предоставят единствено от потребителите на сайта. Администраторът на този сайт (xvhost.info) не носи отговорност за съдържанието на публикуваните съобщения или за каквито и да било други действия, извършвани от потребителите. Нямате право да използвате този сайт, за да сваляте или разпространявате материали, ако нямате права да извършвате това. Вие носите отговорност за придържане към тези условия.
</td></tr></table>
<?
stdfoot();
?>
TBdev