Jump to content
MakeWebGames

nanolimit

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Everything posted by nanolimit

  1. Re: Email Activation just reference it off the code and its easy enough to see: $db->query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup, Random_key) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', 0, '$IP', '$IP', '".random_string('alnum', 32)."')"); from memory, changing it to 0 meant you got a basic bank to start with. without having to open it.
  2. Re: Email Activation   See what i mean mate i put your bad grammar in bold and its good to get used to speaking and writing correctly or no one will take you seriously later in life. And you aren't charging us, fair point but isn't the reason people add free mods to CE is to help others that can't code as good as you? notice the bold, fail. If you'd like to get grammar nazi then: im - punctuation, not grammar. engrish - slang, not grammar (will also accept as a reference to meme). "sorry about the lack of reply", lacking an S in reply would mean a plural, im referring in singles. and no, I added the mod because I saw it as a request, that's the only reason. lolin' at later in life comment, im 22 and working full time and no issues yet :O kiddie forums are serious business
  3. Re: Email Activation sorry about the lack of reply, my instructions where fine l2engrish ;) its not like im charging you for it like the other validation mods. anyway! random_string isn't being found because you either: didn't include rfuctions didn't create rfunctions didn't do either of the above edit: and thanks radio_active for clearing it up, as was said if you couldn't understand what I was getting at then this mod isn't for you. I didn't post it as an educational for people to learn off.
  4. Wroting this for my V2 game ages ago, as I no longer host the game I figured I'd post it as I saw it as a request. should work with V1 with very little (if any) modification mysql: ALTER TABLE `users` ADD `Random_key` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL , ADD `activated` INT( 1 ) NOT NULL DEFAULT '0';   Create page activate.php <?php include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; include('rfunctions.php'); // if($_GET['ID']!='' && numeric($_GET['ID'])==TRUE && strlen($_GET['key'])==32 && alpha_numeric($_GET['key'])==TRUE) // { $query = mysql_query("SELECT userid, Random_key, activated FROM users WHERE userid = '".mysql_real_escape_string($_GET['ID'])."'"); if(mysql_num_rows($query)==1) { $row = mysql_fetch_assoc($query); if($row['activated']==1) { $error = 'This member is already active !'; } elseif($row['Random_key']!=$_GET['key']) { $error = 'The confirmation key that was generated for this member does not match with the one entered !'; } else { mysql_query("UPDATE users SET activated=1 WHERE userid=".$_GET['ID']."") or die(mysql_error()); $msg = 'Congratulations ! You just activated your account! You can now login [url="login.php"]here[/url]'; } } else { $error = 'User not found !'; } // } // else { // // $error = 'Invalid data provided !'; // } // print "[b]ID[/b]: ". $_GET['ID'] . " [b]key[/b]: " . $_GET['key'] . " "; if(isset($error)) { echo $error; } else { echo $msg; } ?>   Create page rfunctions.php   <?php function random_string($type = 'alnum', $len = 8) { switch($type) { case 'alnum' : case 'numeric' : case 'nozero' : switch ($type) { case 'alnum' : $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 'numeric' : $pool = '0123456789'; break; case 'nozero' : $pool = '123456789'; break; } $str = ''; for ($i=0; $i < $len; $i++) { $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); } return $str; break; case 'unique' : return md5(uniqid(mt_rand())); break; } } function alpha_numeric($str) { return ( ! preg_match("/^([-a-z0-9])+$/i", $str)) ? FALSE : TRUE; } function numeric($str) { return ( ! ereg("^[0-9\.]+$", $str)) ? FALSE : TRUE; } ?>   edit register.php find $i=$db->insert_id(); $db->query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10)");   ABOVE edit the the query. after '{$_POST['email']}', 0, '$IP', '$IP',   add   random_string('alnum', 32)   below the insert add:   // get data just entered $getUser = mysql_query("SELECT userid, login_name, email, Random_key FROM users WHERE login_name = '{$username}'") or die(mysql_error()); $row = mysql_fetch_assoc($getUser); // Send rego email $stamp = unix_timestamp; $to = $_POST['email']; $subject = "GAME Account Activation"; $body = "Hello " . $username . ",\n\nThank you for registering at GAME!\n\nClick this link to activate your account: http://www.YOURGAME.org/activate.php?ID=".$row['userid']."&key=".$row['Random_key']." \n\n -GAME OWNER"; $headers = "From: [email][email protected][/email]\r\n"; if (mail($to, $subject, $body, $headers)) {}   in authenticate.php add   if ($mem['activated'] == 0) { die{"Your account is not active, check your email address including junk boxes. [url='login.php']back[/url]"); }   That should be everything, enjoy.
  5. Re: Quantify Mod for V2! As UCC pointed out to me in another thread, in v2 you just use item_add for adding items as it will automatically group items. there is no need for a quantifier if you just go though the code and fix it up.
  6. Re: v2 adding new item effects What type of effects? if you take alook at the bodyguard mod it should give you an idea on how to do it.
  7. Re: Where did everything go? From what he was saying on the forums alot of it is still being sorted/ deleted to get rid of all crap.
  8. Re: [v2] Can't delete gang forum posts/ topics This is the section (thought it might help abit more with the whole section) 603: function recache_topic($forum) 604: { 605: global $ir, $c, $userid, $h, $bbc; 606: print "Recaching topic ID $forum ... "; 607: $q=$db->query("SELECT p.* FROM forum_posts p WHERE p.fp_topic_id=$forum ORDER BY p.fp_time DESC LIMIT 1"); 608: if(!$db->num_rows($q)) 609: { 610: $db->query("update forum_topics set ft_last_id=0, ft_last_time=0, ft_last_name='N/A',ft_posts=0 where ft_id={$forum}"); 611: print " ... Done"; 612: } 701: function deletopic() 702: { 703: $q=$db->query("SELECT * FROM forum_topics WHERE ft_id={$_GET['topic']}"); 704: $topic=$db->fetch_row($q); 705: $db->query("DELETE FROM forum_topics WHERE ft_id={$_GET['topic']}"); 706: $db->query("DELETE FROM forum_posts WHERE fp_topic_id={$_GET['topic']}"); 707: print "Deleting topic... Done "; 708: recache_forum($topic['ft_forum_id']); 709: stafflog_add("Deleted topic {$topic['ft_name']}");
  9. Re: [mccode] quantify items automatically   The above post said it worked on v2, thats why :? Is there a v2 quantifier(paid or free, if paid where do I purchase it from)?
  10. I'm getting these errors:   Fatal error: Call to a member function query() on a non-object in /public_html/forums.php on line 703   Fatal error: Call to a member function query() on a non-object in /public_html/forums.php on line 607   This is in relation to deleting topics/ posts in the gang forums   function delepost() { global $ir, $c, $userid, $h, $bbc, $db; if($ir['user_level'] < 2) { die(""); } $q3=$db->query("SELECT * FROM forum_posts WHERE fp_id={$_GET['post']}"); $post=$db->fetch_row($q3); $q=$db->query("SELECT * FROM forum_topics WHERE ft_id={$post['fp_topic_id']}"); $topic=$db->fetch_row($q); $u=mysql_escape($post['fp_poster_name']); $db->query("DELETE FROM forum_posts WHERE fp_id={$post['fp_id']}"); print "Post deleted... "; recache_topic($post['fp_topic_id']); recache_forum($post['fp_forum_id']); stafflog_add("Deleted post ({$post['fp_subject']}) in {$topic['ft_name']}"); } function deletopic() { $q=$db->query("SELECT * FROM forum_topics WHERE ft_id={$_GET['topic']}"); $topic=$db->fetch_row($q); $db->query("DELETE FROM forum_topics WHERE ft_id={$_GET['topic']}"); $db->query("DELETE FROM forum_posts WHERE fp_topic_id={$_GET['topic']}"); print "Deleting topic... Done "; recache_forum($topic['ft_forum_id']); stafflog_add("Deleted topic {$topic['ft_name']}"); }   I've done alot of searching but couldn't find anything on it (with an answer), any help would be great :-D Thanks!
  11. Re: [mccode] quantify items automatically ^ Thats what I ment (should be more clear) So my header in inventory.php looks like this:   <?php include "globals.php"; $id=ITEMIDHERE; $lol2=mysql_query("SELECT * FROM inventory WHERE inv_userid=$userid AND inv_itemid=$id",$c); $gotitem = mysql_num_rows($lol2); if($gotitem == 0) { mysql_query("INSERT INTO inventory VALUES('',$itemidexplore,$userid,1)",$c); } else { $item=mysql_query("SELECT * FROM inventory WHERE inv_userid=$userid AND inv_itemid=$id",$c); $z=0; while ($i=mysql_fetch_array($item)) { $z=$z+$i['inv_qty']; } $z = $z+1; mysql_query("DELETE FROM inventory WHERE inv_userid=$userid AND inv_itemid=$id",$c); mysql_query("INSERT INTO inventory VALUES ('', '$id', '$userid', '$z')",$c); } $q=$db->query("SELECT * FROM items WHERE itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']}, {$ir['equip_armor']})"); print "<h3>Equipped Items</h3><hr />";
  12. Re: [mccode] quantify items automatically The above V2 isn't working for me :? Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /public_html/inventory.php on line 5 Added after global.php Any ideas?
  13. Re: Not gaining exp (v2) ... So a level 1 attacking a level 1 shouldn't be getting exp.. then how the hell is anyone ment to level.
  14. Re: Not gaining exp (v2) they're all level 1's attacking each other, and have about a 1/10 chance of getting exp :S
  15. I've search and searched, can't find a single thread relating to this issue (then again, I might suck as searching). When one of my users kills another (mug/ hosp/ leave) they will rarely gain exp. In the odd change they DO get exp its only something small like 5%. Battle code is all completely stock, nothing changed. What am I missing :?
×
×
  • Create New...