-BRAIDZ-
Members-
Posts
403 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by -BRAIDZ-
-
Huh? I mean so when someone loads my game on a mobile device, it loads in like a mobile site? And you do have to zoom in constantly to see what you're doing
-
Got it working now.. Umm just a quick question? How can I get my game to support mobile devices?
-
All the $h->endpage(); Functions have been removed.. So do I need the die; functions or not?.. Sorry I didn't quite understand that...
-
I always use INT(11) or BIGINT(25) depending on what for, the mod is now working, I removed the quotation marks, and didn't add in any back ticks, works fine now... And removed the endpage function (because [MENTION=67703]adamhull[/MENTION]) said it is not needed...
-
All of the queries, they aren't working, they wont put anything into the database....
-
Thanks, but I did not ask for any criticism. I know my coding is horrible, and I use the mysql_real_escape_string() because the whole RC Engine does.. Now what I did ask, was about my queries, where am I stuffing up with them for them not to work?
-
Here it is, converted for RC Engine. I only have one problem with though, the mod it self is fully functioning, its just the queries are not working.. Not too sure where I have gone wrong, but I have been trying to get them working for ages now. Also, I have taken out the item use (drink) functions for RC and will be creating new items for RC Engine for this mod, so there will be different item numbers.. And will be coding them into itemuse.php The changes to the sql table: ALTER TABLE members ADD brew INT(11) NOT NULL DEFAULT 0; ALTER TABLE members ADD brew_time INT(11) NOT NULL DEFAULT 0; ALTER TABLE members ADD brewed_beer INT(11) NOT NULL DEFAULT 0; ALTER TABLE members ADD brewed_whiskey INT(11) NOT NULL DEFAULT 0; ALTER TABLE members ADD brewed_cider INT(11) NOT NULL DEFAULT 0; ALTER TABLE members ADD brewed_vodka INT(11) NOT NULL DEFAULT 0; Converted code: <?php /*------------includes--------------*/ include('./includes/connections.php'); include('./includes/brain_file.php'); include('./includes/style_top.php'); /*------------includes--------------*/ if ($pl['my_jail'] > gmtime() || $pl['my_hosp'] > gmtime()) { echo "Sorry this page is not viewable while in jail or hospital!<hr width='75%'/>"; include('./includes/style_bottom.php'); exit(); } if ($pl['brew_time']) { die("You can't brew for another {$pl['brew_time']} minutes, when your current batch finishes."); } if ($pl['brew'] == '15') { echo 'You have already brewed 15 times today, come back tomorrow'; $h->endpage(); die; } $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch ($_GET['action']) { case 'beer': brew_beer(); break; case 'drinkbeer': drink_beer(); break; case 'brewbeer': brew_beer_sub(); break; case 'whiskey': brew_whiskey(); break; case 'cider': brew_cider(); break; case 'brewcider': brew_cider_sub(); break; case 'brewwhiskey': brew_whiskey_sub(); break; case 'collectbeer': collect_beer(); break; case 'beercollected': beer_collected(); break; case 'collectwhiskey': collect_whiskey(); break; case 'collectcider': collect_cider(); break; case 'whiskeycollected': whiskey_collected(); break; case 'cidercollected': cider_collected(); break; case 'drinkwhiskey': drink_whiskey(); break; case 'drinkcider': drink_cider(); break; case 'vodka': brew_vodka(); break; case 'brewvodka': brew_vodka_sub(); break; case 'collectvodka': collect_vodka(); break; case 'vodkacollected': vodka_collected(); break; case 'drinkvodka': drink_vodka(); break; default: brewery(); break; } function brewery() { echo "<center><main>Brewery</main><hr width='95%'/>"; echo " You can brew alcohol 15 times a day. </br>What would you like to brew?</br>"; echo "<hr width = '750px'>"; echo round_table('750px'); echo " <table class='vnm-table' width='100%' cellspacing='1' cellpadding='4' align='left'> <th align='center' width = '10%'>Options</th> <th align='left' width = '1.5%'>Brew?</th></tr> </tr> <tr> <td>Beer</td> <td> <a href='brewery.php?action=beer''>Go</a> </td> </tr> <tr> <td>Whiskey</td> <td> <a href='brewery.php?action=whiskey'>Go</a> </td> </tr> </tr> <tr> <td>Cider</td> <td> <a href='brewery.php?action=cider'>Go</a> </td> </tr> </tr> <tr> <td>Vodka</td> <td> <a href='brewery.php?action=vodka'>Go</a> </td> </tr> </table> </br> "; echo " <table class='vnm-table' width='100%' cellspacing='1' cellpadding='4' align='left'> <th align='center' width = '9%'>Collect Alcohol</th> <th align='left' width = '1%'>Collect?</th></tr> </tr> <tr> <td>Beer</td> <td> <a href='brewery.php?action=collectbeer'>Go</a> </td> </tr> <tr> <td>Whiskey</td> <td> <a href='brewery.php?action=collectwhiskey'>Go</a> </td> </tr> </tr> <tr> <td>Cider</td> <td> <a href='brewery.php?action=collectcider'>Go</a> </td> </tr> </tr> <tr> <td>Vodka</td> <td> <a href='brewery.php?action=collectvodka'>Go</a> </td> </tr> </td></tr></table>"; echo " </br> <table class='vnm-table' width='100%' cellspacing='1' cellpadding='4' align='left'> <th align='center' width = '10%'>Ready For Collection</th> <th align='left' width = '1%'>Amount?</th></tr> </tr> <tr> <td>Beer</td> <td><font color ='green'>" . number_format($pl["brewed_beer"]) . " Bottles</font></td> </tr> <tr> <td>Whiskey</td> <td><font color ='green'>" . number_format($pl["brewed_whiskey"]) . " Bottles</font></td> </tr> </tr> <tr> <td>Cider</td> <td><font color ='green'>" . number_format($pl["brewed_cider"]) . " Bottles</font></td> </tr> </tr> <tr> <td>Vodka</td> <td><font color ='green'>" . number_format($pl["brewed_vodka"]) . " Bottles</font></td> </tr> </td></tr></table>"; echo end_round(); } function brew_beer() { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "<hr width = '750px'>"; echo round_table('750px'); echo " <table class='vnm-table' width='100%' cellspacing='1' cellpadding='4' align='left'> <th align='center' width = '100%'>Beer Information</th> </tr> <tr> <td>Time to brew Beer? </br> 6 Minutes</td> </tr> <tr> <td>Cost to brew Beer? </br> $25,000</td> </tr> <td>What does Beer do? </br> Not Sure Yet</td> </tr> </table> <form method='post' action='brewery.php?action=brewbeer'> <input type='submit' name='brewbeer' value='Brew Beer' /> </form>"; echo end_round(); } function brew_whiskey() { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "<hr width = '750px'>"; echo round_table('750px'); echo " <table class='vnm-table' width='100%' cellspacing='1' cellpadding='4' align='left'> <th align='center' width = '100%'>Whiskey Information</th> </tr> <tr> <td>Time to brew Whiskey? <br> 10 Minutes</td> </tr> <tr> <td>Cost to brew Whiskey? </br> $50,000</td> </tr> <td>What does Whiskey do? </br> Not Sure Yet</td> </tr> </table> <form method='post' action='brewery.php?action=brewwhiskey'> <input type='submit' name='brewbeer' value='Brew Whiskey' /> </form>"; echo end_round(); } function brew_beer_sub() { global $q_ry, $pl, $c, $playerid, $h, $beer; if ($pl['wallet'] <= 25000) { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "Sorry, you don't have enough money </br> <hr width = '75%'>><a href='brewery.php'>Back</a><hr width = '75%'>"; $h->endpage(); die; } else { if ($_POST['brewbeer']) { $beer = rand(1, 6); echo "<center><main>Brewery</main><hr width='95%'/>"; echo "You only had enough ingredients to brew, {$beer} Bottle(s) of Beer!</br> Come back in 6 minutes to collect your beer"; mysql_query($q_ry); $q_ry = array(); $q_ry = "UPDATE 'members' SET 'brew'='brew' + '1', 'brew_time' = 'brew_time' + '6', 'brewed_beer' = 'brew_beer' + '$beer', 'wallet' = 'wallet' - '25000' WHERE 'playerid' = '" . mysql_real_escape_string($_SESSION['playerid']) . "'"; if ($pl['brew_time'] == '0') { } } } } function collect_beer() { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "<hr width = '750px'>"; echo round_table('750px'); echo "You have " . number_format($pl["brewed_beer"]) . " Bottles of Beer, how many would you like to collect?"; echo "<form method='post' action='brewery.php?action=beercollected'> <input style='background: white;' type='text' name='amount' maxlength='10' placeholder='Amount To Collect' required /> </br><input type='submit' name='beercollected' value='Collect' /> </form>"; echo end_round(); } function beer_collected() { global $q_ry, $pl, $c, $playerid, $h, $_POST; $pl['brewed_beer'] = abs((int) $pl['brewed_beer']); if ($_POST['amount'] > $pl['brewed_beer']) { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "You don't have this much beer you only have " . number_format($pl["brewed_beer"]) . " Bottles of Beer"; $h->endpage(); die; } else { global $q_ry, $pl, $c, $playerid, $h, $_POST; $_POST['amount'] = isset($_POST['amount']) && ctype_digit($_POST['amount']) ? abs(intval($_POST['amount'])) : 0; mysql_query($q_ry); $q_ry = array(); $q_ry = "UPDATE members SET brewed_beer=brewed_beer - {$_POST['amount']} WHERE playerid=" . mysql_real_escape_string($_SESSION['playerid']) . ""; i_credit($playerid, 277, ($_POST['amount'])); echo "<center><main>Brewery</main><hr width='95%'/>"; echo "You have collected " . number_format($_POST["amount"]) . " Bottles of Beer, you have " . number_format($pl["brewed_beer"]) . " left"; } } function brew_whiskey_sub() { global $q_ry, $pl, $c, $playerid, $h, $whiskey; if ($pl['wallet'] <= 50000) { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "Sorry, you don't have enough money </br> <hr width = '75%'>><a href='brewery.php'>Back</a><hr width = '75%'>"; $h->endpage(); die; } else { if ($_POST['brewwhiskey']) { $whiskey = rand(1, 9); echo "<center><main>Brewery</main><hr width='95%'/>"; echo "You only had enough ingredients to brew, {$whiskey} Bottle(s) of Whiskey!</br> Come back in 10 minutes to collect your Whiskey"; mysql_query($q_ry); $q_ry = array(); $q_ry = "UPDATE members SET 'brew'='brew' + '1', 'brewed_whiskey'='brewed_whiskey' + '$whiskey' 'wallet'='wallet' - '50000' 'brew_time'=brew_time + '10' WHERE 'playerid'='" . mysql_real_escape_string($_SESSION['playerid']) . "'"; if ($pl['brew_time'] == 0) { } } } } function collect_whiskey() { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "<hr width = '750px'>"; echo round_table('750px'); echo "You have " . number_format($pl["brewed_whiskey"]) . " Bottles of Whiskey, how many would you like to collect?"; echo "<form method='post' action='brewery.php?action=whiskeycollected'> <input style='background: white;' type='text' name='amount' maxlength='10' placeholder='Amount To Collect' required /> </br><input type='submit' name='whiskeycollected' value='Collect' /> </form>"; echo end_round(); } function whiskey_collected() { global $q_ry, $pl, $c, $playerid, $h, $_POST; $pl['brewed_whiskey'] = abs((int) $pl['brewed_whiskey']); if ($_POST['amount'] > $pl['brewed_whiskey']) { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "You don't have this much whiskey you only have " . number_format($pl["brewed_whiskey"]) . " Bottles of Whiskey"; $h->endpage(); die; } else { global $q_ry, $pl, $c, $playerid, $h, $_POST; $_POST['amount'] = isset($_POST['amount']) && ctype_digit($_POST['amount']) ? abs(intval($_POST['amount'])) : 0; mysql_query($q_ry); $q_ry = array(); $q_ry = "UPDATE members SET brewed_whiskey=brewed_whiskey - {$_POST['amount']} WHERE playerid=" . mysql_real_escape_string($_SESSION['playerid']) . ""; i_credit($playerid, 278, ($_POST['amount'])); echo "<center><main>Brewery</main><hr width='95%'/>"; echo "You have collected " . number_format($_POST["amount"]) . " Bottle(s) of Whiskey, you have " . number_format($pl["brewed_whiskey"]) . " left"; } } function brew_cider() { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "<hr width = '750px'>"; echo round_table('750px'); echo " <table class='vnm-table' width='100%' cellspacing='1' cellpadding='4' align='left'> <th align='center' width = '100%'>Cider Information</th> </tr> <tr> <td>Time to brew Cider? </br> 13 Minutes</td> </tr> <tr> <td>Cost to brew Cider? </br> $75,000</td> </tr> <td>What does Cider do? </br> Not Sure Yet</td> </tr> </table> <form method='post' action='brewery.php?action=brewcider'> <input type='submit' name='brewcider' value='Brew Cider' /> </form>"; echo end_round(); } function brew_cider_sub() { global $q_ry, $pl, $c, $playerid, $h, $cider; if ($pl['wallet'] <= 75000) { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "Sorry, you don't have enough money </br> <hr width = '75%'>><a href='brewery.php'>Back</a><hr width = '75%'>"; $h->endpage(); die; } else { if ($_POST['brewcider']) { $cider = rand(1, 9); echo "<center><main>Brewery</main><hr width='95%'/>"; echo "You only had enough ingredients to brew, {$cider} Bottle(s) of Cider!</br> Come back in 13 minutes to collect your cider"; mysql_query($q_ry); $q_ry = array(); $q_ry = "UPDATE members SET brew=brew + 1 brewed_cider=brewed_cider + $cider wallet=wallet - 75000 brew_time=brew_time + 13 WHERE playerid=" . mysql_real_escape_string($_SESSION['playerid']) . ""; if ($pl['brew_time'] == 0) { } } } } function collect_cider() { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "<hr width = '750px'>"; echo round_table('750px'); echo "You have " . number_format($pl["brewed_cider"]) . " Bottles of Cider, how many would you like to collect?"; echo "<form method='post' action='brewery.php?action=cidercollected'> <input style='background: white;' type='text' name='amount' maxlength='10' placeholder='Amount To Collect' required /> </br><input type='submit' name='cidercollected' value='Collect' /> </form>"; echo end_round(); } function cider_collected() { global $q_ry, $pl, $c, $playerid, $h, $_POST; $pl['brewed_cider'] = abs((int) $pl['brewed_cider']); if ($_POST['amount'] > $pl['brewed_cider']) { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "You don't have this much beer you only have " . number_format($pl["brewed_cider"]) . " Bottles of Cider"; $h->endpage(); die; } else { global $q_ry, $pl, $c, $playerid, $h, $_POST; $_POST['amount'] = isset($_POST['amount']) && ctype_digit($_POST['amount']) ? abs(intval($_POST['amount'])) : 0; mysql_query($q_ry); $q_ry = array(); $q_ry = "UPDATE members SET brewed_cider=brewed_cider - {$_POST['amount']} WHERE playerid=" . mysql_real_escape_string($_SESSION['playerid']) . ""; i_credit($playerid, 279, ($_POST['amount'])); echo "<center><main>Brewery</main><hr width='95%'/>"; echo "You have collected " . number_format($_POST["amount"]) . " Bottles of Cider, you have " . number_format($pl["brewed_cider"]) . " left"; } } function brew_vodka() { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "<hr width = '750px'>"; echo round_table('750px'); echo " <table class='vnm-table' width='100%' cellspacing='1' cellpadding='4' align='left'> <th align='center' width = '100%'>Vodka Information</th> </tr> <tr> <td>Time to brew Vodka? </br> 15 Minutes</td> </tr> <tr> <td>Cost to brew Vodka? </br> $100,000</td> </tr> <td>What does Vodka do? </br> Not Sure Yet</td> </tr> </table> <form method='post' action='brewery.php?action=brewvodka'> <input type='submit' name='brewvodka' value='Brew Vodka' /> </form>"; echo end_round(); } function brew_vodka_sub() { global $q_ry, $pl, $c, $playerid, $h, $vod; if ($pl['wallet'] <= 100000) { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "Sorry, you don't have enough money </br> <hr width = '75%'>><a href='brewery.php'>Back</a><hr width = '75%'>"; $h->endpage(); die; } else { if ($_POST['brewvodka']) { $vod = rand(2, 9); echo "<center><main>Brewery</main><hr width='95%'/>"; echo "You only had enough ingredients to brew, {$vod} Bottle(s) of Vodka!</br> Come back in 15 minutes to collect your vodka"; mysql_query($q_ry); $q_ry = array(); $q_ry = "UPDATE members SET brew=brew + 1 WHERE playerid=" . mysql_real_escape_string($_SESSION['playerid']) . " brewed_vodka=brewed_vodka + $vod wallet=wallet - 100000 brew_time=brew_time + 15 WHERE playerid=" . mysql_real_escape_string($_SESSION['playerid']) . " "; if ($pl['brew_time'] == 0) { } } } } function collect_vodka() { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "<hr width = '750px'>"; echo round_table('750px'); echo "You have " . number_format($pl["brewed_vodka"]) . " Bottles of Vodka, how many would you like to collect?"; echo "<form method='post' action='brewery.php?action=vodkacollected'> <input style='background: white;' type='text' name='amount' maxlength='10' placeholder='Amount To Collect' required /> </br><input type='submit' name='vodkacollected' value='Collect' /> </form>"; echo end_round(); } function vodka_collected() { global $q_ry, $pl, $c, $playerid, $h, $_POST; $pl['brewed_vodka'] = abs((int) $pl['brewed_vodka']); if ($_POST['amount'] > $pl['brewed_vodka']) { echo "<center><main>Brewery</main><hr width='95%'/>"; echo "You don't have this much vodka you only have " . number_format($pl["brewed_vodka"]) . " Bottles of Vodka"; $h->endpage(); die; } else { global $q_ry, $pl, $c, $playerid, $h, $_POST; $_POST['amount'] = isset($_POST['amount']) && ctype_digit($_POST['amount']) ? abs(intval($_POST['amount'])) : 0; mysql_query($q_ry); $q_ry = array(); $q_ry = "UPDATE members SET brewed_vodka=brewed_vodka - {$_POST['amount']} WHERE playerid=" . mysql_real_escape_string($_SESSION['playerid']) . ""; i_credit($playerid, 280, ($_POST['amount'])); echo "<center><main>Brewery</main><hr width='95%'/>"; echo "You have collected " . number_format($_POST["amount"]) . " Bottles of Vodka, you have " . number_format($pl["brewed_vodka"]) . " left"; } } ?>
-
I am currently converting this mod to RC Engine, going smoothly at the moment, I will post code once done, just making a few little changes.
-
I got it working, thank you though everyone, I ended up using my old ipn :) <? include('./includes/connections.php'); function in_event($player, $text) { $player = abs(intval($player)); $text = stripslashes($text); mysql_query("INSERT INTO `member_events` VALUES('NULL', '".mysql_real_escape_string($player)."', '".mysql_real_escape_string($text)."', unix_timestamp(), '0')"); mysql_query("UPDATE `city_statistic` SET `cs_value` = `cs_value` + '1' WHERE `cs_id` = '1'"); } // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $settle_amount = $_POST['settle_amount']; $payment_qty = $_POST['quantity']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { // check the payment_status is Completed if($payment_status != "Completed") { fclose ($fp);die(""); } // check that receiver_email is your Primary PayPal email if($receiver_email != '[email protected]') { fclose ($fp);die(""); } // check that payment_amount/payment_currency are correct if($payment_currency != 'USD') { fclose ($fp);die(""); } // check that domain is correct if($_SERVER['HTTP_HOST'] != 'www.reunited-city.com') { fclose($fp); die(""); } // check that item_name is correct if(in_array($item_name,array('Chalet','Villa','Penthouse','Mansion','Ranch','Palace','Castle','Private_Island','Hotel'))) { // check that mc_gross is correct $chp[Chalet] = 0.50*$payment_qty; $chp[Villa] = 1.00*$payment_qty; $chp[Penthouse] = 1.50*$payment_qty; $chp[Mansion] = 2.00*$payment_qty; $chp[Ranch] = 4.00*$payment_qty; $chp[Palace] = 7.00*$payment_qty; $chp[Castle] = 15.00*$payment_qty; $chp[Private_Island] = 20.00*$payment_qty; $chp[Hotel] = 30.00*$payment_qty; $chp[President_Bunker] = 40.00*$payment_qty; if($chp[$item_name] != $payment_amount) { fclose ($fp);die(""); } $hinfo = array('Chalet'=>'7|350','Villa'=>'8|400','Penthouse'=>'9|450','Mansion'=>'10|500','Ranch'=>'11|600','Palace'=>'12|1000','Castle'=>'13|1500','Private_Island'=>'14|2000','Hotel'=>'15|3000'); $info = explode("|", $hinfo[$item_name]); $q_ry = "INSERT INTO `members_properties` (`p_id`, `p_playerid`, `p_property`,`p_happy`) VALUES ('NULL', '".mysql_real_escape_string($item_number)."', '".mysql_real_escape_string($info[0])."', '".mysql_real_escape_string($info[1])."')"; mysql_query($q_ry); $item_name = str_replace('_', '', $item_name); in_event($item_number, 'Thank you for your donation of \$'.$payment_amount.'. Your '.$item_name.' is now in your properties page!'); in_event(1,'User['.$item_number.'] has donated for the property <b>'.$item_name.'</b> for a total of '.$settle_amount.'GBP!'); $mess = "User[".$item_number."] has donated for the property <b>'.$item_name.'</b> for a total of ".$settle_amount."GBP!"; mail('[email protected]', "Donation", $mess, "From: [email protected]"); $q_ry = array(); $q_ry = "INSERT INTO `donations_accepted` VALUES('NULL', '".mysql_real_escape_string($item_number)."', '".mysql_real_escape_string($payment_amount)."', unix_timestamp(), '0')"; mysql_query($q_ry); fclose($fp);die(""); } if($item_name != "31 Day Donator Pack" && $item_name != "Donator Pack - LTD") { fclose($fp);die(""); } else { $check_amnt1 = (3*$payment_qty) . ".00"; $check_amnt2 = (7*$payment_qty) . ".00"; if($item_name == "31 Day Donator Pack" && $payment_amount != "$check_amnt1") { fclose ($fp);die(""); } if($item_name == "Donator Pack - LTD" && $payment_amount != "$check_amnt2") { fclose ($fp);die(""); } // all seems to be in order, credit it. if($item_name == 'Donator Pack - LTD') { //Donator Pack - LTD $origqty = $payment_qty; //$payment_qty*=2; //$two = 0; //for($i = 1; $i<=50; $i++) //{ //$two=$two+2; //if($origqty == $two) { $payment_qty+=($origqty/2)*3; break; } //} $q_ry = array(); $q_ry = "SELECT `it_ID` FROM `members_items` WHERE `it_itemid` = '96' AND `it_playerid` = '".mysql_real_escape_string($item_number)."'"; $doi = array(); $doi = mysql_query($q_ry); if(!mysql_num_rows($doi)) { $q_ry = array(); $q_ry = "INSERT INTO `members_items` VALUES ('NULL', '".mysql_real_escape_string($item_number)."', '96', '".mysql_real_escape_string($payment_qty)."')"; mysql_query($q_ry); } else { $do = array(); $do = mysql_fetch_array($doi); $q_ry = array(); $q_ry = "UPDATE `members_items` SET `it_qty` = `it_qty` + '".mysql_real_escape_string($payment_qty)."' WHERE `it_ID` = '".mysql_real_escape_string($do['it_ID'])."'"; mysql_query($q_ry); } in_event($item_number, 'Thank you for your donation of \$'.$payment_amount.'. '.$payment_qty.' limited edition donator pack(s) has been credited to you.'); in_event(1,'User['.$item_number.'] has donated x '.$origqty.' for a total of '.$settle_amount.'GBP!'); $mess = "User[".$item_number."] has donated x ".$origqty." for a total of ".$settle_amount."GBP!"; mail('[email protected]', "Donation", $mess, "From: [email protected]"); $q_ry = array(); $q_ry = "INSERT INTO `donations_accepted` VALUES('NULL', '".mysql_real_escape_string($item_number)."', '".mysql_real_escape_string($payment_amount)."', unix_timestamp(), '0')"; mysql_query($q_ry); } else { $origqty = $payment_qty; //$payment_qty*=2; //$two = 0; //for($i = 1; $i<=50; $i++) //{ //$two=$two+2; //if($origqty == $two) { $payment_qty+=($origqty/2)*3; break; } //} $q_ry = array(); $q_ry = "SELECT `it_ID` FROM `members_items` WHERE `it_itemid` = '57' AND `it_playerid` = '".mysql_real_escape_string($item_number)."'"; $doi = array(); $doi = mysql_query($q_ry); if(!mysql_num_rows($doi)) { $q_ry = array(); $q_ry = "INSERT INTO `members_items` VALUES ('NULL', '".mysql_real_escape_string($item_number)."', '57', '".mysql_real_escape_string($payment_qty)."')"; mysql_query($q_ry); } else { $do = array(); $do = mysql_fetch_array($doi); $q_ry = array(); $q_ry = "UPDATE `members_items` SET `it_qty` = `it_qty` + '".mysql_real_escape_string($payment_qty)."' WHERE `it_ID` = '".mysql_real_escape_string($do['it_ID'])."'"; mysql_query($q_ry); } in_event($item_number, 'Thank you for your donation of \$'.$payment_amount.'. '.$payment_qty.' donator pack(s) has been credited to you.'); in_event(1,'User['.$item_number.'] has donated x '.$origqty.' for a total of '.$settle_amount.'GBP!'); $mess = "User[".$item_number."] has donated x ".$origqty." for a total of ".$settle_amount."GBP!"; mail('[email protected]', "Donation", $mess, "From: [email protected]"); $q_ry = array(); $q_ry = "INSERT INTO `donations_accepted` VALUES('NULL', '".mysql_real_escape_string($item_number)."', '".mysql_real_escape_string($payment_amount)."', unix_timestamp(), '0')"; mysql_query($q_ry); // process payment } } } else if (strcmp ($res, "INVALID") == 0) { } } fclose ($fp); } ?>
-
And I am also wondering, how can I make my game mobile friendly?
-
Okay, so when people donate to my game, they can choose to donate for a property, or a donator pack, but one problem, when they donate for a "31 Day Donator Pack" or "Donator Pack -LTD" it doesn't credit the packs to the user.. But it credits the properties, any help would be great, thank you.. ipn.php <? include('./includes/connections.php'); function in_event($player, $text) { $player = abs(intval($player)); $text = stripslashes($text); mysql_query("INSERT INTO `member_events` VALUES('NULL', '".mysql_real_escape_string($player)."', '".mysql_real_escape_string($text)."', unix_timestamp(), '0')"); mysql_query("UPDATE `city_statistic` SET `cs_value` = `cs_value` + '1' WHERE `cs_id` = '1'"); } // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $settle_amount = $_POST['settle_amount']; $payment_qty = $_POST['quantity']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $fee=(75*$payment_qty); if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { // check the payment_status is Completed if($payment_status != "Completed") { fclose ($fp);die(""); } // check that receiver_email is your Primary PayPal email if($receiver_email != '[email protected]') { fclose ($fp);die(""); } // check that payment_amount/payment_currency are correct if($payment_currency != 'USD') { fclose ($fp);die(""); } // check that domain is correct if($_SERVER['HTTP_HOST'] != 'www.reunited-city.com') { fclose($fp); die(""); } // check that item_name is correct if(in_array($item_name,array('Chalet','Villa','Pen thouse','Mansion','Ranch','Palace','Castle','Priva te_Island','Hotel','President_Bunker'))) { // check that mc_gross is correct $chp[Chalet] = 0.50*$payment_qty; $chp[Villa] = 1.00*$payment_qty; $chp[Penthouse] = 1.50*$payment_qty; $chp[Mansion] = 2.00*$payment_qty; $chp[Ranch] = 4.00*$payment_qty; $chp[Palace] = 7.00*$payment_qty; $chp[Castle] = 15.00*$payment_qty; $chp[Private_Island] = 20.00*$payment_qty; $chp[Hotel] = 30.00*$payment_qty; $chp[President_Bunker] = 40.00*$payment_qty; if($chp[$item_name] != $payment_amount) { fclose ($fp);die(""); } $hinfo = array('Chalet'=>'7|350','Villa'=>'8|400','Penthous e'=>'9|450','Mansion'=>'10|500','Ranch'=>'11|600', 'Palace'=>'12|1000','Castle'=>'13|1500','Private_I sland'=>'14|2000','Hotel'=>'15|3000','President_Bu nker'=>'16|4500'); $info = explode("|", $hinfo[$item_name]); $q_ry = "INSERT INTO `members_properties` (`p_id`, `p_playerid`, `p_property`,`p_happy`) VALUES ('NULL', '".mysql_real_escape_string($item_number)."', '".mysql_real_escape_string($info[0])."', '".mysql_real_escape_string($info[1])."')"; mysql_query($q_ry); $item_name = str_replace('_', '', $item_name); in_event($item_number, 'Thank you for your donation of \$'.$payment_amount.'. Your '.$item_name.' is now in your properties page!'); in_event(1,'User['.$item_number.'] has donated for the property <b>'.$item_name.'</b> for a total of '.$settle_amount.'USD!'); $mess = "User[".$item_number."] has donated for the property <b>'.$item_name.'</b> for a total of ".$settle_amount."USD!"; mail('[email protected]', "Donation", $mess, "From: [email protected]"); $q_ry = array(); $q_ry = "INSERT INTO `donations_accepted` VALUES('NULL', '".mysql_real_escape_string($item_number)."', '".mysql_real_escape_string($payment_amount)."' , unix_timestamp(), '0')"; mysql_query($q_ry); fclose($fp);die(""); } if($item_name != "31 Day Donator Pack" && $item_name != "10 Credit Card" && $item_name != "Special Energy Pack" && $item_name != "Charity To Homeless" && $item_name != "Charity To Homeless Small" && $item_name != "Donator Pack - LTD" && $item_name != "Refill Pack") { fclose($fp);die(""); } else { $check_amnt1 = (0*$payment_qty) . ".01"; $check_amnt2 = (7*$payment_qty) . ".00"; $check_amnt3 = (7*$payment_qty) . ".00"; $check_amnt4 = (7*$payment_qty) . ".00"; $check_amnt5 = (30*$payment_qty) . ".00"; $check_amnt6 = (10*$payment_qty) . ".00"; $check_amnt7 = (3*$payment_qty) . ".00"; if($item_name == "31 Day Donator Pack" && $payment_amount != "$check_amnt1") { fclose ($fp);die(""); } if($item_name == "10 Credit Card" && $payment_amount != "$check_amnt2") { fclose ($fp);die(""); } if($item_name == "Donator Pack - LTD" && $payment_amount != "$check_amnt3") { fclose ($fp);die(""); } if($item_name == "VIP Pack" && $payment_amount != "$check_amnt4") { fclose ($fp);die(""); } if($item_name == "Charity To Homeless" && $payment_amount != "$check_amnt5") { fclose ($fp);die(""); } if($item_name == "Charity To Homeless Small" && $payment_amount != "$check_amnt6") { fclose ($fp);die(""); } if($item_name == "Refill Pack" && $payment_amount != "$check_amnt7") { fclose ($fp);die(""); } // all seems to be in order, credit it. if($item_name == '10 Credit Card') { //Credit Card - 10 $origqty = $payment_qty; //$payment_qty*=2; //$two = 0; //for($i = 1; $i<=50; $i++) //{ //$two=$two+2; //if($origqty == $two) { $payment_qty+=($origqty/2)*3; break; } //} $q_ry = array(); $q_ry = "SELECT `it_ID` FROM `members_items` WHERE `it_itemid` = '126' AND `it_playerid` = '".mysql_real_escape_string($item_number)."'"; $doi = array(); $doi = mysql_query($q_ry); if(!mysql_num_rows($doi)) { $q_ry = array(); $q_ry = "INSERT INTO `members_items` VALUES ('NULL', '".mysql_real_escape_string($item_number)."', '126', '".mysql_real_escape_string($payment_qty)."')"; mysql_query($q_ry); } else { $do = array(); $do = mysql_fetch_array($doi); $q_ry = array(); $q_ry = "UPDATE `members_items` SET `it_qty` = `it_qty` + '".mysql_real_escape_string($payment_qty)."' WHERE `it_ID` = '".mysql_real_escape_string($do['it_ID'])."'"; mysql_query($q_ry); } in_event($item_number, 'Thank you for your donation of \$'.$payment_amount.'. '.$payment_qty.' credit card(s) has been credited to you.'); in_event(1,'User['.$item_number.'] has donated '.$origqty.' x $10 Credits Card for a total of '.$settle_amount.'USD!'); $mess = "User[".$item_number."] has donated ".$origqty." x $10 Credits Card for a total of ".$settle_amount."USD!"; mail('[email protected]', "Donation", $mess, "From: [email protected]"); $q_ry = array(); $q_ry = "INSERT INTO `donations_accepted` VALUES('NULL', '".mysql_real_escape_string($item_number)."', '".mysql_real_escape_string($payment_amount)."' , unix_timestamp(), '0')"; mysql_query($q_ry); } if($item_name == 'VIP Pack') { //Special Energy Pack $origqty = $payment_qty; //$payment_qty*=2; //$two = 0; //for($i = 1; $i<=50; $i++) //{ //$two=$two+2; //if($origqty == $two) { $payment_qty+=($origqty/2)*3; break; } //} $q_ry = array(); $q_ry = "SELECT `it_ID` FROM `members_items` WHERE `it_itemid` = '152' AND `it_playerid` = '".mysql_real_escape_string($item_number)."'"; $doi = array(); $doi = mysql_query($q_ry); if(!mysql_num_rows($doi)) { $q_ry = array(); $q_ry = "INSERT INTO `members_items` VALUES ('NULL', '".mysql_real_escape_string($item_number)."', '152', '".mysql_real_escape_string($payment_qty)."')"; mysql_query($q_ry); } else { $do = array(); $do = mysql_fetch_array($doi); $q_ry = array(); $q_ry = "UPDATE `members_items` SET `it_qty` = `it_qty` + '".mysql_real_escape_string($payment_qty)."' WHERE `it_ID` = '".mysql_real_escape_string($do['it_ID'])."'"; mysql_query($q_ry); } in_event($item_number, 'Thank you for your donation of \$'.$payment_amount.'. '.$payment_qty.' VIP Pack(s) has been credited to you.'); in_event(1,'User['.$item_number.'] has donated '.$origqty.' x VIP Pack for a total of '.$settle_amount.'USD!'); $mess = "User[".$item_number."] has donated ".$origqty." x VIP Pack for a total of ".$settle_amount."USD!"; mail('[email protected]', "Donation", $mess, "From: [email protected]"); $q_ry = array(); $q_ry = "INSERT INTO `donations_accepted` VALUES('NULL', '".mysql_real_escape_string($item_number)."', '".mysql_real_escape_string($payment_amount)."' , unix_timestamp(), '0')"; mysql_query($q_ry); } if($item_name == 'Refill Pack') { //Refill Pack $origqty = $payment_qty; //$payment_qty*=2; //$two = 0; //for($i = 1; $i<=50; $i++) //{ //$two=$two+2; //if($origqty == $two) { $payment_qty+=($origqty/2)*3; break; } //} $q_ry = array(); $q_ry = "SELECT `it_ID` FROM `members_items` WHERE `it_itemid` = '158' AND `it_playerid` = '".mysql_real_escape_string($item_number)."'"; $doi = array(); $doi = mysql_query($q_ry); if(!mysql_num_rows($doi)) { $q_ry = array(); $q_ry = "INSERT INTO `members_items` VALUES ('NULL', '".mysql_real_escape_string($item_number)."', '158', '".mysql_real_escape_string($payment_qty)."')"; mysql_query($q_ry); } else { $do = array(); $do = mysql_fetch_array($doi); $q_ry = array(); $q_ry = "UPDATE `members_items` SET `it_qty` = `it_qty` + '".mysql_real_escape_string($payment_qty)."' WHERE `it_ID` = '".mysql_real_escape_string($do['it_ID'])."'"; mysql_query($q_ry); } in_event($item_number, 'Thank you for your donation of \$'.$payment_amount.'. '.$payment_qty.' Refill Pack(s) has been credited to you.'); in_event(1,'User['.$item_number.'] has donated '.$origqty.' x Refill Pack for a total of '.$settle_amount.'USD!'); $mess = "User[".$item_number."] has donated ".$origqty." x Refill Pack for a total of ".$settle_amount."USD!"; mail('[email protected]', "Donation", $mess, "From: [email protected]"); $q_ry = array(); $q_ry = "INSERT INTO `donations_accepted` VALUES('NULL', '".mysql_real_escape_string($item_number)."', '".mysql_real_escape_string($payment_amount)."' , unix_timestamp(), '0')"; mysql_query($q_ry); } if($item_name == 'Charity To Homeless') { //Charity To Homeless $origqty = $payment_qty; //$payment_qty*=2; //$two = 0; //for($i = 1; $i<=50; $i++) //{ //$two=$two+2; //if($origqty == $two) { $payment_qty+=($origqty/2)*3; break; } //} $q_ry = array(); $q_ry = "SELECT `it_ID` FROM `members_items` WHERE `it_itemid` = '156' AND `it_playerid` = '".mysql_real_escape_string($item_number)."'"; $doi = array(); $doi = mysql_query($q_ry); if(!mysql_num_rows($doi)) { $q_ry = array(); $q_ry = "INSERT INTO `members_items` VALUES ('NULL', '".mysql_real_escape_string($item_number)."', '156', '".mysql_real_escape_string($payment_qty)."')"; mysql_query($q_ry); } else { $do = array(); $do = mysql_fetch_array($doi); $q_ry = array(); $q_ry = "UPDATE `members_items` SET `it_qty` = `it_qty` + '".mysql_real_escape_string($payment_qty)."' WHERE `it_ID` = '".mysql_real_escape_string($do['it_ID'])."'"; mysql_query($q_ry); } in_event($item_number, 'Thank you for your donation of \$'.$payment_amount.'. '.$payment_qty.' Charity Present has been credited to you.'); in_event(1,'User['.$item_number.'] has donated '.$origqty.' x Charity Present for a total of '.$settle_amount.'USD!'); $mess = "User[".$item_number."] has donated ".$origqty." x Charity Present for a total of ".$settle_amount."USD!"; mail('[email protected]', "Donation", $mess, "From: [email protected]"); $q_ry = array(); $q_ry = "INSERT INTO `donations_accepted` VALUES('NULL', '".mysql_real_escape_string($item_number)."', '".mysql_real_escape_string($payment_amount)."' , unix_timestamp(), '0')"; mysql_query($q_ry); } if($item_name == 'Charity To Homeless Small') { //Charity To Homeless Small $origqty = $payment_qty; //$payment_qty*=2; //$two = 0; //for($i = 1; $i<=50; $i++) //{ //$two=$two+2; //if($origqty == $two) { $payment_qty+=($origqty/2)*3; break; } //} $q_ry = array(); $q_ry = "SELECT `it_ID` FROM `members_items` WHERE `it_itemid` = '157' AND `it_playerid` = '".mysql_real_escape_string($item_number)."'"; $doi = array(); $doi = mysql_query($q_ry); if(!mysql_num_rows($doi)) { $q_ry = array(); $q_ry = "INSERT INTO `members_items`(it_playerid,) VALUES ('NULL', '".mysql_real_escape_string($item_number)."', '157', '".mysql_real_escape_string($payment_qty)."')"; mysql_query($q_ry); } else { $do = array(); $do = mysql_fetch_array($doi); $q_ry = array(); $q_ry = "UPDATE `members_items` SET `it_qty` = `it_qty` + '".mysql_real_escape_string($payment_qty)."' WHERE `it_ID` = '".mysql_real_escape_string($do['it_ID'])."'"; mysql_query($q_ry); } in_event($item_number, 'Thank you for your donation of \$'.$payment_amount.'. '.$payment_qty.' Charity Present Small has been credited to you.'); in_event(1,'User['.$item_number.'] has donated '.$origqty.' x Charity Present Small for a total of '.$settle_amount.'USD!'); $mess = "User[".$item_number."] has donated ".$origqty." x Charity Present Small for a total of ".$settle_amount."USD!"; mail('[email protected]', "Donation", $mess, "From: [email protected]"); $q_ry = array(); $q_ry = "INSERT INTO `donations_accepted` VALUES('NULL', '".mysql_real_escape_string($item_number)."', '".mysql_real_escape_string($payment_amount)."' , unix_timestamp(), '0')"; mysql_query($q_ry); } if($item_name == 'Donator Pack - LTD') { //Donator Pack - LTD $origqty = $payment_qty; //$payment_qty*=2; //$two = 0; //for($i = 1; $i<=50; $i++) //{ //$two=$two+2; //if($origqty == $two) { $payment_qty+=($origqty/2)*3; break; } //} $q_ry = array(); $q_ry = "SELECT `it_ID` FROM `members_items` WHERE `it_itemid` = '96' AND `it_playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'"; $doi = array(); $doi = mysql_query($q_ry); if(!mysql_num_rows($doi)) { $q_ry = array(); $q_ry = "INSERT INTO `members_items`(it_playerid, it_itemid, it_qty) VALUES('".$_SESSION['playerid']."', '96', '".$payment_qty."')"; mysql_query($q_ry); } else { $do = array(); $do = mysql_fetch_array($doi); $q_ry = array(); $q_ry = "UPDATE `members_items` SET `it_qty` = `it_qty` + '".$payment_qty."' WHERE `it_playerid` = '".mysql_real_escape_string($do['it_ID'])."'"; mysql_query($q_ry); } in_event($item_number, 'Thank you for your donation of \$'.$payment_amount.'. '.$payment_qty.' Donator Pack - LTD(s) has been credited to you.'); in_event(1,'User['.$item_number.'] has donated '.$origqty.' x Donator Pack - LTD for a total of '.$settle_amount.'USD!'); $mess = "User[".$item_number."] has donated ".$origqty." x Donator Pack - LTD for a total of ".$settle_amount."USD!"; mail('[email protected]', "Donation", $mess, "From: [email protected]"); $q_ry = array(); $q_ry = "INSERT INTO `donations_accepted` VALUES('NULL', '".$_SESSION['playerid']."', '".$payment_amount."' , unix_timestamp(), '0')"; mysql_query($q_ry); } if($item_name == '31 Day Donator Pack') { $origqty = $payment_qty; //$payment_qty*=2; //$two = 0; //for($i = 1; $i<=50; $i++) //{ //$two=$two+2; //if($origqty == $two) { $payment_qty+=($origqty/2)*3; break; } //} $q_ry = array(); $q_ry = "SELECT `it_ID` FROM `members_items` WHERE `it_itemid` = '57' AND `it_playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'"; $doi = array(); $doi = mysql_query($q_ry); if(!mysql_num_rows($doi)) { $q_ry = array(); $q_ry = "INSERT INTO `members_items`(it_playerid, it_itemid, it_qty) VALUES('".$_SESSION['playerid']."', '57', '".$payment_qty."')"; mysql_query($q_ry); } else { $do = array(); $do = mysql_fetch_array($doi); $q_ry = array(); $q_ry = "UPDATE `members_items` SET `it_qty` = `it_qty` + '".mysql_real_escape_string($payment_qty)."' WHERE `it_playerid` = '".mysql_real_escape_string($do['it_ID'])."'"; mysql_query($q_ry); } in_event($item_number, 'Thank you for your donation of \$'.$payment_amount.'. '.$payment_qty.' donator pack(s) has been credited to you.'); in_event(1,'User['.$item_number.'] has donated '.$origqty.' x Donator Pack for a total of '.$settle_amount.'USD!'); $mess = "User[".$item_number."] has donated ".$origqty." x Donator Pack for a total of ".$settle_amount."USD!"; mail('[email protected]', "Donation", $mess, "From: [email protected]"); $q_ry = array(); $q_ry = "INSERT INTO `donations_accepted` VALUES('NULL', '".mysql_real_escape_string($item_number)."', '".mysql_real_escape_string($payment_amount)."' , unix_timestamp(), '0')"; mysql_query($q_ry); // process payment } } } if (strcmp ($res, "INVALID") == 0) { } } } fclose ($fp); ?>
-
Thanks, but I got it now :)
-
I like the email verification, it means that you can't use a fake email address
-
I have started a VPS host plan, and I am using FileZilla for FTP.. I was just windesing is there any MySQL programs out there that I can link to my VPS? Or PHPmyadmin programs that I can link with it? Any help or download links would be great, thank you :)
-
Come and play Reunited City And let's build a strong community together. I hope to see you all there :) http://www.reunited-city.com
-
I ordered recovery media disks for my laptop. Only cost me $66 compared to $160 for a new windows install disk
-
Thanks, but I did state that I can't access the boot menu or bios menu. I could but now they won't show up. The laptop will just keep Booting
-
I have tried them. It just takes me back to the same screen with whatever start up option and the recovery
-
Here's what I'm getting.. And on start-up it won't let me access the bios menu, or boot menu or anything like that [ATTACH]2135[/ATTACH] [MENTION=65530]Coly010[/MENTION]
-
I know how to do all that. It was letting me get into the boot menu to start with. Now nothing. I have tried all function keys and none work. I know how to use Google.
-
I can't seem to get into the boot menu to change bios to boot up from the USB... Any ideas?
-
Thanks mate. Downloading it now
-
Thanks, I don't need to purchase windows do I?
-
Do you think I should try find someone to download a Linux usb boot creator or something?
-
Tried. Didn't work I'm getting error code 0xc0000185 And with boot logging turned on, it says either there is errors in msrpc.sys or the file is missing