Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function stdhead($title = "", $msgalert = true, $stdhead = false) {
- global $CURUSER, $TBDEV, $lang, $free, $_NO_COMPRESS, $querytime, $query_stat, $q, $mc;
- if (!$TBDEV['site_online'])
- die("We are making updates, please check back again later... thanks<br />");
- header('Content-Type: text/html; charset=utf-8');
- header('Content-Language content="en-us"');
- if ($title == "")
- $title = $TBDEV['site_name'] .(isset($_GET['tbv'])?" (".TBVERSION.")":'');
- else
- $title = $TBDEV['site_name'].(isset($_GET['tbv'])?" (".TBVERSION.")":''). " :: " . htmlspecialchars($title);
- if ($CURUSER)
- {
- $TBDEV['stylesheet'] = isset($CURUSER['stylesheet']) ? "{$CURUSER['stylesheet']}.css" : $TBDEV['stylesheet'];
- }
- if ($TBDEV['msg_alert'] && $msgalert && $CURUSER)
- {
- $res = sql_query("SELECT count(id) FROM messages WHERE receiver=" . $CURUSER["id"] . " && unread='yes'") or sqlerr(__FILE__,__LINE__);
- $arr = mysql_fetch_row($res);
- $unread = $arr[0];
- }
- /** ZZZZZZZZZZZZZZZZZZZZZZZZZZip it! **/
- if (!isset($_NO_COMPRESS))
- if (!ob_start('ob_gzhandler'))
- ob_start();
- /** include js files needed only for the page being used by pdq **/
- $js_incl = '<!-- javascript goes here or in footer -->';
- if ($stdhead['js'] != false) {
- foreach ($stdhead['js'] as $JS)
- $js_incl .= "<script type='text/javascript' src='".$TBDEV['baseurl']."/scripts/".$JS.".js'></script>";
- }
- $htmlout = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"
- \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
- <html xmlns='http://www.w3.org/1999/xhtml'>
- <!-- ************************************************************************** -->
- <!-- THIS WEBSITE IS POWERED BY TBDEV.NET 2009 (FINAL) SOURCECODE -->
- <!-- DESIGN IS MADE UNIQUE FOR THIS TRACKER, BY KIDVISION FROM TBDEV.NET TEAM -->
- <!-- HTTP://WWW.KIDVISION.ME | HTTP://WWW.TBDEV.NET -->
- <!-- ************************************************************************** -->
- <head>
- <meta name='generator' content='TBDev.net' />
- <meta http-equiv='Content-Language' content='en-us' />
- <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
- <meta name='MSSmartTagsPreventParsing' content='TRUE' />
- <title>{$title}</title>
- <link rel='alternate' type='application/rss+xml' title='Latest Torrents' href='./rss.php?passkey={$CURUSER['passkey']}' />
- <link rel='stylesheet' href='templates/1/1.css' type='text/css' />
- <link rel='stylesheet' href='templates/1/bbcode.css' type='text/css' />
- <script type='text/javascript' src='scripts/jquery.js'></script>
- <script type='text/javascript' src='image-resize/core-resize.js'></script>
- <link type='text/css' rel='stylesheet' href='image-resize/resize.css' />
- ".$js_incl."
- </head>
- <body>";
- if ($CURUSER)
- {
- $htmlout .= "
- <div id='container' class='container'>
- <div id='logo'><!-- Css - Change logo @ css --></div>
- <ul id='menu'>
- <li><a href='index.php'><font color=#555555>HOME</font></a></li>
- <li class='sub'><a class='sub' href='browse.php'><b><font color=#555555>BROWSE</font></b><!--[if gte IE 7]><!--></a><!--<![endif]-->
- <!--[if lte IE 6]><table><tr><td><![endif]-->
- <!--[if lte IE 6]></td></tr></table></a><![endif]-->
- </li>
- <li class='sub'><a class='sub' href='upload.php'><b><font color=#555555>UPLOAD</font></b><!--[if gte IE 7]><!--></a><!--<![endif]-->
- <!--[if lte IE 6]><table><tr><td><![endif]-->
- <!--[if lte IE 6]></td></tr></table></a><![endif]-->
- </li>
- <li class='sub'><a class='sub' href='usercp.php'><b><font color=#555555>PROFILE</font></b><!--[if gte IE 7]><!--></a><!--<![endif]-->
- <!--[if lte IE 6]><table><tr><td><![endif]-->
- <!--[if lte IE 6]></td></tr></table></a><![endif]-->
- </li>
- <li class='sub'><a class='sub' href='forums.php'><b><font color=#555555>FORUMS</font></b><!--[if gte IE 7]><!--></a><!--<![endif]-->
- <!--[if lte IE 6]><table><tr><td><![endif]-->
- <!--[if lte IE 6]></td></tr></table></a><![endif]-->
- </li>
- <li><a href='rules.php'><b><font color=#555555>RULES</font></b></a></li>
- <li><a href='faq.php'><b><font color=#555555>F.A.Q</font></b></a></li>
- </ul>";
- }
- $htmlout .= StatusBar();
- $htmlout .="
- <!-- Main content -->
- <table class='mainouter' width='100%' align='center' border='0' cellspacing='0' cellpadding='0'>
- <tr><td align='center' class='outer' style='padding-top: 20px; padding-bottom: 5px'>";
- //=== free addon start
- if ($CURUSER && isset($free)) {
- foreach ($free as $fl) {
- switch ($fl['modifier']) {
- case 1:
- $mode = 'All Torrents Free';
- break;
- case 2:
- $mode = 'All Double Upload';
- break;
- case 3:
- $mode = 'All Torrents Free and Double Upload';
- break;
- default:
- $mode = 0;
- }
- $htmlout .= ($fl['modifier'] != 0 && $fl['expires'] > TIME_NOW ? '<img src="'.$TBDEV['baseurl'].'/pic/cat_free.gif" alt="FREE!" title="'.$fl['title'].' | '.$mode.'
- '.$fl['message'].' | set by '.$fl['setby'].' | '.($fl['expires'] != 1 ?
- 'Until '.get_date($fl['expires'], 'DATE').' ('.mkprettytime($fl['expires'] - time()).' to go)' : '').'
- <br />' : '');
- }
- }
- // happy hour
- // if ( $CURUSER ) {
- // if ( happyHour( "check" ) ) {
- // $htmlout.="<table border='0' cellspacing='0' cellpadding='10' ><tr><td align='center' style=\"background:#CCCCCC;color:#222222; padding:10px\">\n
- // <b>Hey its now happy hour ! " . ( ( happyCheck( "check" ) == 255 ) ? "Every torrent downloaded in the happy hour is free" : "Only <a href=\"browse.php?cat=" . happyCheck( "check" ) . "\">this category</a> is free this happy hour" ) . "<br /><font color='red'>" . happyHour( "time" ) . " </font> remaining from this happy hour!</b>";
- // $htmlout.="</td></tr></table><br />\n";
- // }
- // }
- //==Big red staffmess thingy box:
- if($TBDEV['staffmsg_alert'] && $CURUSER['class'] >= UC_MODERATOR) {
- $num = mysql_result(sql_query('SELECT count(id) FROM staffmessages WHERE answeredby = 0'),0);
- if($num > 0)
- $htmlout .= "<table border='0' cellspacing='0' cellpadding='10'>
- <tr><td style='padding: 10px; background: #ccc'>\n
- <b><a href='staffbox.php'>".sprintf($lang['gl_staffmsg_alert'], $num). "!</a></b>
- </td></tr></table><br />";
- }
- //==End
- //==Big red report thingy box:
- if($TBDEV['report_alert'] && $CURUSER['class'] >= UC_MODERATOR) {
- $num = mysql_result(sql_query('SELECT COUNT(id) FROM reports WHERE delt_with = 0'),0);
- if($num > 0)
- $htmlout .= "<table border='0' cellspacing='0' cellpadding='10'>
- <tr><td style='padding: 10px; background: #ccc'>\n
- <b><a href='admin.php?action=reports'>".sprintf($lang['gl_reportmsg_alert'], $num). "!</a></b>
- </td></tr></table><br />";
- }
- //==End
- //Big red uploadapp thingy box:
- if($TBDEV['uploadapp_alert'] && $CURUSER['class'] >= UC_MODERATOR) {
- $num = mysql_result(sql_query('SELECT count(id) FROM uploadapp WHERE status = "pending"'),0);
- if($num > 0)
- $htmlout .= "<table border='0' cellspacing='0' cellpadding='10'>
- <tr><td style='padding: 10px; background: #ccc'>\n
- <b><a href='uploadapps.php'>".sprintf($lang['gl_uploadapp_alert'], $num). "!</a></b>
- </td></tr></table><br />";
- }
- //==End
- //==Temp demotion
- if ($CURUSER['override_class'] != 255 && $CURUSER) // Second condition needed so that this box isn't displayed for non members/logged out members.
- {
- $htmlout .= "<b><a href='./restoreclass.php'>
- <img src='templates/6/gfx/tool.png' alt='Your running under lower class, restore here' title='Your running under lower class, restore here' /><font color='white'></font></a></b> ";
- }
- //==End
- if ($TBDEV['msg_alert'] && isset($unread) && !empty($unread))
- {
- $htmlout .= "<b><a href='./messages.php'><img src='templates/6/gfx/new-mail.png' alt='You got mail' title='You got mail' /></a></b>";
- }
- return $htmlout;
- } // stdhead
- function stdfoot($stdfoot = false) {
- global $querytime, $CURUSER, $TBDEV, $q, $queries, $query_stat, $mc;
- $queries = (!empty($queries) ? $queries : 0);
- $q['debug'] = array(1); // USER IDs
- $q['seconds'] = (microtime(true) - $q['start']);
- $q['phptime'] = $q['seconds'] - $q['querytime'];
- $q['percentphp'] = number_format(($q['phptime'] / $q['seconds']) * 100, 2);
- $q['percentsql'] = number_format(($q['querytime'] / $q['seconds']) * 100, 2);
- $q['howmany'] = ($queries != 1 ? 's ' : ' ');
- $q['serverkillers'] = $queries > 6 ? '<br />'.($queries/2).' Server killers ran to show you this page' : '=]';
- $htmlfoot = "
- </td></tr></table></div>
- <div id='footer'>
- <div width='710px' align='center' id='footer-tb'>
- <a href='http://tbdev.net'><img src='templates/6/gfx/footer/tbdev.jpg' alt='Tbdev.net powered' title='Tbdev.net powered' style='opacity:0.4;filter:alpha(opacity=40)' onmouseover='this.style.opacity=1;this.filters.alpha.opacity=100' onmouseout='this.style.opacity=0.4;this.filters.alpha.opacity=40'/></a>
- <a href='http://validator.w3.org'><img src='templates/6/gfx/footer/xhtml.jpg' alt='Xhtml valid' title='Xhtml valid' style='opacity:0.4;filter:alpha(opacity=40)' onmouseover='this.style.opacity=1;this.filters.alpha.opacity=100' onmouseout='this.style.opacity=0.4;this.filters.alpha.opacity=40'/></a>
- <a href='http://kidvision.me'><img src='templates/6/gfx/footer/design.jpg' alt='Designed by kidvision' title='Designed by kidvision' style='opacity:0.4;filter:alpha(opacity=40)' onmouseover='this.style.opacity=1;this.filters.alpha.opacity=100' onmouseout='this.style.opacity=0.4;this.filters.alpha.opacity=40'/></a>";
- $htmlfoot .="</div></div>\n";
- /** query stats **/
- /** include js files needed only for the page being used by pdq **/
- $htmlfoot .= '<!-- javascript goes here -->';
- if ($stdfoot['js'] != false) {
- foreach ($stdfoot['js'] as $JS)
- $htmlfoot .= '<script type="text/javascript" src="'.$TBDEV['baseurl'].'/scripts/'.$JS.'.js"></script>';
- }
- $htmlfoot .= "</body></html>\n";
- return $htmlfoot;
- }
- function stdmsg($heading, $text)
- {
- $htmlout = "<table class='main' width='600' border='0' cellpadding='0' cellspacing='0'>
- <tr><td class='embedded'>\n";
- if ($heading)
- $htmlout .= "<h2>$heading</h2>\n";
- $htmlout .= "<table width='100%' border='1' cellspacing='0' cellpadding='10'><tr><td class='text'>\n";
- $htmlout .= "{$text}</td></tr></table></td></tr></table>\n";
- return $htmlout;
- }
- function StatusBar() {
- global $CURUSER, $TBDEV, $lang, $rep_is_on, $mc;
- if (!$CURUSER)
- return "";
- $upped = mksize($CURUSER['uploaded']);
- $downed = mksize($CURUSER['downloaded']);
- $ratio = $CURUSER['downloaded'] > 0 ? $CURUSER['uploaded'] / $CURUSER['downloaded'] : 0;
- $ratio = number_format($ratio, 2);
- $color = get_ratio_color($ratio);
- if ($color)
- $ratio = "<font color='$color'>$ratio</font>";
- $res1 = @sql_query("SELECT count(id) FROM messages WHERE receiver=" . $CURUSER["id"] . " AND unread='yes'") or sqlerr(__LINE__,__FILE__);
- $arr1 = mysql_fetch_row($res1);
- $unread = $arr1[0];
- $inbox = ($unread == 1 ? "$unread {$lang['gl_msg_singular']}" : "$unread {$lang['gl_msg_plural']}");
- $res2 = @sql_query("SELECT seeder, count(*) AS pCount FROM peers WHERE userid=".$CURUSER['id']." GROUP BY seeder") or sqlerr(__LINE__,__FILE__);
- $seedleech = array('yes' => '0', 'no' => '0');
- while( $row = mysql_fetch_assoc($res2) ) {
- if($row['seeder'] == 'yes')
- $seedleech['yes'] = $row['pCount'];
- else
- $seedleech['no'] = $row['pCount'];
- }
- /////////////// REP SYSTEM /////////////
- $member_reputation = get_reputation($CURUSER);
- ////////////// REP SYSTEM END //////////
- $usrclass="";
- if ($CURUSER['override_class'] != 255) $usrclass = " <b>(".get_user_class_name($CURUSER['class']).")</b> ";
- else
- if ($CURUSER['class'] >= UC_STAFF)
- $usrclass = " <a href='./setclass.php'><b>(".get_user_class_name($CURUSER['class']).")</b></a> ";
- $StatusBar = '';
- $StatusBar =
- "".
- "<div align='center' style='float:left; width:600px;'>
- <div class='topbar'>
- {$lang['gl_msg_welcome']},
- ".format_username($CURUSER)." {$usrclass} |
- Ratio: $ratio"." | Upload: $upped"." |
- Bonus: <a href='./mybonus.php'>{$CURUSER['seedbonus']}</a> | Invites: <a href='./invite.php'>{$CURUSER['invites']}</a> |
- Mailbox: <a href='./messages.php'>$inbox</a></div></div>";
- return $StatusBar;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement