PHP Code:
<?php
/*
*----------------------------phpMyBitTorrent V 2.0-----------------------------*
*--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---*
*-------------- Created By Antonio Anzivino (aka DJ Echelon) --------------*
*------------- http://www.p2pmania.it -------------*
*------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------*
*------------- http://www.bittorrent.com -------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*-- This program is free software; you can redistribute it and/or modify --*
*-- it under the terms of the GNU General Public License as published by --*
*-- the Free Software Foundation; either version 2 of the License, or --*
*-- (at your option) any later version. --*
*-- --*
*-- This program is distributed in the hope that it will be useful, --*
*-- but WITHOUT ANY WARRANTY; without even the implied warranty of --*
*-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --*
*-- GNU General Public License for more details. --*
*-- --*
*-- You should have received a copy of the GNU General Public License --*
*-- along with this program; if not, write to the Free Software --*
*-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --*
*-- --*
*------------------------------------------------------------------------------*
*------ �2005 phpMyBitTorrent Development Team ------*
*----------- http://phpmybittorrent.com -----------*
*------------------------------------------------------------------------------*
*----------------- Sunday, September 27, 2008 8:37 PM ---------------------*
*/
if(eregi("main.php",$_SERVER["PHP_SELF"])) die ("You can't access this file directly");
$tableopen = false;
$errtableopen = false;
$table2open = false;
$btback1 = "ffffff";
$btback2 = "ffffff";
$btback3 = "ffffff";
function OpenTable($title = "title", $tablewidth = "") {
global $tableopen, $siteurl;
if ($tableopen) return;
if($tablewidth !="") $stylewidth = "style=\"width: ".$tablewidth."px;\"";
else $stylewidth = '';
echo '<div class="forabg">
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="topiclist">
<li class="header">
<dl class="icon">
<dt>'.$title.'</dt>
</dl>
</li>
</ul>
<span class="corners-bottom"><span></span></span></div>
</div>';
$tableopen = true;
}
function CloseTable() {
global $tableopen, $siteurl;
if (!$tableopen) return;
echo '<div style="height: 2px;"></div>';
$tableopen = false;
}
function OpenTable2($title = "") {
global $tableopen2, $siteurl;
if ($tableopen2) return;
echo "<div id=\"messagebox\" > ";
echo "<span class=\"messagebox-title\">".$title."</span><div style=\"margin: 0 auto;\">";
$tableopen2 = true;
}
function CloseTable2() {
global $tableopen2, $siteurl;
if (!$tableopen2) return;
echo "</div></div>";
$tableopen2 = false;
}
function OpenNewsTable($title = "") {
global $OpenNewsTable, $siteurl;
if ($OpenNewsTable) return;
echo "<div id=\"newsbox\" > ";
$OpenNewsTable = true;
}
function CloseNewsTable() {
global $OpenNewsTable, $siteurl;
if (!OpenNewsTable) return;
echo "</div>";
$OpenNewsTable = false;
}
function OpenMessTable($title = "") {
global $OpenMessTable, $siteurl;
if ($OpenMessTable) return;
echo "<div id=\"messagebox\"> ";
echo "<span class=\"messagebox-title\">".$title."</span>";
$OpenMessTable = true;
}
function CloseMessTable() {
global $OpenMessTable, $siteurl;
if (!$OpenMessTable) return;
echo "</div>";
$OpenMessTable = false;
}
function OpenSuccTable($title = "") {
global $OpenSuccTable, $siteurl;
if ($OpenSuccTable) return;
echo "<div id=\"successbox\" > ";
echo "<span class=\"successbox-title\">".$title."</span>";
$OpenSuccTable = true;
}
function CloseSuccTable() {
global $OpenSuccTable, $siteurl;
if (!$OpenSuccTable) return;
echo "</div>";
$OpenSuccTable = false;
}
function OpenErrTable($title) {
global $OpenErrTable, $siteurl;
if ($OpenErrTable) return;
echo "<div id=\"errorbox\" > ";
echo "<span class=\"errorbox-title\">".$title."</span>";
$OpenErrTable = true;
}
function CloseErrTable() {
global $OpenErrTable, $siteurl;
if (!$OpenErrTable) return;
echo "</div>";
$OpenErrTable = false;
}
function themechange(){
{
global $bttheme;
$themes = Array();
$thememaindir = "themes";
$themehandle = opendir($thememaindir);
while ($themedir = readdir($themehandle)) {
if (is_dir($thememaindir."/".$themedir) AND $themedir != "." AND $themedir != ".." AND $themedir != "CVS")
$themes[$themedir] = $themedir;
}
closedir($themehandle);
unset($thememaindir,$themedir);
}
$change = '';
foreach ($themes as $key=>$val) {
$change .= "<option ";
if ($bttheme == $key) $change .="selected ";
$change .= "value=\"".$key."\">".$val."</option>\n";
}
unset($themes);
return $change;
}
function languagechange(){
{
global $language;
$languages = Array();
$langdir = "language";
$langhandle = opendir($langdir);
while ($langfile = readdir($langhandle)) {
if (eregi("\.php$",$langfile) AND strtolower($langfile) != "mailtexts.php")
$languages[str_replace(".php","",$langfile)] = ucwords(str_replace(".php","",$langfile));
}
closedir($langhandle);
unset($langdir,$langfile);
}
$change = '';
foreach ($languages as $key=>$val) {
$change .="<option ";
if ($language == $key) $change .="selected";
$change .=" value=\"".$key."\">".$val."</option>\n";
}
unset($languages);
return $change;
}
function themeheader() {
global $db, $db_prefix, $theme, $siteurl, $user, $upload_level, $sitename, $gfx_check, $donations, $INVITEONLY,$onlysearch, $pivate_mode, $forumshare, $shout_config, $PHP_SELF;
if ($user->user) {
//Update online user list
$pagename = substr($_SERVER["PHP_SELF"],strrpos($_SERVER["PHP_SELF"],"/")+1);
$sqlupdate = "UPDATE ".$db_prefix."_online_users SET page = '".addslashes($pagename)."', last_action = NOW() WHERE id = ".$user->id.";";
$sqlinsert = "INSERT INTO ".$db_prefix."_online_users VALUES ('".$user->id."','".addslashes($pagename)."', NOW(), NOW())";
$res = $db->sql_query($sqlupdate);
if (!$db->sql_affectedrows($res)) $db->sql_query($sqlinsert);
}
$who = "".getusername($btuser)."";
$timestamp=time();
$timeout=$timestamp-$timeoutseconds=86400;
$vtd = "INSERT INTO 24hourvist VALUES ('$who','$timestamp','".getip()."','".$PHP_SELF."')";
$vtdud = "UPDATE 24hourvist SET user = '$who', timestamp = '$timestamp', file = '".$PHP_SELF."' WHERE ip = '".getip()."'";
$restd = $db->sql_query($vtdud);
if (!$db->sql_affectedrows($restd)) $db->sql_query($vtd);
$db->sql_query("DELETE FROM 24hourvist WHERE timestamp<$timeout");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";
echo "<head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" >\n";
echo "<meta name=\"generator\" content=\"PMBT 2.0.2\" >\n";
echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" >\n";
echo "<meta http-equiv=\"Expires\" content=\"-1\" >\n";
echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" >\n";
echo "<!--[if lt IE 7]>
<script defer type=\"text/javascript\" src=\"$siteurl/pngfix.js\"></script><![endif]-->";
echo "<title>".$sitename."</title>\n";
?>
<script type="text/javascript">
pmbtsite_url = "<?php echo $siteurl; ?>";
tag_prompt = "<?php echo _bb_tag_prompt; ?>";
img_prompt = "<?php echo _bb_img_prompt; ?>";
font_formatter_prompt = "<?php echo _bb_font_formatter_prompt; ?>";
link_text_prompt = "<?php echo _bb_link_text_prompt; ?>";
link_url_prompt = "<?php echo _bb_link_url_prompt; ?>";
link_email_prompt = "<?php echo _bb_link_email_prompt; ?>";
list_type_prompt = "<?php echo _bb_list_type_prompt; ?>";
list_item_prompt = "<?php echo _bb_list_item_prompt; ?>";
_btshoutnowprivate = "<?php echo _btshoutnowprivate; ?>";
shoutrefresht = "<?php echo $shout_config['refresh_time']; ?>";
shoutidle = "<?php echo $shout_config['idle_time']; ?>";
</script>
<?php
if (is_readable("themes/$theme/favicon.ico")) {
echo "<link REL=\"shortcut icon\" HREF=\"$siteurl/themes/".$theme."/favicon.ico\" TYPE=\"image/x-icon\">\n";
}
if (!$onlysearch) {
echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"Last Torrents\" href=\"$siteurl/backend.php?op=last\">\n";
echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"Best Torrents\" href=\"$siteurl/backend.php?op=best\">\n";
}
if (is_readable("themes/$theme/style.css")) {
echo "<link rel=\"StyleSheet\" href=\"$siteurl/themes/$theme/style.css\" type=\"text/css\">\n<script type=\"text/javascript\" src=\"$siteurl/global.js\"></script>\n";
}
overlib_init();
$catmen = '';
foreach (catlist() as $cat){
$catmen .= "<div class = \"helpm\"><a class=\"forumtitle\" href=\"torrents.php?cat=".$cat['id']."\">".$cat['name']."</a></div>";
}
echo "</head>\n\n";
define("BT_SHARE",true);
$themepage = false;
if($user->user)echo "<body onload=\"shoutthis_ajax()\">\n";
else
echo "<body>";
echo"<noscript>
<center><h3><font color=red>Javascript is not available!</font></h3></center>
<center><h3><font color=red>This website cannot function correctly without JavaScript!</font></h3></center>
</noscript>\n";
echo "<div id=\"overDiv\" style=\"position:absolute; visibility:hidden; z-index:1000;\"></div>\n";
echo'<div id="bodybg">
<div id="pmbtwrapper">
<div id="pmbshad-l">
<div id="pmbshad-r">
<div id="header">
<div id="head-l">
<div id="head-r">
<div id="userarea" class="smalltext"><p class="right">It is currently '.date("D M j G:i:s T Y").'</p>
</div>
<div class="smalltext">
<div id="search-box">
<form action="./search.php" method="post" id="search">
<input name="search" id="keywords" type="text" maxlength="128" title="Search for keywords" class="inputbox search" value="Search" onclick="if(this.value==\'Search\')this.value=\'\';" onblur="if(this.value==\'\')this.value=\'Search\';" >
<input class="button2" value="Search" type="submit" ><br >
</form>
</div>
</div>
<a href="./index.php" title=""><span id="pmbtlogo"> </span></a>
</div>
</div>
</div>
<div id="toolbar">
<div id="topmenu">
<ul>';
echo " <li><a href=\"./index.php\"><span>Index</span></a></li>\n";
echo "<li>";
help("<a href=\"./torrents.php\"><span>Torrents</span></a>","<div class=\"forabg\"><div class=\"inner\"><span class=\"corners-top\"><span></span></span><ul class=\"topiclist\"><li class=\"header\"><dl class=\"icon\"><dt><span onclick=\"return nd();\">Menu(Close)</span></dt></dl></li></ul><span class=\"corners-bottom\"><span></span></span></div></div><div class = \"helpm\"><a class=\"forumtitle\" href=\"torrents.php\">All Torrents</a></div><div class = \"helpm\"><a class=\"forumtitle\" href=\"viewrequests.php\">View Requests</a></div><div class = \"helpm\"><a class=\"forumtitle\" href=\"./offers.php\">Torrents Offered</a><div class=\"poptoolbar\">Category's</div></div>".$catmen."<div style=\"height: 2px;\"></div>",'test','test');
echo "</li>";
if ($forumshare)echo " <li><a href=\"./phpBB.php\"><span>Forums</span></a></li>\n";
if($user->user)echo " <li><a href=\"./memberslist.php\"><span>Members</span></a></li>\n";
if($user->user) {
echo " <li><a href=\"./games.php\"><span>Games</span></a></li>\n";
echo "<li>";
help("<a href=\"./user.php\"><span>My Profile</span></a>","<div class=\"forabg\"><div class=\"inner\"><span class=\"corners-top\"><span></span></span><ul class=\"topiclist\"><li class=\"header\"><dl class=\"icon\"><dt><span onclick=\"return nd();\">Menu(Close)</span></dt></dl></li></ul><span class=\"corners-bottom\"><span></span></span></div></div><div class = \"helpm\"><a class=\"forumtitle\" href=\"mytorrents.php\">Your Torrents</a></div><div class = \"helpm\"><a class=\"forumtitle\" href=\"pm.php\">Private Messages</a></div><div class = \"helpm\"><a class=\"forumtitle\" href=\"./user.php?op=profile&id=" . $user->id ."\">User Control Panel</a></div><div class = \"helpm\"><a class=\"forumtitle\" href=\"./mybonus.php\">Seeding Bonus</a></div><div style=\"height: 2px;\"></div>",'test','test');
echo "</li>";
}
if(!$user->user)echo " <li><a href=\"./user.php?op=register\"><span>Register</span></a></li>\n";
if(!$user->user)echo " <li><a href=\"./user.php?op=profile\"><span>Login</span></a></li>\n";
if($user->user)echo " <li><a href=\"./user.php?op=logout\"><span>Logout</span></a></li>\n";
if(($user->user OR $upload_level == "all"))echo " <li><a href=\"upload.php\"><span>Upload</span></a></li>\n";
if($user->admin)echo " <li><a href=\"admin.php\"><span>Admin</span></a></li>";
echo"<li>\n";
help("<a href=\"./chat.php\"><span>Help</span></a>","<div class=\"forabg\"><div class=\"inner\"><span class=\"corners-top\"><span></span></span><ul class=\"topiclist\"><li class=\"header\"><dl class=\"icon\"><dt><span onclick=\"return nd();\">Menu(Close)</span></dt></dl></li></ul><span class=\"corners-bottom\"><span></span></span></div></div><div class = \"helpm\"><a class=\"forumtitle\" href=\"chat.php\">Chat</a></div><div class = \"helpm\"><a class=\"forumtitle\" href=\"rules.php\">Rules</a></div><div class = \"helpm\"><a class=\"forumtitle\" href=\"faq.php\">F.A.Q</a></div><div class = \"helpm\"><a class=\"forumtitle\" href=\"staff.php\">Staff</a></div><div style=\"height: 2px;\"></div>",'test','test');
echo '</li>';
echo '</ul>
</div>
</div>
<div id="bodyarea">
<br ><br >';
function newuserpage($page)
{
if(eregi("user.php",$page))return true;
if(eregi("takeconfirminvite.php",$page))return true;
if(eregi("confirminvite.php",$page))return true;
return false;
}
if($pivate_mode AND !$user->user AND !newuserpage($_SERVER["PHP_SELF"])){
loginrequired("user", false);
include'footer.php';
}
$reason = "";
if (is_banned($user, $reason)) {
echo "<p> </p>\n";
echo "<p> </p>\n";
echo "<h3 align=\"center\">".str_replace("**reason**",htmlspecialchars($reason),_btbannedmsg)."</p>\n";
echo "<p> </p>\n";
echo "<p> </p>\n";
include("footer.php");
die();
}
$has_newpm = false;
$sql = "SELECT id FROM ".$db_prefix."_private_messages WHERE recipient = '".$user->id."' AND is_read = 'false' LIMIT 1;";
$res = $db->sql_query($sql) or btsqlerror($sql);
$has_newpm = ($db->sql_numrows($res) > 0) ? true : false;
$db->sql_freeresult($res);
if ($has_newpm)
{
echo "<script type=\"text/javascript\" language=\"JavaScript\">";
echo "sPath = window.location.pathname;";
echo "sPage = sPath.substring(sPath.lastIndexOf('/') + 1);";
echo "if (sPage != \"pm.php\"){ var answer = confirm (\""._jscriptconfirmtext."\");";
echo "if (answer) window.location=\"pm.php?op=inbox\";";
echo "}";
echo "</script>";
}
}
function overlib_init() {
echo "<script type=\"text/javascript\" src=\"overlib/overlib.js\"><!-- overLIB (c) Erik Bosrup --></script>\n";
echo "<script type=\"text/javascript\" src=\"overlib/overlib_shadow.js\"><!-- overLIB (c) Erik Bosrup --></script>\n";
}
function themefooter(){
global $startpagetime;
echo"</div>";#right hand collom here
echo'<div id="footer">
<div id="foot-l">
<div id="foot-r">
<div id="footerarea">
<span class="smalltext">
<span class="smalltext" style="display: inline; visibility: visible; font-family: Verdana, Arial, sans-serif; color:#FFFFFF;">
<p>
<!-- Feel free to add you custom disclaimer or copyright notice here -->
<!-- YOU ARE NOT ALLOWED TO EDIT THE FOLLOWING COPYRIGHT NOTICE!!! -->
U-torrentz.org © 2010 <a href="http://www.u-torrentz.org">U-torrentz</a>.<br>
Original Code and Design By <a href="http://www.phpmybittorrent.com" target="_blank">PhpMyBitTorrent</a>
The Development Team cannot be held responsible in any way for the results of the use of this software.<br>
<!-- END OF COPYRIGHT NOTICE -->
Generated in ' . abs(round(microtime()-$startpagetime,2)) . ' seconds
</p>
</span>
</span>
</div>
</div>
</div>
</div>
<div>
<a id="bottom" name="bottom" accesskey="z"></a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>';
}
function help($name,$help,$title = "",$link = "") {
if ($link != "") echo "<span class=\"overlib\" onclick=\"return overlib('".addslashes(str_replace(Array("\n","\""),Array("","'"),$help)),"'";
if ($link == "") echo "<span class=\"overlib\" onmouseover=\"return overlib('".addslashes(str_replace(Array("\n","\""),Array("","'"),$help)),"'";
if ($title != "" AND $link == "") echo ",CAPTION, '".addslashes(str_replace(Array("\n","\""),Array("","'"),$title))."'";
// if ($title != "" AND $link != "") echo ",CAPTION, '".addslashes(str_replace(Array("\n","\""),Array("","'"),$title))."'";
if ($link == "") echo ",TEXTFONT,'Verdana',TEXTCOLOR,'#FFFFFF',CAPTIONFONT,'Lucida Console, Verdana',CENTER,FGCOLOR,'#000000',BGCOLOR,'#6F7578',CAPICON,'themes/1thank/pics/help.png',BORDER,2,SHADOW,SHADOWOPACITY,40,SHADOWCOLOR,'#030303',SHADOWX,2,SHADOWY,2);\" onmouseout=\"return nd();\" style=\"cursor:help\">".$name."</span>";
if ($link != "") echo ",CELLPAD,'0',FOLLOWMOUSE,'0',TEXTFONT,'Verdana',TEXTCOLOR,'#FFFFFF',CAPTIONFONT,'Lucida Console, Verdana',CENTER,FGCOLOR,'#000000',BGCOLOR,'#6F7578',CAPICON,'themes/1thank/pics/help.png',SHADOW,SHADOWOPACITY,40,SHADOWCOLOR,'#030303',SHADOWX,2,SHADOWY,2);\" >".$name."</span>";
}