load('index');
//---------------------------------
//---- Get Referrer v0.5 by xam
//---------------------------------
function get_referrer () {
global $ref;
if ($ref == 'yes') {
unset($uref);
$uref=$_SERVER['HTTP_REFERER'];
if (isset($uref)) {
if (!preg_match('/templateshares/i', $uref)) {
if (!$_COOKIE['referrer'] || $_COOKIE['referrer'] != $uref) {
setcookie('referrer', $uref, TIMENOW+3600); /* expire in 1 hour */
if ($uref != '')
sql_query('INSERT INTO referrer (referrer_url) VALUES ('.sqlesc($uref).')');
}
}
}
}
}
//---------------------------------
//---- Get Referrer v0.5 by xam
//---------------------------------
function legend ($linebreak = true) {
global $rootpath,$pic_base_url, $lang;
if ($linebreak)
echo '
';
echo sprintf($lang->global['legend'], $rootpath.$pic_base_url);
}
if (($showwhatsgoinon == 'yes') OR ($showwhatsgoinon == 'staffonly' AND get_user_class() >= UC_MODERATOR)) {
$no24=false;
$a = @mysql_fetch_array(@sql_query('SELECT id,username,invisible FROM users WHERE status=\'confirmed\' ORDER BY id DESC LIMIT 1')) or sqlerr(__FILE__, __LINE__);
if ($CURUSER)
$latestuser = '' . $a['username'] . '';
else
$latestuser = $a['username'];
$dt24 = gmtime() - 24 * 60 * 60;
$arr = mysql_fetch_array(sql_query('SELECT * FROM avps WHERE arg=\'last24\'')) or $no24=true;
$res=sql_query('SELECT * FROM users WHERE last_access >= \''. get_date_time($dt24). '\' ORDER BY username') or sqlerr(__FILE__, __LINE__);
$totalonline24 = mysql_num_rows($res);
$_ss24 = ($totalonline24 != 1 ? 's' :'');
$last24record = get_date_time($arr['value_u']);
$last24 = $arr['value_i'];
if ($no24 || $totalonline24 > $last24 )
{
$last24 = $totalonline24;
$period = strtotime(gmdate('Y-m-d H:i:s'));
sql_query(($no24 ? 'INSERT':'UPDATE'). " avps SET value_i = $last24 , value_u = $period ". ($no24 ? ", arg='last24'":"WHERE arg='last24'")) or sqlerr(__FILE__,__LINE__);
}
$colors = array(null,'#f9a200','#009F00','#6464FF','#ff5151','#B000B0','#2587A7','darkred');
$activeusers24 = '';
while ($arr = mysql_fetch_array($res))
{
if ($arr['invisible'] == 'yes' AND get_user_class() < UC_MODERATOR AND $arr['id'] != $CURUSER['id'])
continue;
if ($activeusers24)
$activeusers24 .= ', ';
if($arr['class'] != '0')
$arr['username'] = ''.$arr['username'].'';
if($donator = $arr['donor'] === 'yes');
$activeusers24 .= '';
if ($warned = $arr['warned'] === 'yes')
$activeusers24 .= '';
if ($CURUSER)
$activeusers24 .= ''.$arr['username'].'';
else
$activeusers24 .= ''.$arr['username'].'';
if ($invisible = $arr['invisible'] === 'yes')
$activeusers24 .= '+';
if ($donator)
$activeusers24 .= 'global['imgdonated'].'\'>';
if ($warned)
$activeusers24 .= 'global['imgwarned'].'\'>';
}
if (!$activeusers24)
$activeusers24 = $lang->index['nolast24visits'];
}
if (($showstats == 'yes') OR ($showstats == 'staffonly' AND get_user_class() >= UC_MODERATOR)) {
$unverified = number_format(get_row_count('users', 'WHERE status=\'pending\''));
$donated = number_format(get_row_count('users', 'WHERE donor = \'yes\''));
$torrents = number_format(get_row_count('torrents'));
$dead = number_format(get_row_count('torrents', 'WHERE visible=\'no\''));
$seeders = get_row_count('peers', 'WHERE seeder=\'yes\'');
$leechers = get_row_count('peers', 'WHERE seeder=\'no\'');
$peers = $seeders + $leechers;
if ($leechers == 0)
$ratio = 0;
else
$ratio = round($seeders / $leechers * 100);
$warnedu = number_format(get_row_count('users', 'WHERE warned=\'yes\' OR leechwarn = \'yes\' AND enabled = \'yes\''));
$disabled = number_format(get_row_count('users', 'WHERE enabled=\'no\''));
$VIP = number_format(get_row_count('users', 'WHERE class=\''.UC_VIP.'\''));
$result = sql_query('SELECT SUM(downloaded) AS totaldl, SUM(uploaded) AS totalul, COUNT(id) AS totaluser FROM users') or sqlerr(__FILE__, __LINE__);
$row = mysql_fetch_array($result);
$totaldownloaded = $row['totaldl'];
$totaluploaded = $row['totalul'];
$registered = $row['totaluser'];
}
if (($showwhatsgoinon == 'yes') OR ($showwhatsgoinon == 'staffonly' AND get_user_class() >= UC_MODERATOR)) {
$dt = gmtime() - 180;
$dt = sqlesc(get_date_time($dt));
$res = sql_query('SELECT id, username, class, invisible, donated, warned FROM users WHERE last_access >= '.$dt.' ORDER BY username') or sqlerr(__FILE__, __LINE__);
$webtotal = number_format(get_row_count('users', 'WHERE last_access >= '.$dt));
$activeusers = '';
while ($arr = mysql_fetch_array($res))
{
if ($arr['invisible'] == 'yes' AND get_user_class() < UC_MODERATOR AND $arr['id'] != $CURUSER['id'])
continue;
if ($activeusers)
$activeusers .= ', ';
switch ($arr['class'])
{
case UC_STAFFLEADER:
$arr['username'] = '' . $arr['username'] . '';
break;
case UC_SYSOP:
$arr['username'] = '' . $arr['username'] . '';
break;
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;
}
$dispclass = get_user_class_name($arr['class']);
$donator = $arr['donated'] > 0;
$warned = $arr['warned'] === 'yes';
if ($donator)
$activeusers .= '';
if ($warned)
$activeusers .= '';
if ($CURUSER)
$activeusers .= '' . $arr['username'] . '';
else
$activeusers .= ''.$arr['username'].'';
if ($invisible = $arr['invisible'] === 'yes')
$activeusers .= '+';
if ($donator)
$activeusers .= 'global['imgdonated'].'\'>';
if ($warned)
$activeusers .= 'global['imgwarned'].'\'>';
}
if (!$activeusers)
$activeusers = $lang->index['noactiveusersonline'];
}
stdhead(sprintf($lang->index['welcome'], $SITENAME));
print('
');
?>
Radio TorrentFlame.org
if (($showshoutbox == 'yes' AND $CURUSER) OR ($showshoutbox == 'staffonly' AND get_user_class() >= UC_MODERATOR)) {
print("
".$lang->index['shoutbox']."
");
print("
\n");
print("
');
}
print('
'.$lang->index['recentnews']);
if (get_user_class() >= UC_ADMINISTRATOR)
print(' - ['.$lang->index['newspage'].']');
print('
');
$res = sql_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('