-
Posts
2,146 -
Joined
-
Last visited
-
Days Won
149
Content Type
Profiles
Forums
Events
Everything posted by Magictallguy
-
Re: Main Menu I hate IE anyway :P and reading through what you said now makes more sense to me than it did when you first posted it... Thanks again :) Hmm... I suggest you read up on CSS selectors MTG. ID's are required to be unique within a page, however classes may be shared. Making basic assumptions here can cause a lot of problems later on down the line. Learn the basic CSS standards (which are of course generally ignored by Internet Explorer - but that's something you will have to live with).
-
Re: Burn House for V2 $db->query(sprintf("UPDATE `users` SET `money` = `money` + '%d', `warehouse` = `warehouse` + '%d' WHERE `userid` = ('%u')", $cash, 1, $userid));
-
Re: random.php Obviously...
-
Re: Crimes give random money Looking good jamboy :)
-
Re: learning mysql_real_escape_string just need to verify. htmlentities() / htmlspecialchars() comes into play here I believe?
-
[mccode] Simplify for V1 (and make it easier to use V2 mods)
Magictallguy replied to Yuri_orlov's topic in Free Modifications
Re: Simplify for V1 (and make it easier to use V2 mods) I put <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header('Location: login.php');exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.*,h.*,p.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN houses h ON h.hWILL=u.maxwill LEFT JOIN persnotes p ON u.userid=p.notesID WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); check_crimexp(); get_gamerank(); $fm=money_formatter($ir['money']); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm); $h->menuarea(); ?> into a file called v1.php I created another file called status.php <?php include(DIRNAME(__FILE__) . '/v1.php'); if($ir['jail'] > 0) { echo sprintf("You're in jail for %s more minute%s ", number_format($ir['jail']), ($ir['jail'] == 1) ? "" : "s"); } if($ir['hospital'] > 0) { echo sprintf("You're in hospital for %s more minute%s ", number_format($ir['hospital']), ($ir['hospital'] == 1) ? "" : "s"); } ?> Then just include v1.php in every file (or leave as it is..) and include status.php in whichever files you want. Or you could change echo() into die() and include into the files you don't want your users to get into while in jail/hospital A slightly longer way, but it works for me! -
Re: online/offline/total users This one: <?php //Be sure to remove this tag - I put it in because it looks nicer on here :P $sql = "SELECT COUNT(userid) FROM users"; $rs = mysql_query($sql); $row = mysql_fetch_array($rs); $total_users = $row[0]; $sql = sprintf("SELECT COUNT(userid) FROM users WHERE (laston > %u)", time() - 900); $rs = mysql_query($sql); $row = mysql_fetch_array($rs); $users_online = $row[0]; $users_offline = $total_users - $users_online; /* Be sure to remove this tag too!! */ ?>
-
Re: random.php Just showing the irony in telling people to learn to spell when they, evidently, can't!
-
Re: Updated Explore V.2 I'm about to make it but I won't be posting it on here due to the fact that Joker is here... We've had an interesting dispute. Anything I make will not be provided to him. Anything who wishes to gain a copy will have to catch me on MSN or gain it via PM on here MSN: [email protected]
-
Re: random.php Maybe you should learn to spell please. Then maybe you could re-attempt it. And I guess it wasn't bad for a first try either All words in bold are words that you spelt wrong. Have a nice day.
-
Re: Updated Explore V.2 Haven't created it yet.. But soon..
-
Re: Login [Free] He's one step ahead of you xD
-
Re: Register [Free] Just remove this -.- $t = mysql_query("SELECT * FROM ips WHERE userIP='{$IP}'"); if($a = mysql_num_rows($t)> 0) { die('YOU ARE BANNED NOW BYE!'); }
-
Re: Login [Free] Confirmed, he did make it before I saw it.
-
mccode-v2 Crimes (Players Can Go To Hospital)
Magictallguy replied to jamboy1's topic in Free Modifications
Re: Crimes (Players Can Go To Hospital) [V2] ALTER TABLE `crimes` ADD ( `crimeHTEXT` text NOT NULL DEFAULT '', `crimeHOSPTIME` int(10) NOT NULL default '0', `crimeHREASON` varchar(255) NOT NULL default '' ); -
Re: Media Area/Room Simple, yet effective. Although I won't be using it, I do like it :)
-
Re: [v2]Html text converter[v2] Thanks for the shoutout The Ace :D
-
Re: Multiple Houses [V2] <?php //remember to remove the php tags echo ("<table width='95%' class='table' border='1' cellpadding='2' cellspacing='1'>"); echo ("<tr>"); echo ("<th>Name</th>"); echo ("<th>Price</th>"); echo ("<th>Will</th>"); echo ("<th>Link</th>"); echo ("</tr>"); $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC",$c); while($r=$db->fetch_row($hq)) { echo ("<tr>"); echo sprintf("<td style='text-align:center;'>%s</td>", $r['hNAME']); echo sprintf("<td style='text-align:right;'>%s</td>", number_format($r['hPRICE'])); echo sprintf("<td style='text-align:right;'>%s</td>", number_format($r['hWILL'])); echo sprintf("<td style='text-align:center;'>[[url='estate.php?ID=%u']Buy[/url]]</td>", $r['hID']); echo ("</tr>"); } echo ("</table>"); ?>
-
Re: Updated Explore V.2 Not hard to do if you think about it. Take my "multi-page newspaper mod" into account. A simple SQL table will be sufficient.. Joker, no... -.- And I'll be creating it free. Give me an hour or so :P
-
Re: crystal bank Yea.. it's "Magictallguy", although I do like Metallica....
-
Re: Quote Mod if(strlen($q) > 255) { echo 'Quotes can only have upto 255 characters'; echo ' '; echo '[url="preferences.php?action=uq"]Back[/url]'; } That's why that is there -.-
-
Re: crystal bank For the sake of The Joker, sprintf() has been implemented.. Joker, sprintf() on it's own, will offer little protection. Combine it with mysql_real_escape_string() and you'll have a file fit for a king.. (or Nyna..) Secured Crystal Bank <?php include (DIRNAME(__FILE__) . "/globals.php"); //Learn to secure your script! //And code properly for that matter -.- //Secured by Magictallguy print "<h3>Crystal Bank</h3>"; if($ir['crystalbank']>-1) { //Addition of the functions below to stop a hidden error. (Use error_reporting(E_ALL); too see what I mean... $_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? strtolower(trim($_GET['action'])) : ""; switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money'] > 25000) { print "Congratulations, you bought a crystal bank account for \$25,000! [url='crystalbank.php']Start using my account[/url]"; $sql = sprintf("UPDATE users SET money = money - %u WHERE (userid = %u)", 25000, $userid); $db->query($sql); } else { die("You do not have enough money to open an account, it costs \$25,000 for an account [url='explore.php']Back to town...[/url]"); } } else { print "Open a crystal bank account today, just \$25,000! [url='crystalbank.php?buy']> Yes, sign me up![/url]"; } } function index() { global $db, $ir, $c, $userid, $h; $s = ($_POST['deposit'] == 1) ? "" : "s"; //Outputs: //0 crystals //1 crystal //2 crystals echo sprintf("[b]You currently have %s crystal%s in your crystal bank.[/b] ", number_format($ir['crystalbank']), $s); echo ("<table width='85%' cellspacing=1 class='table'>"); echo ("<tr>"); echo ("<td width='50%'>[b]Deposit crystal[/b] "); echo ("<form action='crystalbank.php?action=deposit' method='post'>"); echo sprintf("Amount: <input type='text' name='deposit' value='%u' /> ", $ir['crystalbank']); echo ("<input type='submit' value='Deposit' /></form></td>"); echo ("<td width='50%'>[b]Withdraw crystals[/b] "); echo ("There is no fee on withdrawals.<form action='crystalbank.php?action=withdraw' method='post'>"); echo sprintf("Amount: <input type='text' name='withdraw' value='%u' /> ", $ir['crystalbank']); echo ("<input type='submit' value='Withdraw' /></form></td>"); echo ("</tr>"); echo ("</table>"); } function deposit() { global $db, $ir, $c, $userid, $h; $_POST['deposit'] = (float) $_POST['deposit']; if($_POST['deposit'] > $ir['crystals']) { print "You do not have enough crystals to deposit in the bank."; } else { $gain=$_POST['deposit']-$fee; $ir['crystals']+=$gain; $sql = sprintf("UPDATE users SET crystalbank = crystalbank + %u, crystals = crystals - %u WHERE (userid = %u)", mysql_real_escape_string($gain), mysql_real_escape_string($_POST['deposit']), $userid); //You MUST ALWAYS escape everything,, unless you want hackers to gain access? $db->query($sql); $s = ($_POST['deposit'] == 1) ? "" : "s"; //Outputs: //0 crystals //1 crystal //2 crystals echo sprintf("You hand over %s crystal%s to be deposited, ", number_format($_POST['deposit']), $s); echo sprintf(" is added to your account. ", number_format($gain)); echo sprintf("[b]You now have %s crystal%s in the bank.[/b] ", number_format($ir['crystalbank']), $s); echo ("[url='crystalbank.php']> Back[/url]"); } } function withdraw() { global $db,$ir,$c,$userid,$h; $_POST['withdraw'] = (float) $_POST['withdraw']; if($_POST['withdraw'] > $ir['crystalbank']) { print "You do not have enough crystals to withdraw from the bank."; } else { $gain=$_POST['withdraw']; $ir['crystalbank']-=$gain; $sql = sprintf("UPDATE users SET crystalbank = crystalbank - %u, crystals = crystals + %u WHERE (userid = %u)", mysql_real_escape_string($gain), mysql_real_escape_string($gain), $userid); $db->query($sql); $s = ($_POST['deposit'] == 1) ? "" : "s"; //Outputs: //0 crystals //1 crystal //2 crystals echo ("You ask to withdraw , ", number_format($gain), $s); echo ("the banking lady grudgingly hands it over. "); echo ("[b]You now have %s crystal%s in the bank.[/b] ", number_format($ir['crystalbank']), $s); echo ("[url='crystalbank.php']> Back[/url]"); } } $h->endpage(); ?>
-
Re: crystal bank Before posting all over CE what I'm attempting to teach you, actually learn it? Brilliant quote from Nyna .. You should take heed Chris..
-
Re: contact staff [v2] As this is v2, session_start(); is not required.. That is already in the globals.php..
-
Re: Religions Mod This is only true if your users are to stupid to open their eyes and see the person for who they are, and not what they believe in..