Jump to content
MakeWebGames

New user_level


Renkia

Recommended Posts

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

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

[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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...