| carphunter18 | 2007-07-13 01:22:00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() Posts: 117 Topics participated: 54 Topics started: 5 First post: 2007-06-17 23:35:00 Last post: 2008-12-28 11:44:00 |
Try this fireknight ob_start("ob_gzhandler"); require "include/bittorrent.php"; require "rconpasswords.php"; dbconn(true); if ($HTTP_SERVER_VARS["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: $DEFAULTBASEURL/"); die; } else{ $user = $CURUSER['id']; if($_GET["act"]=="Arcade") { if($_POST['gname'] == "asteroids") { $game = 1; $level = 1; $score = $_POST['score']; } if($_POST['gname'] == "breakout") { $game = 2; $level = 1; $score = $_POST['gscore']; } if($_POST['gname'] == "hexxagon") { $game = 3; $level = 1; $score = $_POST['gscore']; } if($_POST['gname'] == "invaders") { $game = 4; $level = 1; $score = $_POST['score']; } if($_POST['gname'] == "moonlander") { $game = 5; $level = 1; $score = $_POST['gscore']; } if($_POST['gname'] == "pacman") { $game = 6; $level = 1; $score = $_POST['gscore']; } if($_POST['gname'] == "psol") { $game = 7; $level = 1; $score = $_POST['gscore']; } if($_POST['gname'] == "simon") { $game = 8; $level = 1; $score = $_POST['gscore']; } if($_POST['gname'] == "snake") { $game = 9; if($_POST['levelName'] == "LEVEL: SLUG") { $level = 1; } if($_POST['levelName'] == "LEVEL: WORM") { $level = 2; } if($_POST['levelName'] == "LEVEL: PYTHON") { $level = 3; } $score = $_POST['score']; } if($_POST['gname'] == "tetris") { $game = 10; $level = $_POST['level']; $score = $_POST['gscore']; } mysql_query("INSERT INTO `flashscores` ( `ID` , `game` , `user` , `level` , `score` ) VALUES ( '', '".$game."', '".$user."', '".$level."', '".$score."');") OR DIE(MySQL_ERROR()); $url="flashscores.php"; print("\n"); }else{ stderr("Error", "An error occured."); } } } /* 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")) or die(mysql_error()); 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'")); $r = mysql_query("SELECT value_u FROM avps WHERE arg='seeders'") or sqlerr(__FILE__, __LINE__); $a = mysql_fetch_row($r); $seeders = 0 + $a[0]; $r = mysql_query("SELECT value_u FROM avps WHERE arg='leechers'") or sqlerr(__FILE__, __LINE__); $a = mysql_fetch_row($r); $leechers = 0 + $a[0]; if ($leechers == 0) $ratio = 0; else $ratio = round($seeders / $leechers * 100); $peers = number_format($seeders + $leechers); $seeders = number_format($seeders); $leechers = number_format($leechers); $result = mysql_query("SELECT SUM(downloaded) AS totaldl, SUM(uploaded) AS totalul FROM users") or sqlerr(__FILE__, __LINE__); $row = mysql_fetch_assoc($result); $totaldownloaded = $row["totaldl"]; $totaluploaded = $row["totalul"]; /* */ stdhead(); echo "Welcome to our newest member, $latestuser!\n"; print("
} $dt = gmtime() - 180; $dt = sqlesc(get_date_time($dt)); $result = mysql_query("SELECT SUM(last_access >= $dt) AS totalol FROM users") or sqlerr(__FILE__, __LINE__); while ($row = mysql_fetch_array ($result)) { $totalonline = $row["totalol"]; } $dt = gmtime() - 180; $dt = sqlesc(get_date_time($dt)); $res = mysql_query("SELECT id, username, class, donor, warned FROM users WHERE last_access >= $dt ORDER BY username") or print(mysql_error()); while ($arr = mysql_fetch_assoc($res)) { if ($activeusers) $activeusers .= ",\n"; switch ($arr["class"]) { case UC_OWNER: $arr["username"] = "" . $arr["username"] . ""; break; case UC_GUARDIAN: $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; } $donator = $arr["donor"] === "yes"; if ($donator) $activeusers .= " $warned = $arr["warned"] === "yes"; if ($warned) $activeusers .= " if ($CURUSER) $activeusers .= "{$arr["username"]}"; else $activeusers .= "{$arr["username"]}"; if ($donator) $activeusers .= " ![]() if ($warned) $activeusers .= " ![]() } if (!$activeusers) $activeusers = "There have been no active users in the last 15 minutes."; /* Active users
*/ ?>
if ($CURUSER) { ?>
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}?>
if ($CURUSER)
{
// Get current poll
$res = mysql_query("SELECT * FROM polls ORDER BY added DESC LIMIT 1") or sqlerr();
if( $arr = mysql_fetch_assoc($res) )
{
$pollid = $arr["id"];
$userid = $CURUSER["id"];
$question = $arr["question"];
$o = array($arr["option0"], $arr["option1"], $arr["option2"], $arr["option3"], $arr["option4"],
$arr["option5"], $arr["option6"], $arr["option7"], $arr["option8"], $arr["option9"],
$arr["option10"], $arr["option11"], $arr["option12"], $arr["option13"], $arr["option14"],
$arr["option15"], $arr["option16"], $arr["option17"], $arr["option18"], $arr["option19"]);
// Check if user has already voted
$res = mysql_query("SELECT * FROM pollanswers WHERE pollid=$pollid && userid=$userid") or sqlerr();
$arr2 = mysql_fetch_assoc($res);
print("
Poll");
if (get_user_class() >= UC_MODERATOR)
{
print("");
print(" - [New]\n");
print(" - [Edit]\n");
print(" - [Delete]");
print("");
}
print("
\n");print("
| \n"); print("
if ($voted) print("\n"); ?> |
}
else
{
if (get_user_class() >= UC_MODERATOR)
{
print("Poll");
print("");
print(" - [New]\n");
print(" - [Edit]\n");
print(" - [Delete]");
print("");
}
}
}
////Last 24 Hour Online By Sparks////
$dt24 = gmtime() - 86400;
$arr = mysql_fetch_assoc(mysql_query("SELECT * FROM avps WHERE arg='last24'")) or $no24=true;
$res=mysql_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"));
mysql_query(($no24 ? 'INSERT':'UPDATE'). " avps SET value_s = '0', value_i = $last24 , value_u = $period ". ($no24 ? ", arg='last24'":"WHERE arg='last24'")) or sqlerr();
}
// Colors correspond to user class, first position UC_USER = 0, and so on
// Add as necessary. Note: UC_USER class gets a null for no color change.
$colors= array(null,'00CED1','483D8B','8B0000','BF3EFF','556B2F','8B008B','FFB90F','006400');
while ($arr = mysql_fetch_assoc($res))
{
if ($activeusers24) $activeusers24 .= "\n";
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 ($donator)
$activeusers24 .= "
![Donated {$$arr["donor"]}]({$pic_base_url}star16.gif)
if ($warned)
$activeusers24 .= "
![Warned {$$arr["warned"]}]({$pic_base_url}warned.gif)
}
if (!$activeusers24)
$activeusers24 = "There have been no active users in the last 24 hours.";
//===end first part
//=== last 24 hours on line second part
?>
=$totalonline24?> Member=$_ss24?> visited during the last 24 hours |
| =$activeusers24?> |
Most ever visited in 24 hours was =$last24?> Member=$_ss24?> on =$last24record?> |
Stats
Similar threads
Statistics
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

![Donated {$$arr["donor"]}]({$pic_base_url}star.gif)

$p%








