TBDev Forum
Programming board
Main Page Forum Rules Privacy Policy Members Contact Us
Welcome Guest (Login | Register)
TBDev Forum TBDev.net - Mods & hacks Mods Complete & working Addon Mods Torrent Arcade
Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Torrent Arcade

2007-07-13 01:22:00
Group: Member
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("
");
print("

Recent news");
if (get_user_class() >= UC_ADMINISTRATOR)
print(" - [News page]");
if (get_user_class() >= UC_USER)
print(" - Fire Fox Users Click - HERE");
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
    ");
    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("
\n");
}

$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 .= "Donated {$$arr["donor"]}
";
if ($warned)
$activeusers .= "Warned {$$arr["warned"]}";
}
if (!$activeusers)
$activeusers = "There have been no active users in the last 15 minutes.";

/*

Active users



=$activeusers?>

*/ ?>
















latestforumposts(); ?>





if ($CURUSER) { ?>

ShoutBox











Message:


refresh
























}?>


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("
");
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);
if ($i % 2)
$c = "";
else
$c = " bgcolor=#ECE9D8";
print("\n");
++$i;
}
print("
" . $a[1] . " " .
" $p%
\n");
$tvotes = number_format($tvotes);
print("

Votes: $tvotes

\n");
}
else
{
print("
\n");
$i = 0;
while ($a = $o[$i])
{
print("$a
\n");
++$i;
}
print("
");
print("Blank vote (a.k.a. \"I just want to see the results!\")
\n");
print("

");
}
?>


if ($voted)
print("

Previous polls

\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"]}
";
if ($warned)
$activeusers24 .= "Warned {$$arr["warned"]}";
}

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?>








Users Online (=$totalonline?>):




=$activeusers?>



Latest User: =$latestuser?>.



color=#8B008B>Sysops - color=#556B2F>Administrator - color=#BF3EFF>Moderator - color=#8B0000>Uploader - color=#483D8B>VIP - color=#00CED1>Power User - color=black>User






Stats







Online Since=$config['onlinesince']?>
User Info



print("\n");
print("\n");
print("\n");
print("\n");
print("\n");
?>
" . REGISTEREDUSERS . " $registered
Banned Users $banned
Warned Users $warn
Donors $donors
Total Donations $$totaldonated



print("
Torrent Info
\n"); ?>


print("\n");
print("\n");
print("\n");
print("\n");; ?>
" . TORRENTS . " $torrents
Peers $peers
Seeders $seeders
Leechers $leechers




print("
Registration Month Chart
\n");
echo '';
$res = mysql_query('SELECT RPAD(added,'.(isset($month) ? '10':'7').',"") AS date,COUNT(RPAD(added,'.(isset($month) ? '10':'7').',"")) AS count FROM users '.(isset($month) ?
'WHERE status = confirmed AND added LIKE "'.$month.'-%" ':'').' GROUP BY date ORDER BY date DESC');
while($users = mysql_fetch_assoc($res))
{
echo '';
}
echo '
'.(isset($month) ? 'Day':'Month').'Users
'.$users['date'].''.$users['count'].'
';





?>



/*

Server load




$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("$percent%"); ?>



*/ ?>




Disclaimer






echo "";
?>


Disclaimer: None of the files shown here are actually hosted on this server.
The links are provided solely by this site's users. The administrator of this site cannot be held responsible for what its
users post, or any other actions of its users. 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.




















stdfoot();

hit_end();
?>
 
2007-07-13 06:04:00
Group: Member
Posts: 95
Topics participated: 68
Topics started: 1
First post: 2007-05-05 23:02:00
Last post: 2009-01-01 00:17:00
Carphunter18 what more can I say

I Thank you

My children Thank You

My childrens children Thank You

You get the idea - many thanks, now I wont pull out anymore hair - which I am sadly lacking

;)
 
2007-07-13 10:52:00
Group: Member
Posts: 117
Topics participated: 54
Topics started: 5
First post: 2007-06-17 23:35:00
Last post: 2008-12-28 11:44:00
No problem ;)
 
2007-07-22 18:55:00
Group: Member
Posts: 65
Topics participated: 36
Topics started: 16
First post: 2007-06-18 11:17:00
Last post: 2008-06-01 20:47:00
AnyBody Can Please insert Link to download Flash Games???
rapidshare not work!!!! Please!!!
 
2007-07-26 15:37:00
Group: Member
Posts: 408
Topics participated: 196
Topics started: 62
First post: 2007-02-09 20:22:00
Last post: 2008-12-05 15:57:00
i put this in games play fine.. it says its updating the scores but it doesnt the game just seems to stick at the end... got no errors on any page... the index part is in fine to..any ideas?


thanks
 
2007-07-26 15:44:00
Group: Member
Posts: 194
Topics participated: 58
Topics started: 8
First post: 2006-11-11 07:31:00
Last post: 2008-03-29 15:45:00
AnyBody Can Please insert Link to download Flash Games???
rapidshare not work!!!! Please!!!



Here you go

 
2007-07-26 15:54:00
Group: Member
Posts: 65
Topics participated: 36
Topics started: 16
First post: 2007-06-18 11:17:00
Last post: 2008-06-01 20:47:00
Thanks!!! :)
 
2007-07-26 15:58:00
Group: Member
Posts: 194
Topics participated: 58
Topics started: 8
First post: 2006-11-11 07:31:00
Last post: 2008-03-29 15:45:00
np
 
2007-07-26 16:15:00
Group: Member
Posts: 408
Topics participated: 196
Topics started: 62
First post: 2007-02-09 20:22:00
Last post: 2008-12-05 15:57:00
ty HoBoZ... those games seem to ov fixed it... i got the games from another source :)
 
2007-07-26 16:21:00
Group: Member
Posts: 194
Topics participated: 58
Topics started: 8
First post: 2006-11-11 07:31:00
Last post: 2008-03-29 15:45:00
nice :)

the high score function is hard coded into the swf files.
at least that is what i have been told.

Cheers,
HoBoZ
 

Similar threads

Topic Posts Last post
Torrent Arcade MOD (REVAMP) 1 2008-12-22 12:29:00
Arcade 21 2006-09-08 13:52:00
arcade error 1 2008-05-27 16:08:00
flash arcade fix??? 1 2007-04-27 00:00:00
Auto pm torrent owner upon torrent delete 19 2007-10-21 17:14:00