ob_start("ob_gzhandler");
require "include/bittorrent.php";
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$choice = $_POST["choice"];
if ($CURUSER && $choice != "" && $choice < 256 && $choice == floor($choice))
{
$res = 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"];
$res = mysql_query("SELECT * FROM pollanswers WHERE pollid=$pollid && userid=$userid") or sqlerr();
$arr = mysql_fetch_assoc($res);
if ($arr) die("Dupe vote");
mysql_query("INSERT INTO pollanswers VALUES(0, $pollid, $userid, $choice)") or sqlerr();
if (mysql_affected_rows() != 1)
stderr("Error", "An error occured. Your vote has not been counted.");
header("Location: $BASEURL/");
die;
}
else
stderr("Error", "Please select an option.");
}
$a = @mysql_fetch_assoc(@mysql_query("SELECT id,username FROM users WHERE status='confirmed' ORDER BY id DESC LIMIT 1"));
if ($CURUSER)
$latestuser = "" . $a["username"] . " ";
else
$latestuser = $a['username'];
$registered = number_format(get_row_count("users"));
$unverified = number_format(get_row_count("users", "WHERE status='pending'"));
$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'");
$result = mysql_query("SELECT SUM(downloaded) AS totaldl, SUM(uploaded) AS totalul FROM users") or sqlerr(__FILE__, __LINE__);
$row = mysql_fetch_assoc($result);
$totaldownloaded = mksize($row["totaldl"]);
$totaluploaded = mksize($row["totalul"]);
$seeders = $seeders;
$leechers = $leechers;
$peers = number_format($leechers + $seeders);
if ($seeders == "0") { $ratio = "0"; }
elseif ($leechers == "0") { $ratio = "0"; }
else {
$ratio = round($seeders / $leechers * 100);
}
$seeders = number_format($seeders);
$leechers = number_format($leechers);
#$peers = number_format($leechers + $seeders);
$USERS = number_format(get_row_count("users", "WHERE class='0'"));
$poweruser = number_format(get_row_count("users", "WHERE class='16'"));
$Moderator = number_format(get_row_count("users", "WHERE class = '64'"));
$ADMINISTRATOR = number_format(get_row_count("users", "WHERE class = '80'"));
$sysop = number_format(get_row_count("users", "WHERE class = '96'"));
$warnedu = number_format(get_row_count("users", "WHERE warned='yes'"));
$disabled = number_format(get_row_count("users", "WHERE enabled='no'"));
$VIP = number_format(get_row_count("users", "WHERE class='32'"));
stdhead();
//echo "Welcome to our newest member, $latestuser ! \n";
$news_title = "Recent news";
print("
");
//print("Recent news");
if (get_user_class() >= UC_ADMINISTRATOR)
$news_title.=" - [" .SITENEWS. " ] ";
//print(" \n");
$res = mysql_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("\n");
begin_frame($news_title,false,5);
print("");
while($array = mysql_fetch_array($res))
{
print("" . gmdate("Y-m-d",strtotime($array['added'])) . " - " . $array['body']);
if (get_user_class() >= UC_ADMINISTRATOR)
{
print(" [E ] ");
print(" [D ] ");
}
print(" ");
}
print(" ");
end_frame();
//print("
\n");
}
if ($CURUSER)
{
?>
function quickbbshout(){
echo "";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " ";
echo "
COLOR
sky blue
royal blue
blue
dark-blue
orange
orange-red
crimson
red
firebrick
dark red
green
limegreen
sea-green
deeppink
tomato
coral
purple
indigo
burlywood
sandy brown
sienna
chocolate
teal
silver
";
echo "
FONT
Arial
Comic
Courier New
Tahoma
Times New Roman
Verdana
";
echo "
Size
1
2
3
4
5
6
7
";
echo "
";
}
?>
Actualiser Historique Smilies
Poll");
$poll_title = "" .SITEPOLL. "";
if (get_user_class() >= UC_MODERATOR)
{
$poll_title.="";
$poll_title.=" - [" .SITEPOLL_NEW. " ]\n";
if($pollok) {
$poll_title.=" - [" .SITEPOLL_EDIT. " ]\n";
$poll_title.=" - [" .SITEPOLL_DEL. " ]";
}
$poll_title.=" ";
}
//print("\n");
if($pollok) {
//print("\n");
begin_frame($poll_title,false,5);
print("");
print("$question
\n");
$voted = $arr2;
if ($voted)
{
// display results
if ($arr["selection"])
$uservote = $arr["selection"];
else
$uservote = -1;
// we reserve 255 for blank vote.
$res = mysql_query("SELECT selection FROM pollanswers WHERE pollid=$pollid AND selection < 20") or sqlerr();
$tvotes = mysql_num_rows($res);
$vs = array(); // array of
$os = array();
// Count votes
while ($arr2 = mysql_fetch_row($res))
$vs[$arr2[0]] += 1;
reset($o);
for ($i = 0; $i < count($o); ++$i)
if ($o[$i])
$os[$i] = array($vs[$i], $o[$i]);
function srt($a,$b)
{
if ($a[0] > $b[0]) return -1;
if ($a[0] < $b[0]) return 1;
return 0;
}
// now os is an array like this: array(array(123, "Option 1"), array(45, "Option 2"))
if ($arr["sort"] == "yes")
usort($os, srt);
print("\n");
$i = 0;
while ($a = $os[$i])
{
if ($i == $uservote)
$a[1] .= " *";
if ($tvotes == 0)
$p = 0;
else
$p = round($a[0] / $tvotes * 100);
$nn = $a[0];
if ($i % 2)
$c = "";
else
$c = "";
print("" . $a[1] . " " .
" $p% ($nn) \n");
++$i;
}
print("
\n");
$tvotes = number_format($tvotes);
print("" .SITE_VOTES. " : $tvotes
\n");
}
else
{
print("");
}
?>
if ($voted)
print("" .PRE_POLLS. "
\n");
end_frame();
?>
} else {
begin_frame($poll_title,false,5);?>
end_frame();
}
}
?>
if (isset($peers)) { ?>
} ?>
Users
Power Users
VIP's
Moderateur
Adminstrateur
Sysop
Membres bloqués
Membres avertis
if (get_user_class() >= UC_MODERATOR)
{
begin_frame("" .SERVER_LOAD. "",true,5);?>
$percent = min(100, round(exec('ps ax | grep -c apache') / 256 * 100));
if ($percent <= 70) $pic = "loadbargreen.gif";
elseif ($percent <= 90) $pic = "loadbaryellow.gif";
else $pic = "loadbarred.gif";
$width = $percent * 4;
print(" "); ?>
// ---- online users
$dt = gmtime() - 300;
$dt = sqlesc(get_date_time($dt));
$numberactive = number_format(get_row_count("users", "WHERE last_access >=$dt"));
$res = mysql_query("SELECT id, username, class, warned, donor FROM users WHERE last_access >=$dt ORDER BY class DESC") or print(mysql_error());
while ($arr = mysql_fetch_assoc($res))
{
if ($activeusers) $activeusers .= ",\n";
switch ($arr["class"])
{
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;
case UC_USER:
$arr["username"] = "" . $arr["username"] . "";
break;
}
if ($arr["donor"] == "yes") $star = " ";
else $star = "";
if ($arr["warned"] == "yes") $warn = " ";
else $warn = "";
$donator = $arr["donated"] > 0;
if ($donator)
$activeusers .= "";
$activeusers .= "" . $arr["username"] . $star . $warn . "";
if ($donator)
$activeusers .= "";
}
if (!$activeusers)
$activeusers = "There have been no active users in the last 15 minutes.";
?>
begin_frame("" .SITEUSER_ONLINE. "(".$numberactive.")",false,5) ?>
begin_table(true);
echo "";
echo $activeusers;
echo " ";
end_table();
?>
|
|
|
|
| User
echo "" .WELCOME_NEW. " $latestuser ! \n";
end_frame ();
// -------------------------------
?>
begin_frame("!! Bon Anniversaire !! aujourd'hui à :",false,5) ?>
#begin_table(true);
///////////////// BIRTHDAY MOD /////////////////////
$b = 0;
//print("Today's Birthdays ");
#echo "";
$currentdate = date("Y-m-d", time());
list($year1, $month1, $day1) = split('-', $currentdate);
$res2 = mysql_query("SELECT birthday, id, username FROM users WHERE birthday != '0000-00-00'") or sqlerr();
while ($arr2 = mysql_fetch_assoc($res2))
{
$birthday = date($arr2["birthday"]);
$username = $arr2["username"];
$id = $arr2["id"];
list($year2, $month2, $day2) = split('-', $birthday);
if($month1 < $month2){
$age = $year1 - $year2 - 1;
}
if($month1 == $month2){
if($day1 < $day2){
$age = $year1 - $year2 - 1;
}else{
$age = $year1 - $year2;
}
}
if($month1 > $month2){
$age = $year1 - $year2;
}
if (($month1 == $month2) && ($day1 == $day2))
{
if ($b > 0)
print(", ");
#echo " ";
print("$username ");
print("($age)");
$b = $b + 1;
}
}
if ($b == 0)
print("Aucun");
#print(" ");
///////////////// BIRTHDAY MOD /////////////////////
#end_table();
end_frame ();
?>
echo DISCLAIMER_INDEX_FOOTER ?>
stdfoot();
?>