-
Posts
2,124 -
Joined
-
Last visited
-
Days Won
144
Content Type
Profiles
Forums
Events
Everything posted by Magictallguy
-
It just Might Happen... and it probably will :)
Magictallguy replied to Uridium's topic in General Discussion
"Cronless Crons"? I've done it ;) -
mccode-v2 Upgrade IPFINDER original Script by Magicaltallguy
Magictallguy replied to Uridium's topic in Free Modifications
Recoded (for v2) Tested for parse errors only <?php include(__DIR__ . '/sglobals.php'); if(!in_array($ir['user_level'], array(2, 3))) { echo "You can't access this"; $h->endpage(); exit; } $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : null; switch($_GET['action']) { case 'index': index(); break; case 'status': status(); break; default: index(); break; } * function index() { global $db; ?>10.0.0.0 and 127.0.0.1 are default IPs. Pay no attention to those. <table border='1' class='table' cellpadding='2' cellspacing='2' width='100%'> <tr> <th>IP</th> <th>How Many</th> <th>ID's</th> <th>Usernames</th> <th>Status</th> <th>Cleared By</th> </tr><?php $sql = $db->query("SELECT `username`,`lastip`, COUNT(`userid`) AS `numusers`, `userid`, CAST(GROUP_CONCAT(`userid`) AS CHAR) AS `userlist` " . "FROM `users` " . "WHERE (`lastip` != '') " . "GROUP BY `lastip` " . "HAVING (`numusers` > 1) " . "ORDER BY `lastip`" ); if(!$db->num_rows($sql)) { ?><tr><td colspan='6' class='center'>No multis have been detected</td></tr><?php } else { while($z = $db->fetch_row($sql)) { $doipcheck = $db->query("SELECT * FROM `ipfinder` WHERE (`ip` = '".$z['lastip']."')"); $ip = $db->fetch_row($doipcheck); echo "<tr> <td><a href='ipfinder.php?action=status&ip=",$z['lastip'],"'>",$z['lastip'],"</a></td> <td>",$z['numusers'],"</td> <td>",wordwrap($z['userlist'], 50, "\n", true),"</td> <td><a href='viewuser.php?u=",$z['userid'],"'>",$z['username'],"</td> <td>",(empty($ip['status']) ? "<span style='color:blue;'>Needs Checking</span>" : stripslashes($ip['status'])),"</td> <td>",(!$ip['cleared_by'] ? "No-one" : $ip['cleared_by']),"</td> </tr>"; } echo "</table>"; } } ** function status() { global $db, $h, $ir; if(!isset($_POST['submit'])) { if(!isset($_GET['ip'])) { echo "You haven't specified an IP's status to edit"; $h->endpage(); exit; } $sql = $db->query("SELECT `status` FROM `ipfinder` WHERE (`ip` = '".$_GET['ip']."')"); $a** = $db->fetch_row($sql); ?>Editing the status of IP: <?php echo $_GET['ip']; ?> You can use code, but limit it to font colours only (<font color=colour>Text</font>) <font color=red>Multi</font> - <font color=green>Federal Jailed</font> <font color=green>Library IP</font> <font color=orange>Side Note:</font> <form action='ipfinder.php?action=status' method='post'> <input type='hidden' name='ip' value='<?php echo $_GET['ip']; ?>' /> <textarea rows='10' cols='50' name='status'><?php echo stripslashes(htmlspecialchars($a['status'])); ?></textarea> <input type='submit' name='submit' value='Change Status' /> </form><?php } else { if(empty($_POST['ip'])) { echo "You didn't specify an IP's status to edit"; $h->endpage(); exit; } $db->query("INSERT INTO `ipfinder` VALUES ('".$db->escape($_POST['ip'])."', '".$db->escape($_POST['status'])."', '".$ir['username']."') ON DUPLICATE KEY UPDATE `status` = '".$db->escape($_POST['status'])."', `cleared_by` = '".$ir['username']."'"); stafflog_add("Edited the status of IP: ".$_POST['ip']); echo "Status updated.<a href='staff.php'>Back</a>"; } } $h->endpage(); ?> The SQL as that appears to have been lost in the interwebs! CREATE TABLE `ipfinder` ( `id` INT( 11 ) NOT NULL PRIMARY KEY AUTO_INCREMENT, `ip` VARCHAR( 255 ) NOT NULL DEFAULT '' UNIQUE, `status` TEXT NOT NULL, `cleared_by` VARCHAR( 255 ) NOT NULL DEFAULT '' ); All, minor update to the code, see above the SQL -
Try appending an or die/exit mysql_error to the mysql_query()'s Was: mysql_query($someQuery); Becomes: mysql_query($someQuery) or exit(mysql_error()); Any errors flagged from your queries will actually stop the script and allow you to debug
-
Weapon STore page loads blank screen, Please Help
Magictallguy replied to VegasKiller's topic in PHP
There were multiple errors in that code. Fixed and formatted, though I'm not doing much else - that code's too messy after then one I've just done for you lol <?php echo "<table width='100%'><tr><td valign='left' width='95%'><font size=2 color=silver><b>Weapon Market</b></font></td><td><table width=100%><tr><td align=right>"; include('../beta/files/link.php'); echo " Weapon Market. Users can come here to buy weapons that they can to to another city and sell at a black market for profit.'></a></td></tr></table><img src='/beta/layout_images/headertop.gif' width=100% height=4></center>"; if(!isset($tools)) { echo "<font color=red><b>Error | It Seems Something Went Wrong Processing Your Account. Please Try Logging Out And Then Logging Back In. If The Problem Persists Please Email Support At [email protected]. We Apologize For The Inconvenience.</b></font><center><img src='/beta/layout_images/headertop.gif' width=100% height=4></center>"; session_destroy(); exit(); } $qry = 'SELECT * FROM weapons WHERE uid=' . db_quote_smart($player->uid); $res = db_query($qry); $has_weapons_array = mysql_fetch_array($res); $weapon_names = array( 'bbgun_bullet', 'handgun_bullet', 'shotgun_bullet', 'rifle_bullet', 'bbgun', 'handgun', 'shotgun', 'ak47', 'bomb', 'taser', 'baseballbat', 'shank', 'detonator', 'battery' ); $name_hash = array( 'bbgun_bullet' => 'BBGun Bullet (4-9)', 'handgun_bullet' => 'Handgun Bullet (9-47)', 'shotgun_bullet' => 'Shotgun Bullet (28,142)', 'rifle_bullet' => 'Rifle Bullet (47-237)', 'bbgun' => 'BBGun (280-300)', 'handgun' => 'Handgun (470-500)', 'shotgun' => 'Shotgun (96-100)', 'ak47' => 'AK47 (415-500)', 'bomb' => 'Bomb (248-250)', 'taser' => 'Taser (45-50)', 'baseballbat' => 'Baseball Bat (90-100)', 'shank' => 'Shank (55-100)', 'detonator' => 'Detonator (427-475)', 'battery' => 'Battery (3-9)' ); $qry = 'SELECT * FROM prices_booze WHERE city=' . db_quote_smart($player->city); $res = db_query($qry); $prices = mysql_fetch_array($res); $qry = 'SELECT * FROM weapons WHERE uid=' . db_quote_smart($player->uid); $res = db_query($qry); $weapons = mysql_fetch_array($res); $limit = $has_weapons_array["weapon_limit"]; $space_used = 0; foreach($weapon_names as $name) { $space_used += $weapons[$name]; } $space_left = $limit - $space_used; $action = $_GVARS['action']; if($action == 'buy') { foreach($weapon_names as $weapon) { $price = $prices[$weapon]; $amount = (isset($_POST[$weapon]) ? intval($_POST[$weapon]) : 0); $cost = $price * $amount; if($amount > 0) { if($gUser['cash'] < $cost) { echo "<font color=red><b>Error | You Do Not Have Enough Money To Purchase $amount unit(s) Of $weapon.</b></font><center><img src='/beta/layout_images/headertop.gif' width=100% height=4></center>"; } elseif(($space_left - $amount) < 0) { echo "<font color=red><b>Error | You Do Not Have Enough Space To Carry $amount unit(s) Of $weapon.</b></font><center><img src='/beta/layout_images/headertop.gif' width=100% height=4></center>"; } else { $space_left -= $amount; $gUser['cash'] -= $cost; $qry = 'UPDATE user_characters SET cash=cash-' . $cost . ' WHERE uid=' . db_quote_smart($player->uid); $res = db_query($qry); $randscam = mt_rand(1, 100); $randscam2 = mt_rand(1, 100); if($randscam == $randscam2) { echo "<font color=red><b>Error | You Were Scammed By A Dealer. The Weapons You Bought Turned Out To Be Replicas.</b></font><center><img src='/beta/layout_images/headertop.gif' width=100% height=4></center>"; $randexp = rand(0, 1); $qry = 'UPDATE user_characters SET exp=exp+' . $randexp . ' WHERE uid=' . db_quote_smart($player->uid); $res = db_query($qry); } else { $qry = "UPDATE weapons SET $weapon=$weapon+$amount WHERE uid=" . db_quote_smart($player->uid); $res = db_query($qry); $randexp2 = rand(1, 3); $qry = 'UPDATE user_characters SET exp=exp+' . $randexp2 . ', drug_points=drug_points+' . $amount . ' WHERE uid=' . db_quote_smart($player->uid); $res = db_query($qry); $sql = "UPDATE adv_stats SET drugs_bought=drugs_bought+$amount WHERE email='" . $stats_array["email"] . "'"; $sql = mysql_query($sql); echo "<font color=green><b>Ciao | You Have Purchased $amount Crate(s) Of $weapon.</b></font><center><img src='/beta/layout_images/headertop.gif' width=100% height=4></center>"; } } } } } // gets updated version of weapons in pocket $qry = 'SELECT * FROM weapons WHERE uid=' . db_quote_smart($player->uid); $res = db_query($qry); $has_weapons_array = mysql_fetch_array($res); echo "<table align=center width=100% bgcolor=000000><tr><td>"; echo "<table width='450' cellpadding='0' border='2' bordercolor='black' style='margin:0 auto;background-image: url(/beta/layout_images/bg_2.gif);'> <tr bgcolor=#11111> <td align=center> <font face=verdana size=1 color=silver><b>Weapon</b></font> </td> <td align=center> <font face=verdana size=1 color=silver><b>Cost</b></font> </td> <td align=center> <font face=verdana size=1 color=silver><b># you have</b></font> </td> <td align=center> <font face=verdana size=1 color=silver><b># to buy</b></font> </td> </tr>"; $space_used = 0; $row = 0; foreach($weapon_names as $weapon) { $space_used += $has_weapons_array[$weapon]; echo ('<tr bgcolor="#' . ($row++ % 2 ? '444444' : '333333') . '"> <td align="center" width="125"><font face="tahoma" size="1" color="#ffffff"><b><a href="javascript<img src="images/smilies/tongue.png" border="0" alt="" title="Stick Out Tongue" class="inlineimg" />opUp(\'weaponsmarket_graph_view.php?weapons=' . $weapon . '\')">' . $name_hash[$weapon] . '</a></b></td> <td align="center" width="125"><font face="tahoma" size="1" color="#ffffff">$ ' . number_format($prices[$weapon]) . '</font></td> <td align="center" width="125"><font face="tahoma" size="1" color="#ffffff">' . number_format($has_weapons_array[$weapon]) . '</font></td> <td align="center" width="125"><font face="tahoma" size="1" color="#ffffff"><form name="login" action="driver.php?x=weaponstore" method="post"><input type="text" name="' . $weapon . '" size=5 style="font-weight:none;font-size:8pt;color:#ffffff;font-family:arial;background-color:#000000;border-color:#ffffff" maxlength="15"></font></td> </tr>'); } echo " </table> <table width='450' cellpadding='0' border='2' bordercolor='black' style='margin:0 auto;background-image: url(/beta/layout_images/bg_2.gif);'> <tr bgcolor=#11111 valign=top><td> <table width=100%><tr> <td align=left width=125><font face=verdana size=1 color=silver><input type=radio checked name=action value=buy> Buy </td> <td align=center width=250><font size=1><font color=#FFFFFF><b>Weapon space:</b></font> " . $space_used . "/" . $has_weapons_array["weapon_limit"] . "</font></td> <td align=right width=125><center><font face=verdana size=1 color=silver><input type=submit value=\" Purchase Weapon \" style=\"FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #FFFFFF; FONT-FAMILY: Arial; BACKGROUND-COLOR: #333333\" size=1></center></td> </tr></table> </td></tr> </table>"; ?> -
NOTE: Tested for parse errors only <table width='100%'><tr><td valign='left' width='95%'><font size=2 color='silver'><strong>Stock Market</strong></font></td><td><table width=100%><tr><td align=right> <?php include('../beta/files/link.php'); ?>Stock Market. Users can come buy stocks here. Stock values are calculated every 5 minutes and connect to the real stock ticker to give some realism to the feature. So like real stocks users have the chance to gain or lose stock value without random methods.'</td></tr></table><img src='/beta/layout_images/headertop.gif' width=100% height=4 /><?php if(!isset($tools)) { ?><font color=red><strong>Error | It Seems Something Went Wrong Processing Your Account. Please Try Logging Out And Then Logging Back In. If The Problem Persists Please Email Support At [email protected]. We Apologize For The Inconvenience.</strong></font><center><img src='/beta/layout_images/headertop.gif' width='100%' height='4' /></center><?php session_destroy(); exit(); } echo "<font color=red><strong>Error | The Stock Market Is Currently Closed. Sorry For The Inconvenience.</strong></font><center><img src='/beta/layout_images/headertop.gif' width='100%' height='4' /></center>"; exit; //********************************************* // SETTINGS //********************************************* $comission = 0.03; //broker percentage based comission on all trades $comissiondisplay = ($comission * 100) . '%'; //just used to show them how much their paying //********************************************* $company = isset($company) && ctype_digit($company) ? abs(@intval($company)) : null; if((isset($action) && $action == "trade") && !empty($company)) { // kill non numbers preg_match_all("/([0-9]+)/", $shares, $regs); $shares = implode("", $regs[1]); $sql_shares = mysql_query("SELECT `shares`, `total` FROM `stocks_shares` WHERE ((`company` = " . $company . ") AND (`uid` = " . $player->uid . "))") or exit(mysql_error()); $row_shares = mysql_fetch_assoc($sql_shares); $port_total = $row_shares['total']; $port_shares = $row_shares['shares']; $sql = mysql_query("SELECT `price`, `company` FROM `stock_companies` WHERE (`ticker` = " . $company . ")") or exit(mysql_error()); if(!mysql_num_rows($sql)) { echo "There appears to be an issue. Please inform an administrator"; exit; } $row = mysql_fetch_assoc($sql); $price = $row['price']; $name = $row['company']; $trade_value = $price * $shares; $comission_paid = $trade_value * $comission; if($type == "buy") { $paid = $trade_value + $comission_paid; if($shares <= 0) { echo "<font color=red><strong>Error | You did not enter an amount of stock shares to purchase.</strong></font><center><img src='/beta/layout_images/headertop.gif' width='100%' height='4' /></center>"; exit; } if($stats_array['cash'] < $paid) { echo "<font color=red><strong>Error | You need at least $" . number_format($trade_value) . " in cash to complete this trade.</strong></font><center><img src='/beta/layout_images/headertop.gif' width='100%' height='4' /></center>"; exit; } mysql_query("UPDATE `user_characters` SET `cash` = `cash` - " . $paid . " WHERE (`uid` = " . $player->uid . ")") or exit(mysql_error()); $sql = (!mysql_num_rows($sql_shares)) ? "INSERT INTO `stocks_shares` (`uid`, `company`, `shares`, `total`) VALUES (" . $player->uid . "', " . $company . ", " . $shares . ", " . $trade_value . ")" : "UPDATE `stocks_shares` SET `shares` = `shares` + " . $shares . ", `total` = `total` + " . $trade_value . " WHERE ((`uid` = " . $player->uid . ") AND (`company` = " . $company . "))"; mysql_query($sql) or exit(mysql_error()); echo "<font color=green><strong>Ciao | You have purchased ", number_format($shares), " share", (($shares == 1) ? '' : 's'), " of ", stripslashes(htmlentities($name)), " for $", number_format($paid), ". The broker took a ", $commisiondisplay, " fee of $", number_format($comission_paid, 2), ".</strong></font><center><img src='/beta/layout_images/headertop.gif' width='100%' height='4' /></center><meta http-equiv='refresh' content='5;url=driver.php?x=stockmarket'>"; } else if($type == "sell") { $payout = $trade_value - $comission_paid; if($shares <= 0) { echo "<font color=red><strong>Error | You did not enter an amount of stock shares to sell.</strong></font><center><img src='/beta/layout_images/headertop.gif' width='100%' height='4' /></center>"; exit; } if($port_shares < $shares) { echo "<font color=red><strong>Error | You do not have ", number_format($shares), " Share", (($shares == 1) ? '' : 's'), " of ", stripslashes(htmlentities($name)), ".</strong></font><center><img src='/beta/layout_images/headertop.gif' width='100%' height='4' /></center>"; exit; } $sql = ($port_shares == $shares) ? "DELETE FROM `stocks_shares` WHERE ((`uid` = " . $player->uid . ") AND (`company` = " . $company . "))" : "UPDATE `stocks_shares` SET `shares` = `shares` - " . $shares . ", `total` = `total` - " . $trade_value . " WHERE ((`uid` = " . $player->uid . ") AND (`company` = " . $company . "))"; mysql_query($sql) or exit(mysql_error()); } mysql_query("UPDATE `user_characters` SET `cash` = `cash` + " . $payout . " WHERE (`uid` = " . $player->uid . ")") or exit(mysql_error()); echo "<font color=green><strong>Ciao | You have sold ", number_format($shares), " Share", (($shares == 1) ? '' : 's'), " of ", stripslashes(htmlentities($name)), " for $", number_format($payout), ". The broker took a ", $commisiondisplay, " fee of $", number_format($comission_paid, 2), ".</strong></font><center><img src='/beta/layout_images/headertop.gif' width='100%' height='4' /></center><meta http-equiv='refresh' CONTENT='5;url=driver.php?x=stockmarket'>"; } ?><table width=100% align='center'><tr valign=top><td align='center' colspan=2> <table width='600' cellpadding='1' cellspacing='3' border='2' bordercolor='black' style='margin:0 auto;background-image: url(/beta/layout_images/bg_2.gif);'> <tr> <td bgcolor='#111111' align='center'><font color='silver'><strong>Company</strong></font></td> <td bgcolor='#111111' align='center'><font color='silver'><strong>Sector</strong></font></td> <td bgcolor='#111111' align='center'><font color='silver'><strong>Price</strong></font></td> <td bgcolor='#111111' align='center'><font color='silver'><strong>Change Today</strong></font></td> </tr><?php $color = 1; $sql = mysql_query("SELECT `ticker`, `company`, `industry`, `price`, `change` FROM `stocks_companies` ORDER BY `industry`") or exit(mysql_error()); if(!mysql_num_rows($sql)) { ?><tr><td colspan='4' style='text-align:center;'>There are no companies</td></tr><?php } else { $stocks_company = array(); $stocks_ticker = array(); $stocks_price = array(); while($row = mysql_fetch_assoc($sql)) { $stocks_company[$row['ticker']] = $row['company']; $stocks_ticker[$row['company']] = $row['ticker']; $stocks_price[$row['ticker']] = $row['price']; switch($color) { case 1: $rowcolor = '#111111'; $color = 2; break; case 2: $rowcolor = '#111111'; $color = 1; break; } echo "<tr bgcolor='$rowcolor'> <td align='center'><a href=http://finance.yahoo.com/q?s=" . $row['ticker'] . " target='new'><font color=#FFFFFF><strong>" . $row['company'] . "</strong></></a></td> <td align='center'><font color=#FFFFFF>" . $row['industry'] . "</font></td> <td align='center'><font color=#FFFFFF>$" . $row['price'] . "</td> <td align='center'><span style='color:", (($row['change'] < 0) ? 'red' : 'lime'), ";'>", $row['change'], "</span></td></tr>"; } } ?></table><center><img src='/beta/layout_images/headertop.gif' width='100%' height='4' /></center> </td><tr><td align='center' valign='top'> <font size=4 color='silver'><center><strong>Portfolio</strong></center></font> <table width='80%' cellpadding='1' cellspacing='3' border='2' bordercolor='black' style='margin:0 auto;background-image: url(/beta/layout_images/bg_2.gif);'> <tr> <td bgcolor='#111111' align='center'><font color='silver'><strong>COMPANY</strong></font></td> <td bgcolor='#111111' align='center'><font color='silver'><strong>SHARES</strong></font></td> <td bgcolor='#111111' align='center'><font color='silver'><strong>VALUE</strong></font></td> <td bgcolor='#111111' align='center'><font color='silver'><strong>GAIN/LOSS</strong></font></td> </tr><?php $sql = mysql_query("SELECT `company`, `shares`, `total` FROM `stocks_shares` WHERE (`uid` = " . $player->uid . ")") or exit(mysql_error()); if(!mysql_num_rows($sql)) { ?><tr><td colspan='4' style='text-align:center;'>You have no stocks</td></tr><?php } else { while($row = mysql_fetch_assoc($sql)) { switch($color) { case 1: $rowcolor = '#111'; $color = 2; break; case 2: $rowcolor = '#000'; $color = 1; break; } $ticker = $row['company']; $value = $row['shares'] * $stocks_price[$ticker]; $gainorloss = $value - $row['total']; echo "<tr bgcolor=$rowcolor> <td align='center'><a href=http://finance.yahoo.com/q?s=", $row['company'], " target=_href><font color=#FFFFFF><strong>", $stocks_company[$ticker], "</strong></font></a></td> <td align='center'><font color=#FFFFFF>", number_format($row['shares']), "</font></td> <td align='center'><font color=#FFFFFF>$", number_format($value, 2), "</font></td> <td align='center'><span style='color:", (($gainorloss < 0) ? 'red' : 'lime'), ";'>$", number_format($gainorloss, 2), "</span></td> </tr>"; } } ?></table></td><td valign=top> <font size=4 color='silver'><center><strong>Trading Floor</strong></center></font> <form action=?x=stockmarket&action=trade method=post> <table width='360' cellpadding='1' cellspacing='3' border='2' bordercolor='black' style='margin:0 auto;background-image: url(/beta/layout_images/bg_2.gif);'> <tr bgcolor='#111111'> <td> <font face=verdana size=2 color=#FFFFFF><strong>Company:</strong></font> <td> <select name=company style=\"FONT-WEIGHT: none; FONT-SIZE: 8pt; COLOR: #FFFFFF; FONT-FAMILY: Arial; BACKGROUND-COLOR: #000000; border-color: #FFFFFF\"><?php foreach($stocks_ticker as $tick) { printf("<option value='%u'>%s</option>", $tick, $stocks_company[$tick]); } ?></select> </td> </tr> <tr bgcolor='#111111'> <td> <font face=verdana size=2 color=#FFFFFF><strong># of Shares:</strong></font> </td> <td> <input type=text name=shares maxlength=15 value=\"$victim\" size=15 style=\"FONT-WEIGHT: none; FONT-SIZE: 8pt; COLOR: #FFFFFF; FONT-FAMILY: Arial; BACKGROUND-COLOR: #000000; border-color: #FFFFFF\"> </td> </tr> <tr bgcolor='#111111'> <td> <font face=verdana size=2 color=#FFFFFF><strong>Action:</strong></font> </td> <td> <select name=type style=\"FONT-WEIGHT: none; FONT-SIZE: 8pt; COLOR: #FFFFFF; FONT-FAMILY: Arial; BACKGROUND-COLOR: #000000; border-color: #FFFFFF\"> <option value=buy>BUY</option> <option value=sell>SELL</option> </select> </td> </tr> <tr> <td align='center' colspan=2> <font color=#888888>Broker Fee: <?php echo $comissiondisplay; ?> per trade</font> <input type=submit name=Submit value=\"Complete Trade\"> </td> </tr> </table></form> </td></tr></table> If you receive any errors, either fix 'em yourself or post here
-
Fix that undefined index of "action"!
-
*sigh* Query starting on line 4 (from the snippet posted above) $db->query("SELECT `mi`.*, `i`.* FROM `inventory` AS `mi` LEFT JOIN `items`AS `i` ON `mi`.`inv_itemid` = `i`.`itmid` WHERE `mi`.`inv_userid` = ".$ir['userid']);
-
Guest? Marry me? That response was wonderful!! +1!
-
mccode-v2 Secured bank (minor update to fit >) + Bank robbery!
Magictallguy replied to yaz94's topic in Free Modifications
bank.php Note: This code has been tested for parse errors only. I have not tested its functionality. The code is provided as is with no warranty or guarantee that it will work <?php include(__DIR__ . "/globals.php"); ?><h4><span style='text-decoration:underline;font-weight:bold;color:red;'><a href='robbank.php'>>Rob the bank!</a></span></h4> <h3>Bank</h3><?php $q = $db->query("SELECT robbery FROM bank"); $var = $db->fetch_row($q); if($var['robbery'] > 0) { ?><span style='text-decoration:underline;font-weight:bold;color:red;'><h4>The bank is closed for maintenance due to a robbery!</h4><br /><a href='explore.php'>Go back!</a></span><?php $h->endpage(); exit; } if($ir['bankmoney'] > -1) { switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money'] > 49999) { $db->query(sprintf("UPDATE `users` SET `money` = `money` - 50000, `bankmoney` = 0 WHERE (`userid` = %u)", $ir['userid'])); ?>Congratulations, you bought a bank account for \$50,000!<br /><a href='bank.php'>Start using my account</a><?php } else { ?>You do not have enough money to open an account.<br /><a href='explore.php'>Back to town...</a><?php } } else { ?>Open a bank account today, just \$50,000!<br /><a href='bank.php?buy'>> Yes, sign me up!</a><?php } } function index() { global $ir; ?><strong>You currently have $<?php echo number_format($ir['bankmoney']); ?> in the bank.</strong> At the end of each day, your bank balance will go up by 2%. <table width='75%' cellspacing='1' class='table'> <tr> <td width='50%'><strong>Deposit Money</strong> It will cost you 15% of the money you deposit, rounded up. The maximum fee is \$3,000. <form action='bank.php?action=deposit' method='post'> Amount: <input type='text' name='deposit' value='<?php echo number_format($ir['money']); ?>' /> <input type='submit' value='Deposit' /> </form></td> <td width='50%'><strong>Withdraw Money</strong> There is no fee on withdrawals. <form action='bank.php?action=withdraw' method='post'> Amount: <input type='text' name='withdraw' value='<?php echo number_format($ir['bankmoney']); ?>' /> <input type='submit' value='Withdraw' /> </form></td> </tr> </table><?php } function deposit() { global $db, $ir, $h; $_POST['deposit'] = isset($_POST['deposit']) && is_string($_POST['deposit']) ? abs(@intval(str_replace(',', '', $_POST['deposit']))) : null; if(empty($_POST['deposit'])) { ?>You didn't enter a valid amount to deposit<?php $h->endpage(); exit; } if($_POST['deposit'] > $ir['money']) { ?>You don't have enough money to deposit this amount.<?php $h->endpage(); exit; } $fee = ceil($_POST['deposit'] * 15 / 100); if($fee > 3000) $fee = 3000; $gain = $_POST['deposit'] - $fee; $ir['bankmoney'] += $gain; $db->query(sprintf("UPDATE `users` SET `bankmoney` = `bankmoney` + %u, `money` = `money` - %u WHERE (`userid` = %u)", $gain, $_POST['deposit'], $ir['userid'])); ?>You hand over $<?php echo number_format($_POST['deposit']); ?> to be deposited,<br />after the fee is taken ($<?php echo number_format($fee); ?>), $<?php echo number_format($gain); ?> is added to your account. <strong>You now have $<?php echo number_format($ir['bankmoney']); ?> in the bank.</strong><br /><a href='bank.php'>> Back</a><?php } function withdraw() { global $db, $ir, $h; $_POST['withdraw'] = isset($_POST['withdraw']) && is_string($_POST['withdraw']) ? abs(@intval(str_replace(',', '', $_POST['withdraw']))) : null; if(empty($_POST['withdraw'])) { ?>You didn't enter a valid amount to withdraw<?php $h->endpage(); exit; } if($_POST['withdraw'] > $ir['bankmoney']) { ?>You don't have enough money banked to withdraw this amount.<?php $h->endpage(); exit; } $ir['bankmoney'] -= $_POST['withdraw']; $db->query(sprintf("UPDATE `users` SET `bankmoney` = `bankmoney` - %u, `money` = `money` + %u WHERE (`userid` = %u)", $_POST['withdraw'], $_POST['withdraw'], $ir['userid'])); ?>You ask to withdraw $<?php echo number_format($gain); ?>,<br />the banking lady grudgingly hands it over.<br /><strong>You now have $<?php echo number_format($ir['bankmoney']); ?> in the bank.</strong><br /><a href='bank.php'>> Back</a><?php } $h->endpage(); ?> -
I've got one, runs perfectly fine and keep my 1.5TB HDD fairly clean - I keep my film collection on the NAS, and my games on my PC. 3 drives, about 2TB+ of space on my PC 1 NAS, 2 drives, about 5TB of space - no complaints here ^.^
-
Thanks for the fixes, I've been way too busy with the family
-
Replace with: printf("<td><a href='yourgang.php?action=staff&act2=decidehousereq&ID=%u&dir=accept' style='color:#79A888;'>Accept</a> · <a href='yourgang.php?action=staff&act2=decidehousereq&ID=%u&dir=decline' style='color:#AF4035;'>Decline</a></td>", $row['grrID'], $row['grrID']); Original code updated
-
How to find Sponsors and/or Developers for an idea
Magictallguy replied to Pavlos1316's topic in General
I'd be interested in working with Dave again, give me a shout :P -
As a professional musician, I can't help but listen (and sing to) music, no matter what I'm doing! DJK will probably remember that I wouldn't shut up when I want to visit him a couple of years ago xD
-
Try this <?php /** ** MCCodes Version 2.0.5b ** Copyright (C) 2005-2012 Dabomstew ** All rights reserved. ** ** Redistribution of this code in any form is prohibited, except in ** the specific cases set out in the MCCodes Customer License. ** ** This code license may be used to run one (1) game. ** A game is defined as the set of users and other game database data, ** so you are permitted to create alternative clients for your game. ** ** If you did not obtain this code from MCCodes.com, you are in all likelihood ** using it illegally. Please contact MCCodes to discuss licensing options ** in this case. ** ** File: attacklost.php ** Signature: 95b6a74ae7c7a6cf4e9ed998f3b574c8 ** Date: Fri, 20 Apr 12 08:50:30 +0000 **/ $atkpage = 1; require_once('globals.php'); $_GET['ID'] = (isset($_GET['ID']) && ctype_digit($_GET['ID'])) ? abs((int) $_GET['ID']) : 0; $_SESSION['attacking'] = 0; $_SESSION['attacklost'] = 0; if(!$_GET['ID']) { echo "You didn't specify a player to attack"; exit($h->endpage()); } $od = $db->query("SELECT `username`, `level`, `gang` FROM `users` WHERE `userid` = {$_GET['ID']}"); if(!$db->num_rows($od)) { echo "You lost to Mr. Non-Existant!"; exit($h->endpage()); } $r = $db->fetch_row($od); $db->free_result($od); echo "You lost to ", stripslashes(htmlspecialchars($r['username'])); $expgain = abs(($ir['level'] - $r['level']) ^ 3); $expgainp = $expgain / $ir['exp_needed'] * 100; echo " and lost ", number_format($expgainp, 2), "% EXP!"; // Figure out their EXP, 0 or decreased? $newexp = max($ir['exp'] - $expgain, 0); $db->query("UPDATE `users` SET `exp` = {$newexp}, `attacking` = 0 WHERE `userid` = $userid"); event_add($r['userid'], "<a href='viewuser.php?u=$userid'>{$ir['username']}</a> attacked you and lost.", $c); $atklog = $db->escape($_SESSION['attacklog']); $db->query("INSERT INTO `attacklogs` VALUES(NULL, $userid, {$_GET['ID']}, 'lost', " . time() . ", 0, '$atklog')"); if($ir['gang'] > 0 && $r['gang'] > 0) { $warq = $db->query("SELECT * FROM `gangwars` " . "WHERE (((`warDECLARER` = {$ir['gang']}) AND (`warDECLARED` = {$r['gang']})) " . "OR ((`warDECLARED` = {$ir['gang']}) AND (`warDECLARER` = {$r['gang']})))"); if($db->num_rows($warq) > 0) { $war = $db->fetch_row($warq); $db->query("UPDATE `gangs` SET `gangRESPECT` = `gangRESPECT` + 1 WHERE `gangID` = {$r['gang']}"); $db->query("UPDATE `gangs` SET `gangRESPECT` = `gangRESPECT` - 1 WHERE `gangID` = {$ir['gang']}"); echo "You lost 1 respect for your gang!"; } $db->free_result($warq); } $h->endpage(); ?>
-
May write that up, sounds like something I'd use
-
I know, but I was basically stating, in so many words, that you can have the entire auto credit shiz with the standard MC Craps
-
Getting back to the Donator with IPN request... You do realise, right, that "IPN" stands for "Instant Payment Notification" - that part is enabled on your PayPal itself. You can set up your system to automatically credit the donator pack/will potions using an IPN, but the IPN itself is *not* the auto-credit.. Screenshots on how to set up IPN http://screencast.com/t/ki1OQNPeP8I http://screencast.com/t/8p2fIggjOI http://screencast.com/t/ugF0Jf9jVP http://screencast.com/t/bKV6arHtRsTr - change to your own site
-
Fixed, I'll read the message now :P
-
I have details to around 15 sites.. Which one was yours? :P Edit: Nevermind, just noticed the file path
-
Tested for parse errors only Provided there are no more errors. This code has been completely fixed, and a little security has been put in place, alongside preventing E_WARNING | E_NOTICE errors ^.^ <?php include "globals.php"; ?><center><font size='4' face='Arial, Helvetica, sans-serif'>User images</font> <hr width='90%'><?php $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : null; switch($_GET['action']) { case 'view': view_image(); break; default: user_images(); break; } function user_images() { global $db, $ir, $h; $_GET['delete'] = isset($_GET['delete']) && ctype_digit($_GET['delete']) ? abs(@intval($_GET['delete'])) : null; if(!empty($_GET['delete'])) { $select = $db->query(sprintf("SELECT `imgID` FROM `userimages` WHERE ((`imgUSER` = %u) AND (`imgID` = %u))", $ir['userid'], $_GET['delete'])); if(!$db->num_rows($select)) { echo "Either that image doesn't exist, or it's not yours"; $h->endpage(); exit; } $db->query(sprintf("DELETE FROM `userimages` WHERE (`imgID` = %u)", $_GET['delete'])); echo "Image deleted from gallery.<hr width='90%'>"; } $_GET['set'] = isset($_GET['set']) && ctype_digit($_GET['set']) ? abs(@intval($_GET['set'])) : null; if(!empty($_GET['set'])) { $image = $db->query(sprintf("SELECT `imgURL` FROM `userimages` WHERE ((`imgID` = %u) AND (`imgUSER` = %u))", $ir['userid'], $_GET['set'])); if(!$db->num_rows($image)) { echo "Either that image doesn't exist, or it's not yours"; $h->endpage(); exit; } $db->query(sprintf("UPDATE `users` SET `display_pic` = '%s' WHERE (`userid` = %u)", $db->fetch_single($image), $ir['userid'])); echo "New display image set.<hr width='90%'>"; } $_GET['XID'] = isset($_GET['XID']) && ctype_digit($_GET['XID']) ? abs(@intval($_GET['XID'])) : null; if(empty($_GET['XID'])) { echo "No user submitted<hr width='90%'>> <a href='explore.php'>Back to city</a><hr width='90%'>"; $h->endpage(); exit; } $select = $db->query(sprintf("SELECT `ui`.`imgUSER`, `u`.`username` " . "FROM `userimages` AS `ui` " . "LEFT JOIN `users` AS `u` ON (`ui`.`imgUSER` = `u`.`userid`) " . "WHERE (`ui`.`imgUSER` = %u) ", $_GET['XID'])); if(!$db->num_rows($select)) { echo "Either that player doesn't exist, or they haven't uploaded any images"; $h->endpage(); exit; } $player = $db->fetch_row($select); echo "<strong>",stripslashes(htmlspecialchars($player['username'])),"'s uploaded images</strong>"; if(!$db->num_rows($q)) { ?><table width='90%' bgcolor=#DFDFDF><tr><td><center>This user has no uploaded images</center></td></tr></table><hr width='90%'>> <a href='viewuser.php?u=<?php echo $y['userid']; ?>'>Back to profile</a><hr width='90%'><?php $h->endpage(); exit; } echo "<table width='90%' bgcolor=#DFDFDF cellpadding='3'><tr>"; $br = 0; $cn = 0; $div = ''; while($row = $db->fetch_row($select)) { if($br == 3) { $div = "</tr><tr>"; $br* = 0; } echo "<td align='center'><strong>#$cn Profile image</strong><a href='userimages.php?action=view&ID=",$row['imgUSER'],"'>View</a>"; if($_GET['XID'] == $ir['userid']) { echo "[<a href='userimages.php?XID=",$row['imgUSER'],"'>Delete</a>] [<a href='userimages.php?XID=",$row['imgUSER'],"'>Set Image</a>]"; } echo "</td>",$div; ++$br; ++$cn; } echo "</tr></table><hr width='90%'>> <a href='viewuser.php?u=",$player['imgUSER'],"'>Back to profile</a><hr width='90%'>"; } function view_image() { global $db, $ir, $h; $_GET['ID'] = isset($_GET['ID']) && ctype_digit($_GET['ID']) ? abs(@intval($_GET['ID'])) : null; $e = $db->query(sprintf("SELECT `imgURL` FROM `userimages` WHERE (`imgID` = %u)", $_GET['ID'])); if(!$db->num_rows($e)) { echo "Either that player doesn't exist, or they have no images"; $h->endpage(); exit; } echo "<img src=",stripslashes($db->fetch_single($e))," /><hr width='90%'>> <a href='userimages.php?XID=",$_GET['ID'],">Back to images</a><hr width='90%'>"; } $h->endpage(); ?>
-
Working on it now.. Just really struggling with a 5 month old boy who's just found his voice -.-
-
Untested Replace the gang_kidnap() function in yourgang.php with this: function cleanKill($msg = 'Something happened..') { global $h; ?><div style='color: #D8000C;background-color: #FFBABA;border: 1px solid;background-repeat: no-repeat;background-position: 10px center;width: 40%;border-radius: 15px;margin: 10px 0;padding: 15px 10px 15px 50px;'><strong>ERROR!</strong><?php echo $msg; $h->endpage(); exit; } function gang_event_add($gangID, $event) { global $db; $db->query(sprintf("INSERT INTO `gangevents` VALUES ('', %u, %s, '%s')", $gangID, time(), $db->escape($event))); } function format($str, $dec = 0) { return ctype_digit($str) ? number_format($str, $dec) : stripslashes(htmlspecialchars($str)); } function player($id, $escape = 0) { global $db; $selectPlayer = $db->query(sprintf("SELECT `username` FROM `users` WHERE (`userid` = %u)", $id)); return sprintf("<a href='viewuser.php?u=%u'>%s</a> [%s]", $id, format($db->fetch_single($selectPlayer)), format($id)); } function gang_kidnap() { global $db, $ir, $h, $gangdata; $_GET['u'] = isset($_GET['u']) && ctype_digit($_GET['u']) ? abs(@intval($_GET['u'])) : null; if(empty($_GET['u'])) cleanKill("You didn't select a valid gang member"); if(!$ir['gang']) cleanKill("You're not in a gang, you can't do this"); if($ir['gang'] == $gangdata['gangID']) cleanKill("You can't kidnap your own members..."); $select = $db->query(sprintf("SELECT `gangID` FROM `gangs` WHERE ((`gangPRESIDENT` = %1\$u) OR (`gangVICEPRES` = %1\$u))", $ir['userid'])); if(!$db->num_rows($select)) cleanKill("You're not the President or Vice President of your gang. You can't do that"); if(in_array($_GET['u'], array($gangdata['gangPRESIDENT'], $gangdata['gangVICEPRES']))) cleanKill("You can't kidnap the President or Vice President"); $select = $db->query(sprintf("SELECT `gang` FROM `users` WHERE (`userid` = %u)", $_GET['u'])); if(!$db->num_rows($select)) cleanKill("That player doesn't exist"); if($db->fetch_single($select) != $gangdata['gangID']) cleanKill(player($_GET['u'])." isn't in that gang"); $selectRansoms = $db->query(sprintf("SELECT `gkID` FROM `gangKidnaps` WHERE (`gkUser` = %u)", $_GET['u'])); if($db->num_rows($selectRansom)) cleanKill(player($_GET['u'])." is already being held ransom"); if(!isset($_POST['submit'])) { echo "<h3>Kidnapping ",player($_GET['u'])," from ",format($gangdata['gangNAME']),"</h3>"; ?><form action='gangs.php?action=view&ID=<? echo $gangdata['gangID']; ?>&u=<? echo $_GET['u']; ?>' method='post'> <table class='table' width='75%' cellspacing='1'> <tr> <th width='45%'>Ransom</th> <td width='55%'>$<input type='number' name='ransom' value='2000' /></td> </tr> <tr> <td colspan='2' class='center'><input type='submit' name='submit' value='Kidnap' /></td> </tr> </table> </form><? } else { $_POST['ransom'] = isset($_POST['ransom']) && ctype_digit($_POST['ransom']) ? abs(@intval($_POST['ransom'])) : null; if(empty($_POST['ransom'])) cleanKill("You didn't enter a valid ransom"); $chance = mt_rand(1, 5); if(in_array($chance, array(1, 3))) { $db->query(sprintf("INSERT INTO `gangKidnaps` VALUES ('', %u, %u, %u, %s, %u)", $ir['gang'], $gangdata['gangID'], $_GET['u'], time(), $_POST['ransom'])); $gEventTheirs = sprintf("%s has kidnapped %s from %s. You have 1 hour to pay the ransom", player($ir['userid']), player($_GET['u']), format($gangdata['gangNAME'])); $gEventMine = sprintf("%s has kidnapped %s from %s. They have 1 hour to pay the ransom", player($ir['userid']), player($_GET['u']), format($gangdata['gangNAME'])); echo "You've kidnapped ",player($_GET['u'])," from ",format($gangdata['gangNAME']); } else if(in_array($chance, array(2, 4))) { $getAnother = $db->query(sprintf("SELECT `userid` FROM `users` WHERE ((`gang` = %u) AND (`userid` != %u)) ORDER BY RAND() LIMIT 1", $gangdata['gangID'], $_GET['u'])); if(!$db->num_rows($getAnother)) echo "You failed to kidnap ",player($_GET['u']); else { $another = $db->fetch_single($getAnother); $db->query(sprintf("INSERT INTO `gangKidnaps` VALUES ('', %u, %u, %u, %s, %u)", $ir['gang'], $ir['gang'], $another, time(), $_POST['ransom'])); $gEventTheirs = sprintf("%s attempted to kidnap %s from %s but failed. Instead, they got %s", player($ir['userid']), player($_GET['u']), player($another)); $gEventMine = sprintf("%s attempted to kidnap %s from %s but failed. Instead, they got %s", player($ir['userid']), player($_GET['u']), player($another)); echo "You failed to kidnap ",player($_GET['u']),", but you managed to get ",player($another)," instead"; } } else { $gEventTheirs = sprintf("%s attempted to kidnap %s from %s, but failed", player($ir['userid']), player($_GET['u']), format($gangdata['gangNAME'])); $gEventMine = sprintf("%s attempted to kidnap %s from %s, but failed", player($ir['userid']), player($_GET['u']), format($gangdata['gangNAME'])); } gang_event_add($gangdata['gangID'], $gEventTheirs); gang_event_add($ir['gang'], $gEventMine); } } Any bugs, post here Thank you :)
-
100% currently, I can easily modify it to have the chance effect if you'd like?
-
Fixed Converted