Renkia Posted May 27, 2010 Posted May 27, 2010 Hi there MWG/MCCF members, I am currently thinking of adding a new user_level to my incoming game in around 8 months. I have some Idea how to do it, but no Idea the with SQL'S. Currently learning SQL for the sake of the game mods & myself. Would appreciate it if someone could help. Thanks, for reading Rasheed Saeed - Renkia - Kakashi Hatake Quote
Jordan Palmer Posted May 27, 2010 Posted May 27, 2010 It's easy -.-.. Add a random number in the db (1000,5,ect) as the users Userlevel Add it too the staff list, Also add the number in the top query make a panel for it, Or edit you're staff panel Add it in ViewUser.. Easily done :) Quote
gurpreet Posted May 27, 2010 Posted May 27, 2010 It's easy -.-.. Add a random number in the db (1000,5,ect) as the users Userlevel Add it too the staff list, Also add the number in the top query make a panel for it, Or edit you're staff panel Add it in ViewUser.. Easily done :) Thanks for that, made a new user level :) Quote
Renkia Posted May 27, 2010 Author Posted May 27, 2010 I know that Jordan. xD It's just the SQL mate. :) userid` =2; I Think you are just updating ID 2. I'm not very good at this stuff, but it should be ( $userid ) What Ive seen in some cases anyway. Quote
Uridium Posted May 27, 2010 Posted May 27, 2010 I would personally make a new table called Staff thats not part of the user table. so something like this would work.. [mysql]CREATE TABLE IF NOT EXISTS `staff` ( `staff_id` int(11) NOT NULL auto_increment, `staff_level` int(11) NOT NULL, `staff_status` varchar(20) NOT NULL, `staff_duties` varchar(100) NOT NULL, `staff_vacation` varchar(3) NOT NULL, `staff_killer` varchar(3) NOT NULL, PRIMARY KEY (`staff_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;[/mysql] Quote
CJ - Twitch Posted May 27, 2010 Posted May 27, 2010 Yeah thats what I have done. I'm redoing some of the SQL structure in lite to make it easier for me. :P Quote
Jordan Palmer Posted May 28, 2010 Posted May 28, 2010 Illusions, I've done that but if I'd off said that he'd off basically asked for the new staff side off it too.. @Ren - UPDATE users SET user_level = 200 WHERE userid = 1 ect =/ Quote
Renkia Posted May 28, 2010 Author Posted May 28, 2010 UPDATE users SET user_level = 200 WHERE userid = 1 That it? Wow, so simple. I thought it would be alot more work in the SQL's, lol. Well thanks for the Jordan. :) Quote
Jordan Palmer Posted May 28, 2010 Posted May 28, 2010 Simply click the table users, then browse, then edit, then put in the new user_level and bam ;D save Quote
Zero-Affect Posted May 28, 2010 Posted May 28, 2010 renkia it's actually MCCf lol not MCCF My user level functions on CG are interesting but i keep mine in the same table as the users but i use strings rather than variables. Quote
Djkanna Posted May 29, 2010 Posted May 29, 2010 [mysql]ALTER TABLE `userstablename` ADD `position` ENUM ('Administrator', 'Assistant', 'Member', 'Bot') NOT NULL DEFAULT 'Member'[/mysql] try { if($user->position !== 'Administrator') { throw new errorMessage('Error: Access Denied'); } } catch (errorMessage $em) { echo '<span class="error">'.$em->_message().'</span>'; } Something to that effect I use. Quote
Zero-Affect Posted May 29, 2010 Posted May 29, 2010 That's actually pretty close to what i use actually DJK Quote
Djkanna Posted May 29, 2010 Posted May 29, 2010 [warnbox]Renkia: Second warning -.-[/warnbox] Sorry CrimGame (It was a multiple delete so same reason for all - didn't intend on calling you an idiot :) ) Quote
Djkanna Posted May 30, 2010 Posted May 30, 2010 well it takes one to know one fella :) Haha true Quote
Dillion & Amanda 4 Lif Posted June 4, 2010 Posted June 4, 2010 I use a "User Group" type thing. Its like a system where you can add groups and give them staff perms., edit groups, delete em, and so on. 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.