NationGamer Posted February 2, 2011 Posted February 2, 2011 with this modification you can quickly reserver or blacklist usernames i made it quickly but i did test it and all should work and i thought the mod would come in handy and yes before people say i know you can do this in an array but with this you can add an admin function open register.php ok firstly find: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. underneath add: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. then insert this sql into your database: [mysql] CREATE TABLE IF NOT EXISTS `reserved_names` ( `id` smallint(1) NOT NULL auto_increment, `Rname` varchar(30) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ; -- -- Dumping data for table `reserved_names` -- INSERT INTO `reserved_names` (`id`, `Rname`) VALUES (1, 'Admin'), (2, 'Moderator'), (3, 'GM'), (4, 'FM'), (5, 'Admin'), (6, 'Owner'), (7, 'Programmer'), (8, 'Coder'), (9, 'Test'), (10, 'Tester'), (11, 'Demo'); [/mysql] ive put some usernames already in there so you get how it works if you didnt understand. Staff Functions find in smenu.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. just below add: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. in staff.php just below add: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. add: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. find: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. add above: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. find: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. just above add: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. any bug please feel free to post up and ill try get them sorted This modification should also work with v1 with minimal/no editing. Quote
rulerofzu Posted February 2, 2011 Posted February 2, 2011 Id like to say good effort and nice try on this. Its a lot of code for something that does not need to be so big. You could use and array to check for the reserved names. Also you need to really think more about your database structure. int(11) is really bad habit. Is your ID really going to need that? Also you should think about security as standard for any code that you do. $_POST['reserved_name'] has nothing to secure that. Quote
NationGamer Posted February 2, 2011 Author Posted February 2, 2011 thanks for feedback and yh i dont like using array myself this way i could achieve the same thing with knowing i wouldnt mess up as much and ive edited the int and tried securing the post as much as i know anyways lol thanks Quote
NationGamer Posted February 7, 2011 Author Posted February 7, 2011 thanks spirit and yh i thought it might come in hand if staff want to reserve names quickly and can be adapted to do other things maybe blacklist words in game add some jax to auto udpdate words and be a good mod thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.