<?
require_once("backend/functions.php");
dbconn();
if ($CURUSER["class"] < "2"){
show_error_msg("Sorry...", "You must be a Crazy Seeder or above to play Chance Ace.");
}
$playprice = 100*1024*1024;
$minorprize = 50*1024*1024;
$clubsmb = 200*1024*1024;
$diamondsmb = 350*1024*1024;
$heartsmb = 500*1024*1024;
$spadesmb = 1000*1024*1024;
if ($_POST["bet"]){
if ($CURUSER["uploaded"] < "$playprice")
show_error_msg("Sorry ".$CURUSER["username"],"You haven't uploaded ".mksize($playprice)." yet.");
stdhead("Chance Ace");
begin_frame("Chance Ace");
print("<center><h1><img src=/images/chanceace/chanceace.gif></h1></center>\n");
print("<center><h2>Welcome, <a href=userdetails.php?id=$CURUSER[id]>$CURUSER[username]</a>!</h2></center>\n");
$aceofclubs .= "<img src=images/chanceace/aceofclubs.gif> ";
$aceofdiamonds .= "<img src=images/chanceace/aceofdiamonds.gif> ";
$aceofhearts .= "<img src=images/chanceace/aceofhearts.gif> ";
$aceofspades .= "<img src=images/chanceace/aceofspades.gif> ";
$frstspot = "";
$scndspot = "";
$thrdspot = "";
// Random
$frstno = rand (1, 50);
$scndno = rand (1, 50);
$thrdno = rand (1, 50);
// Image results
// FIRST
if (($frstno >= 1) && ($frstno <= 20)){
$frstspot = $aceofclubs;
$aceofclubscount++;
}
if (($frstno >= 21) && ($frstno <= 35)){
$frstspot = $aceofdiamonds;
$aceofdiamondscount++;
}
if (($frstno >= 36) && ($frstno <= 45)){
$frstspot = $aceofhearts;
$aceofheartscount++;
}
if (($frstno >= 46) && ($frstno <= 50)){
$frstspot = $aceofspades;
$starcount++;
}
// SECOND
if (($scndno >= 1) && ($scndno <= 20)){
$scndspot = $aceofclubs;
$aceofclubscount++;
}
if (($scndno >= 21) && ($scndno <= 35)){
$scndspot = $aceofdiamonds;
$aceofdiamondscount++;
}
if (($scndno >= 36) && ($scndno <= 45)){
$scndspot = $aceofhearts;
$aceofheartscount++;
}
if (($scndno >= 46) && ($scndno <= 50)){
$scndspot = $aceofspades;
$starcount++;
}
// THIRD
if (($thrdno >= 1) && ($thrdno <= 20)){
$thrdspot = $aceofclubs;
$aceofclubscount++;
}
if (($thrdno >= 21) && ($thrdno <= 35)){
$thrdspot = $aceofdiamonds;
$aceofdiamondscount++;
}
if (($thrdno >= 36) && ($thrdno <= 45)){
$thrdspot = $aceofhearts;
$aceofheartscount++;
}
if (($thrdno >= 46) && ($thrdno <= 50)){
$thrdspot = $aceofspades;
$starcount++;
}
// END Image results
// Adds to the pool for every play.
if ($aceofclubscount == 3){
$rslt = "<br><center><b>Congratulations! You hit 3 Ace of clubs in a row. You won " .mksize($clubsmb);
mysqli_query("UPDATE users SET uploaded = uploaded + $clubsmb WHERE id=$CURUSER[id]");
}else{
if ($aceofdiamondscount == 3){
$rslt = "<br><center><b>Congratulations! You hit 3 Ace of diamonds in a row. You won " .mksize($diamondsmb);
mysqli_query("UPDATE user SET uploaded = uploaded + $diamondsmb WHERE id=$CURUSER[id]");
}else{
if ($aceofheartscount == 3){
$rslt = "<br><center><b>Congratulations! You hit 3 Ace of hearts in a row. You won " .mksize($heartsmb);
mysqli_query("UPDATE users SET uploaded = uploaded + $heartsmb WHERE id=$CURUSER[id]");
}else{
if ($aceofspadescount == 3){
$rslt = "<br><center><b>Congratulations! You hit 3 Ace of spades in a row. You won " .mksize($spadesmb);
mysqli_query("UPDATE users SET uploaded = uploaded + $spadesmb WHERE id=$CURUSER[id]");
}else{
if ($minorprize != 0){
if (($aceofclubscount == 2) || ($aceofdiamondscount == 2) || ($aceofheartscount == 2) || ($starcount == 2));
$rslt = "<br><center><b>Well, you didnt match them all but you got 2 of the same suit, so I will give you " .mksize($minorprize);
mysqli_query("UPDATE users SET uploaded = uploaded + $minorprize - $playprice WHERE id=$CURUSER[id]");
}else{
if (($aceofclubscount == 4) || ($aceofdiamondscount == 4) || ($aceofheartscount == 4) || ($starcount == 4));{
$rslt = "<center><b>Sorry, you didnt win. You missed them all</b></center>";
mysqli_query("UPDATE users SET uploaded = uploaded - $playprice WHERE id=$CURUSER[id]");
}
}
}
}
}
}
// Show table
print("<br><div align=center>\n");
print("<table class=forumline width=300><tr>\n");
print("<td width=33%><center>$frstspot $scndspot $thrdspot</center></td></tr>\n");
print("</table></center></div>\n");
print("<div align=center><table class=forumline width=300><tr><td class=Catbottom width=100%>$rslt</td>\n");
print("</tr></table></center></div><br>\n");
print("<br><div align=center>\n");
print("<table class=forumline width=300>\n");
print("<tr><td class=row1 width=100%><br><center><form method=POST><input type=submit value=Play ChanceAce name=bet class=button></form></center><br></td></tr>\n");
print("</table>\n");
end_frame();
stdfoot();
}else{
// Start screen - Not currently playing a game
stdhead("Chance Ace");
begin_frame("Chance Ace");
print("<h1><center><img src=/images/chanceace/chanceace.gif></center></h1>\n");
print("<br>\n");
print("<center><img src=images/chanceace/aces1.jpg width=114 height=95 border=0></center>\n");
print("<br>\n");
print("<center><font color=red size=4>3 x <img src=images/chanceace/aceofclubs.gif width=50 height=50 border=0> = 200MB</center></font>\n");
print("<br>\n");
print("<center><font color=red size=4>3 x <img src=images/chanceace/aceofdiamonds.gif width=50 height=50 border=0> = 350MB</center></font>\n");
print("<br>\n");
print("<center><font color=red size=4>3 x <img src=images/chanceace/aceofhearts.gif width=50 height=50 border=0> = 500MB</center></font>\n");
print("<br>\n");
print("<center><font color=red size=4>3 x <img src=images/chanceace/aceofspades.gif width=50 height=50 border=0> = 1GB</center></font>\n");
print("<br>\n");
print("<center><font color=red size=4>Two of the same suit gives you 50MB</center></font>\n");
print("<br>\n");
print("<br>\n");
print("<center><b>NOTE:</b> By playing Chance Ace, you are betting 100 MB of upload credit!</center>\n");
print("<br>\n");
print("<center><form name=form method=post action=$phpself><input type=hidden name=bet value=bet><input type=submit class=btn value='Start!'></a></center>\n");
end_frame();
stdfoot();
}
?>ALTER TABLE `groups` ADD `maxslots` int(10) NOT NULL DEFAULT '0';print("<td class=table_head>Download</td>\n");print("<td class=table_head>Download Slots</td>\n");print("<td class=table_col1>".$level["can_download"]."</td>\n");print("<td class=table_col1>".$level["maxslots"]."</td>\n");<tr><td>Can Download:</td><td> <?php echo YES;?> <input type="radio" name="down" value="yes" <?php if ($level["can_download"]=="yes") echo "checked" ?> /> <?php echo NO;?> <input type="radio" name="down" value="no" <?php if ($level["can_download"]=="no") echo "checked" ?> /></td></tr><tr><td>Download Slots:</td><td><input type="text" name="downslots" value="<?php echo number_format($level["maxslots"]);?>" size="40" /></td></tr>$update[]="control_panel='".$_POST["admincp"]."'";if (is_valid_id($_POST["downslots"]))
$update[]="maxslots='".$_POST["downslots"]."'"; $update[]="control_panel='".$level["control_panel"]."'";$update[]="maxslots='".$level["maxslots"]."'";// FILL $SELF WITH DETAILS FROM PEERS TABLE (CONNECTING PEERS DETAILS)
if (!isset($self)){if ($MEMBERSONLY){
$query = @mysql_fetch_row(@mysql_query("SELECT COUNT(DISTINCT torrent) FROM `peers` WHERE `userid` = '$userid' AND `seeder`='no'"));
$queries = mysql_query("SELECT `maxslots` FROM `groups` WHERE `group_id` = $user[class]");
$row = mysql_fetch_array($queries);
$maxslot = $row[0];
if ($query[0] >= $maxslot)
err("Maximum Slot exceeded! You may only download $maxslot torrent at a time.");
}$userratio = "---";$query = @mysql_fetch_row(@mysql_query("SELECT COUNT(DISTINCT torrent) FROM peers WHERE userid = $CURUSER[id] AND seeder='no'"));
$slots = number_format($CURUSER["maxslots"]) . "/" . number_format($query[0]);$userratio<BR>Download Slots: $slots