Jump to content
MakeWebGames

Paul Evans

Members
  • Posts

    783
  • Joined

  • Last visited

Everything posted by Paul Evans

  1. [mysql]SELECT count FROM `userstats` us LEFT JOIN `users` u ON us.`userid`=u.`userid` WHERE us.`strength` > {$ir['strength']} AND us.userid != $userid AND u.user_level != 0[/mysql]If i recall you would also need to identify what your counting but i maybe wrong, that would work im sure if your running on $ir and $userid
  2. ah good point EQ my bad
  3. LOL can tell im not a user of GRPG, Ok maybe mysql_num_rows isn't actually in their class (that's if they use a class) i guess since you don't add the connection into the end they edit it somehow. May be best to have a quick look (i don't have the GRPG engine or i would).
  4. <? include 'nliheader.php'; if (isset($_POST['submit'])) { $username = strip_tags($_POST['newname']); $signuptime = time(); $password = $_POST['newpass']; $password2 = $_POST['newpassagain']; $email = $_POST['email']; $message = ''; $checkuser = mysql_query('SELECT * FROM `grpgusers` WHERE `username`="'.$username.'"'); if ( mysql_num_rows($checkuser) > 0 ){ $message .= "<div>I'm sorry but the username you chose has already been taken. Please pick another one.</div>"; } if ( strlen($username) < 4 or strlen($username) > 20 ){ $message .= "<div>The username you chose has " . strlen($username) . " characters. You need to have between 4 and 20 characters.</div>"; } if ( strlen($password) < 4 or strlen($username) > 20 ){ $message .= "<div>The password you chose has " . strlen($password) . " characters. You need to have between 4 and 20 characters.</div>"; } if ( $password != $password2 ){ $message .= "<div>Your passwords don't match. Please try again.</div>"; } if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { // ereg is deprecated $message .= "<div>The e-mail address you entered was invalid.</div>"; } //insert the values if ( !isset($message) ){ $result= mysql_query("INSERT INTO `grpgusers` (ip, username, password, email, signuptime, lastactive)". "VALUES ('".$_SERVER['REMOTE_ADDR']."', '$username', '$password', '$email', '$signuptime', '$signuptime')"); echo Message('Your account has been created successfully! Redirecting to login page in 5 seconds. <meta http-equiv="refresh" content="5;url=login.php">'); if ( $_POST['referer'] != "" ){ $result= mysql_query("INSERT INTO `referrals` (`when`, `referrer`, `referred`)". "VALUES ('$signuptime', '".$_POST['referer']."', '".$username."')"); } die(); } } ?> <? if ( isset($message) ) { echo Message($message); } ?> <tr><td class="contenthead"> .: Register </td></tr> <tr><td class="contentcontent"> <table width='28%' border='0' align='center' cellpadding='0' cellspacing='0'> <form name='register' method='post' action='register.php'> <tr> <td height='26'><font size='2' face='verdana'>Username</font></td> <td><font size='2' face='verdana'> <input type='text' name='newname'> </font></td> </tr> <tr> <td height='28'><font size='2' face='verdana'>Password</font></td> <td><font size='2' face='verdana'> <input type='password' name='newpass'> </font></td> </tr> <tr> <td height='28'><font size='2' face='verdana'>Confirm Password</font></td> <td><font size='2' face='verdana'> <input type='password' name='newpassagain'> </font></td> </tr> <tr> <td height='26'><font size='2' face='verdana'>Email address</font></td> <td><font size='2' face='verdana'> <input type='text' name='email'> </font></td> </tr> <tr> <td></td> <td><font size='2' face='verdana'> <input type='hidden' name='referer' value='<? echo $_GET['referer'] ?>'> <input type='submit' name='submit' value='Register'> </font></td> </tr> </table> </form> <center> © 2007 MyNeoCorp Productions </center> </td></tr> <? include 'nlifooter.php'; ?>
  5. Lines 11 - 17 $checkuser = mysql_query("SELECT * FROM `grpgusers` WHERE `username`='$username'"); $username_exist = mysql_num_rows($checkuser); if($username_exist > 0){ $message .= "<div>I'm sorry but the username you chose has already been taken. Please pick another one.</div>"; } Replace with the code i pasted earlier (1 post back).
  6. $checkuser = mysql_query('SELECT * FROM `grpgusers` WHERE `username` = "'.$username.'"'); if( mysql_num_rows($checkuser) != 0){ $message .= "<div>I'm sorry but the username you chose has already been taken. Please pick another one.</div>"; }
  7. $checkuser = mysql_query("SELECT * FROM `grpgusers` WHERE `username`='{$username}'");
  8. [img=images/title.jpg] yeah but remember the DIR images is only a example, you could on another hand not change the html at all and simply just upload title.jpg (your image im guessing) to your public_html (depending on if that's the actually main DIR of your website) and overwrite the existing title.jpg. background colour i believe is set by rather CSS or $bgcolor.
  9. if your using a free host i would suggest maybe byethost.com they are rather reliable when it comes to loading cpanel and giving ftp access.
  10. open header.php CTRL+F title.jpg and then when you find it simple replace it with the other image (including DIR for example if you uploaded it to the images folder it would be images/image.jpg (image.jpg is just a example)) save and upload.
  11. Sorry if i don't understand but your wanting to change the title image to another you have uploaded?
  12. If you wanted to advance it a little more maybe add something like [mysql]ALTER TABLE `items` ADD `itm_addon` varchar(75) NOT NULL DEFAULT '';[/mysql] item simply have something like // due to already fetching all the fields from the table no need for a fetch query if ( !empty($item['itm_addon']) ) { $itm_addon = explode(':', $item['itm_addon']); // this is a optional method you could use the other method below and remove this line // echo $item['itm_addon']; // This relies on itm_addon being formatted into the html when inputting into the db (quite easy to do) echo '[url="'.$itm_addon['0'].'"]'.$itm_addon['1'].'[/url]'; // remove this line if using method on above line } Obviously you'd format it either with html on input or output.. HTML on output (inputting method) // note i can't recall the exact method of MCC item dropdown so i apologise in advance but this is only a example $_POST['name'] = ( isset($_POST['name']) && ctype_alnum($_POST['name']) ) ? $_POST['name'] : 0 ; $_POST['file'] = ( isset($_POST['file']) && is_string($_POST['file']) ) ? $_POST['file'] : 0 ; // this isn't perfect security it's just for the example $_POST['item'] = ( isset($_POST['item']) && ctype_digit($_POST['item']) ) ? $_POST['item'] : 0 ; if ( !empty($_POST['file']) && !empty($_POST['name']) && !empty($_POST['item'] ) { $db->query('UPDATE `item` SET `item_addon` = "'.$_POST['file'].':'.$_POST['name'].'" WHERE `itmid` = '.$_POST['item']); echo 'Updated!'; } else { echo ' <form action="" method="post"> Item: '.item_dropdown('item',$c).' File: <input type="text" name="file" value="" /> Name: <input type="text" name="name" value="" /> <input type="submit" value="Submit" /> </form> '; } HTML on input (inputting method) // note i can't recall the exact method of MCC item dropdown so i apologise in advance but this is only a example $_POST['name'] = ( isset($_POST['name']) && ctype_alnum($_POST['name']) ) ? $_POST['name'] : 0 ; $_POST['file'] = ( isset($_POST['file']) && is_string($_POST['file']) ) ? $_POST['file'] : 0 ; // this isn't perfect security it's just for the example $_POST['item'] = ( isset($_POST['item']) && ctype_digit($_POST['item']) ) ? $_POST['item'] : 0 ; if ( !empty($_POST['file']) && !empty($_POST['name']) && !empty($_POST['item'] ) { $db->query('UPDATE `item` SET `item_addon` = "[url='.$_POST[']'.$_POST['name'].'[/url]" WHERE `itmid` = '.$_POST['item']); echo 'Updated!'; } else { echo ' <form action="" method="post"> Item: '.item_dropdown('item',$c).' File: <input type="text" name="file" value="" /> Name: <input type="text" name="name" value="" /> <input type="submit" value="Submit" /> </form> '; } Hope this helps
  13. interesting, i may need to check which one im using but im sure i made one lol EDIT: Your right it's one from google somewhere the one i was making isn't complete (typical).
  14. Personally i don't like MW but i did play for about a hour so i can't really comment. I do although like their layout and some of their methods.
  15. I made a quick captcha for my game subscription.
×
×
  • Create New...