ob_start("ob_gzhandler");
require "include/bittorrent.php";
dbconn(true);
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$choice = $_POST["choice"];
if ($CURUSER && $choice != "" && $choice < 256 && $choice == floor($choice))
{
$res = do_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"];
$insert_pollvote = do_mysql_query("INSERT DELAYED INTO pollanswers VALUES(0, $pollid, $userid, $choice)");
//Check the error we get if the user has already voted
if( mysql_errno() == 1062)
{
stderr( _("Error"), _("Dupe vote") );
}
if (mysql_affected_rows() != 1)
stderr( _("Error"), _("An error occured. Your vote has not been counted.") );
header("Location: ".$GLOBALS['DEFAULTBASEURL']);
die;
}
else
stderr( _("Error"), _("Please select an option.") );
}
//End of vote
stdhead();
if ($CURUSER)
{
/* Get all vars for the stats */
if( $GLOBALS['settings']['mod_generalstats'] )
{
$stats_general = stats_general();
}
if( $GLOBALS['settings']['mod_trafficstats'] )
{
$totalspeed = stats_totalspeed();
}
if( $GLOBALS['settings']['mod_trafficstats'] )
{
$traffic_stats = stats_traffic();
}
if( $GLOBALS['settings']['mod_lastten'] )
{
$lastten = stats_lastten();
}
if( $GLOBALS['settings']['mod_activeusers'] )
{
$active_users = stats_activeusers();
}
if( $GLOBALS['settings']['mod_newestuser'] )
{
$newestuser = stats_newestuser();
$latestuser = ''. $newestuser['username'] . '';
printf('%s%s!', _('Welcome to our newest member '), $latestuser);
}
/* End of getting statistics variables */
}
//Print news
get_news();
if ($CURUSER)
{
get_poll();
}
if (!$CURUSER)
{
?>
Login
printf( _("Don't have an account? %s Sign up %s right now!"), '','');
echo '
';
}
if ($CURUSER)
{
if( $GLOBALS['settings']['mod_generalstats'] )
{
?>
Stats
=_('Max users')?> | =$maxusers?> |
=_('Registered users')?> | =$stats_general['registered']?> |
=_('Unconfirmed users')?> | =$stats_general['unverified']?> |
=_('Male users')?> | =$stats_general['male']?> |
=_('Female users')?> | =$stats_general['female']?> |
=_('Torrents')?> | =$stats_general['torrents']?> |
if (isset($stats_general['peers'])) { ?>
=_('Peers')?> | =$stats_general['peers']?> |
=_('Seeders')?> | =$stats_general['seeders']?> |
=_('Leechers')?> | =$stats_general['leechers']?> |
=_('Seeder/leecher ratio')?> (%) | =$stats_general['ratio']?> |
if( $GLOBALS['settings']['mod_trafficstats'] )
{
?>
=_('Total Download')?> | =$traffic_stats['total_downloaded']?> |
=_('Total Upload')?> | =$traffic_stats['total_uploaded']?> |
=_('Total Traffic')?> | =$traffic_stats['total_traffic']?> |
=_('Total Speed')?> | =$traffic_stats['total_speed']?> |
}
}
}
?>
|
Last 10 visitors |
foreach ($lastten as $arr)
{
switch ($arr["class"])
{
case UC_SYSOP:
case UC_ADMINISTRATOR:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_MODERATOR:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_UPLOADER:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_VIP:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_POWER_USER:
$arr["username"] = "" . $arr["username"] . "";
break;
}
$time = $arr['last_access2'];
if ($CURUSER)
echo "".$arr['username']." | ".mkprettytime($time)." ago | ";
else
echo "".$arr['username']." | ".mkprettytime($time)." ago | ";
}
?>
//print("Updated ".date('Y-m-d H:i:s', filemtime($file))." ");
}
?>
|
if( $GLOBALS['settings']['mod_activeusers'] )
{
foreach ($active_users as $arr)
{
if ($activeusers) $activeusers .= ",\n";
switch ($arr["class"])
{
case UC_SYSOP:
case UC_ADMINISTRATOR:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_MODERATOR:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_UPLOADER:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_VIP:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_POWER_USER:
$arr["username"] = "" . $arr["username"] . "";
break;
}
$donator = $arr["donor"];
if ($donator == "yes")
$activeusers .= "";
if ($CURUSER)
$activeusers .= "" . $arr["username"] . "";
else
$activeusers .= "".$arr['username']."";
if ($donator == 'yes')
$activeusers .= "";
}
if (!$activeusers)
$activeusers = _("There have been no active users lately.");
?>
Active users
} }
if($GLOBALS['settings']['mod_browserstats'])
{
?>
Browser Statistics
include ("bstats.php"); ?>
|
}
////////////////////////////////////////////////////torrent need seed
if ($CURUSER && $GLOBALS['settings']['mod_needseeds'])
{
if(!$GLOBALS['settings']['cache'] || !($stats = $cache_lite->get('mod_needseeds')) )
{
ob_start();
// Get the torrents with leechers but no seed.
$sn_lines = array();
$tnsr = do_mysql_query("SELECT t1.id, t1.name, t1.size, t1.leechers, t2.to_go FROM torrents AS t1, peers AS t2 WHERE t2.torrent = t1.id AND seeders = 0 AND leechers > 0 ORDER BY t1.leechers DESC, t2.to_go DESC") or sqlerr();
while ($tnsa = mysql_fetch_assoc($tnsr))
{
//if($tnsa['to_go'] >= $tnsa['size'])
$perc = round( ( ( (int) $tnsa['size'] - (int) $tnsa['to_go']) / (int) $tnsa['size']) * 100, 2) . "%";
$work[$tnsa['id']] = $tnsa['to_go'];
//var_dump($work);
$sn_lines[$tnsa['id']] = '' . $tnsa['name'] . ' (' . $tnsa['leechers'] . ($tnsa['leechers'] == 1 ? " leecher, $perc" : " leechers, $perc highest") . " completion rate)";
}
if(mysql_affected_rows())
print(""._('Torrents Needing Seeds')."
");
if (count($sn_lines))
{
echo("");
implode(' ', $sn_lines);
echo ''. _('Please help them out, if you happen to have the files on your harddisk. Thank you!') .'' ;
echo("\n");
echo(" |
");
}
else
{
echo("");
echo _("All torrents seem to be fine");
echo("\n");
echo(" |
");
}
$stats = ob_get_clean();
$cache_lite->save($stats, 'mod_needseeds');
}
echo $stats;
}
////////////////////////////////////////////////////torrent need seed
?>
printf( _('Disclaimer:None of the files shown here are actually hosted on this server. The links are provided solely by this site\'s users. These BitTorrent files are meant for the distribution of backup files. By downloading the BitTorrent file, you are claiming that you own the original file. The administrator of this site (%s) holds NO RESPONSIBILITY if these files are misused in any way and cannot be held responsible for what its users post, or any other actions of its users. For controversial reasons, if you are affiliated with any government, ANTI-Piracy group or any other related group, or were formally a worker of one you CANNOT download any of these BitTorrent files. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms.'), $GLOBALS['DEFAULTBASEURL']);
?>
stdfoot();
?>