-
Posts
708 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by CrazyT
-
Re: Honor Market - My Mod! Well check $_GET['st'] ?... Also says your mod? This is just rewrite of a crystal market. lol
-
Re: [v2] Preventing bad words and advertsing For username.. if (!$_POST['newname'] || strlen($_POST['newname'] = trim($_POST['newname'])) == 0) { echo 'Username not entered.'; } else if (strlen($_POST['newname']) < 4) { echo 'Username below 4 characters.'; } else if (strlen($_POST['newname']) > 20) { echo 'Username above 20 characters.'; } else if (!preg_match('/^([a-z0-9._-])+$/ims', $_POST['newname'])) { echo 'Username can only contain alphanumeric characters, the underscore, dash and period.'; } else { //Update query here.. } XD
-
Community work on attack system :D (for coders only)
CrazyT replied to plintu's topic in Requests & In Production
Re: Community work on attack system :D (for coders only) 1# Check if its set.. isset(), check if its all numbers.. preg_match()/ctype_*/is_numeric/ ect 2# if anythink is not set if (!$_GET['ID'], || $db->num_rows($sql) < 1,,,, Does the user exist? 3# You script dont check all that.. Witch is what i see on loads of mods, they dont check what is what, if it exists or what.. -
Re: Locked Account Mod [V2] I knew you would just for me. LMFAO!
-
Re: Locked Account Mod [V2] Yeah takes longer to read there post when they do that. lol I never actually noticed that but its true, it does take longer. Weird lol Yup. :lol:
-
Community work on attack system :D (for coders only)
CrazyT replied to plintu's topic in Requests & In Production
Re: Community work on attack system :D (for coders only) 1# No need to mysql_real_escape_string(), $_GET['ID']. Could just do. $_GET['ID'] = isset($_GET['ID']) && preg_match("/^\d+$/ims", $_GET['ID']) ? intval($_GET['ID']) : 0; $checkUser = $db->query('SELECT userid FROM users WHERE userid = '. $_GET['ID']); if(!$_GET['ID'] || $db->num_rows($checkUser) < 1) { echo 'This user don\'t exist.'; die(headers::endpage()); } 2# $ustr=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid"); $u=mysql_fetch_array($ustr); That is point less, its already being called from globals. 3# $mestr=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$get"); $me=mysql_fetch_array($mestr); All of the coloums from users/userstats don't all need to be called. 4# There is loads of error's in the script. 5# Why use so many variables. EG Point less and slowing the code down. Hope it helps you. lol -
Re: Honor Market - My Mod! $st=($_GET['st']) ? $_GET['st'] : 0; $cnt = $db->query("SELECT rw.*, u.* FROM honormarket rw LEFT JOIN users u ON u.userid=rw.rwADDER ORDER BY rwPRICE/rwQTY ASC LIMIT $st,15"); Might want to secure it :lol:
-
Re: [v2] Preventing bad words and advertsing Or.. simple preg_match.. if (preg_match('/(bitch|more|words|in|here|lol)/ims', trim($_POST['message']))) { echo 'This message could not be sent.'; die(headers::endpage()); }
-
Re: smarty templating system Or maybe something like.. $users = array(); $sql = mysql_query('SELECT * FROM `users`;'); if ( mysql_num_rows($sq) > 0 ) { while ( $row = mysql_fetch_assoc($sql) ) $users[] = $row; } $smarty->assign('users', $users); But im not 100% sure tho. lol
-
Re: smarty templating system Then you will do something like this.. <?php include_once 'smarty.configfile.php'; include_once 'somethingelse.php'; //this is a function i use for inside db class. function GetAll($query) { $rs = $this->Execute($query); if( !is_resource($rs) ) return false; $rows = array(); while ($row = mysql_fetch_assoc($rs)) { $rows[] = $row; } mysql_free_result($rs); return $rows; } //Then you do something like.. $users = $db->GetAll('SELECT * FROM `users`'); $smarty->assign('users', $users); <table> {foreach from=$users name="users"} <tr bgcolor="{cycle values="#aaaaaa,#bbbbbb"}"> <td>{$users.name|htmlspecialchars}</td> <td>{$users.phone}</td> </tr> {/foreach} </table> Hope it helps.. XD
-
Re: SUPER SMALL Bank Interest Mod Wont work were is $ir coming from in the cron ;)
-
Re: Locked Account Mod [V2] Yeah takes longer to read there post when they do that. lol
-
Re: smarty templating system Wait.. shouldn't $data be like.. $data = array('name' => array('tom', 'tommy'), 'phone' => array('55a35-3425', '55a35-3425')); Here is a link.. http://smarty.net/crashcourse.php scroll down you will see.
-
Re: smarty templating system Try <table> {foreach from=$users name="users"} <tr bgcolor="{cycle values="#aaaaaa,#bbbbbb"}"> <td>{$users.name|htmlspecialchars}</td> <td>{$users.phone}</td> </tr> {/foreach} </table>
-
Re: Staff Contact Is there any need to select like 60+ things from users table, all you need to select is (userid, username)
-
Re: [mccode] Icons <?php // for colors function display_icons($u,$i = array()) { $i = ""; if ($b = $u['gender']) { $t = strtolower($b); $i .= "[img=images/icons/$t.png]\n"; } if ($n = $u['new_announcements']) { $t = "$n New Announcement".($n == 1 ? "" : "s"); $i .= "[img=images/icons/announcements.png]\n"; } if ($y = $u['new_mail']) { $t = "$y New Mail".($y == 1 ? "" : "s"); $i .= "[img=images/icons/mail.png]\n"; } if ($n = $u['new_events']) { $t = "$n New Event".($n == 1 ? "" : "s"); $i .= "[img=images/icons/events.png]\n"; } if ($a = max($u['bankmoney'],0) + max($u['cybermoney'],0)) { $fa = "$" . number_format($a) . " Banked"; $i .= "[img=images/icons/bank.png]\n"; } if ($z = $u['jobrank']) { $rs = mysql_query("SELECT CONCAT(\"Working as \", `jrNAME`, \" in \", `jDESC`) FROM `jobranks` LEFT JOIN `jobs` ON `jrJOB` = `jID` WHERE (`jrID` = $z)"); $row = mysql_fetch_array($rs); mysql_free_result($rs); $i .= "[img=images/icons/working.png]\n"; } if (($p = $u['course']) && $u['cdays']) { $rs = mysql_query("SELECT CONCAT(\"Studying \", `crName`) FROM `courses` WHERE (`crID` = $p)"); $row = mysql_fetch_row($rs); mysql_free_result($rs); $i .= "[img=images/icons/studying.png]\n"; } if (isset($i) && $i != "") echo "<div id='icons'>\n".$i."<hr /></div>"; } Same code but different way i done it :D and no sprintf() :D
-
Re: How to change Id number Yeah eg.. Messages,events,logs ect
-
Re: How to change Id number You will need to logout the game, because your old session is still alive.
-
Re: honor exchange help Wrong. Item add is like. item_add(USERID, ITEMID, QTYOFITEM);
-
Re: [mccode] Icons Have you added that function to the header Class File?
-
Re: Attack System [Paid Request] You forgot to add, was it secure? No. :D
-
Re: YoungGold.co.uk V2 Yeah i only see like yours.
-
Re: YoungGold.co.uk V2 Looks nice but looks cut of a little on mine? http://i25.tinypic.com/6p1bhx.jpg Ms paint messed it up a little lol was saved as .gif
-
Re: honor exchange help Maybe read up what they do and learn? like most people do?.. www.php.net/strip_tags www.php.net/abs www.php.net/int
-
Re: Crack the Safe But half posts are just like BITE ME.. Wtf? lol