Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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 (!defined('IN_PMBT')) die ("You can't access this file directly");
- $tableopen = false;
- $errtableopen = false;
- $table2open = false;
- $btback1 = "f0f0f0";
- $btback2 = "f9f9f9";
- $btback3 = "EBDDE2";
- function OpenTable($title = "title", $tablewidth = "") {
- global $tableopen, $siteurl;
- if ($tableopen) return;
- if($tablewidth !="") $stylewidth = "style=\"width: ".$tablewidth."px;\"";
- else $stylewidth = '';
- echo "<div id=\"contenttop\">".$title."</div><div id=\"content\" ".$stylewidth.">";
- $tableopen = true;
- }
- function CloseTable() {
- global $tableopen, $siteurl;
- if (!$tableopen) return;
- echo "</div></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 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 themechange(){
- {
- global $theme;
- $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 ($theme == $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 (preg_match("/\.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, $version;
- 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);
- }
- echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
- echo "<html>\n";
- echo "<head>\n";
- echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\" />\n";
- echo "<meta name=\"generator\" content=\"PMBT ".$version."\" />\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();
- echo "</head>\n\n";
- $themepage = false;
- ?>
- <!--[if lt IE 7]><link rel="stylesheet" type="text/css" media="screen" href="themes/pmbt/iestyle.css">
- <![endif]-->
- <!--[if IE 7]>
- <link rel="stylesheet" type="text/css" media="screen" href="themes/pmbt/iestyle.css">
- <![endif]-->
- <?php
- if($user->user)echo "<body onload=\"shoutthis_ajax()\">\n";
- else
- echo "<body>";
- echo"<noscript>
- <center><h1><font class=warntext>Javascript is not available!</font></h1></center>
- <center><h1><font class=warntext>This website cannot function correctly without JavaScript!</font></h1></center>
- </noscript>\n";
- echo "<div id=\"overDiv\" style=\"position:absolute; visibility:hidden; z-index:1000; \"></div>\n";
- echo "<div id=\"head\">";
- echo "<img style=\"display: block; margin: 0 auto;\" src=\"/themes/grayline/pics/updatelogo2.gif\" height=\"150\" width=\"365\" alt=\"\">";
- echo "</div>";
- include("themes/$theme/blocks/usercp.php");
- if(!preg_match("/phpBB.php/",$_SERVER["PHP_SELF"]))
- {
- if ($user->user AND $INVITEONLY)
- {
- echo "<div id=\"extratop\">";
- echo _btinvites;
- echo "</div>";
- echo "<div id=\"extra\">";
- echo _btinfituh ."<br>";
- echo "<br>";
- if ($user->invites > 0 ){
- echo "<a href=invite.php>"._btsendiv."</a>\n";
- }
- echo "</div>";
- }
- }
- echo "<div id=\"menutop\">";
- echo "Menu";
- echo "</div>";
- echo "<div id=\"menu\">";
- echo "<a href=\"index.php\">Home</a>";
- echo "<a href=\"torrents.php\">Torrents</a>";
- if($forumshare)echo(preg_match("/phpBB.php/",$_SERVER["PHP_SELF"])) ? "<a href=\"phpBB.php\">Forums</a>":"<a href=\"phpBB.php\">Forums</a>";
- echo "<a href=\"user.php?op=profile&id=" . $user->id ."\">User Profile</a>";
- echo "<a href=\"donate.php\" title=\"\">Donate</a>";
- if(($user->user OR $upload_level == "all"))echo(preg_match("/upload.php/",$_SERVER["PHP_SELF"])) ? "<a href=\"upload.php\">Upload</a>":"<a href=\"upload.php\">Upload</a>";
- if($user->user)echo(preg_match("/memberslist.php/",$_SERVER["PHP_SELF"])) ? "<a href=\"memberslist.php\">Members</a>":"<a href=\"memberslist.php\">Members</a>";
- if($user->user)echo(preg_match("/helpdesk.php/",$_SERVER["PHP_SELF"])) ? "<a href=\"helpdesk.php\">Help Desk</a>":"<a href=\"helpdesk.php\">Help Desk</a>";
- echo "</div>";
- function newuserpage($page)
- {
- if(preg_match("/user.php/",$page))return true;
- if(preg_match("/takeconfirminvite.php/",$page))return true;
- if(preg_match("/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 themefooter(){
- global $startpagetime;
- if(!preg_match("/phpBB.php/",$_SERVER["PHP_SELF"])){
- echo"</div></td><td width=\"18%\" valign=top >";#right hand collom here
- echo"</td>";
- echo"</tr>";
- }
- echo'
- <tr>
- <td>
- <td><p class="foot">
- <!-- Feel free to add you custom disclaimer or copyright notice here -->
- <!-- YOU ARE NOT ALLOWED TO EDIT THE FOLLOWING COPYRIGHT NOTICE!!! -->
- phpMyBitTorrent © 2005-2010 <a href="http://phpmybittorrent.com">phpMyBitTorrent Team</a>.<br>
- This is free software and contains source code version of GNU/LGPL distributed libraries.<br>
- You may redistribute the whole package and its source code according to the GNU/GPL license.<br>
- 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>';
- echo'
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </div>
- </div>
- <div id="theme-footer"></div>
- </div>
- </body>
- </html>';
- }
- function help($name,$help,$title = "") {
- echo "<span onmouseover=\"return overlib('".addslashes(str_replace(Array("\n","\""),Array("","'"),$help)),"'";
- if ($title != "") echo ",CAPTION, '".addslashes(str_replace(Array("\n","\""),Array("","'"),$title))."'";
- echo ",FGCOLOR,'#ffffaa',CAPICON,'themes/pmbt/pics/help.png',SHADOW,SHADOWOPACITY,40,SHADOWCOLOR,'#000000',SHADOWX,2,SHADOWY,2,HAUTO,VAUTO);\" onmouseout=\"return nd();\" style=\"cursor:help\">".$name."</span>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement