bilis_money Posted March 26, 2007 Share Posted March 26, 2007 Hi, can someone share the idea of how to promote a regular member into MODS or ADMIN? I have a problem which has a similar logic like this. Can you show me how is this done using class (OOP)? thank you very much in advance. Quote Link to comment https://forums.phpfreaks.com/topic/44287-promote-a-user-membership-system/ Share on other sites More sharing options...
rcorlew Posted March 26, 2007 Share Posted March 26, 2007 I use a 'user_level' to do things like that. Set the session/cookie variables to store user_level along with all the other stuff you need to pass along. the code would look something like this assuming you use sql you can just add another column to your user table that would set user level. user_level1 = admin user_level2 = helper user_level3 = user <?php if($user_level == 1) { //This would be the top admin area include"admin.php"; } if($user_level == 2) { //This could be a helper type area include"helper.php"; } if($user_level == 3) { //This would be a regular user area include"user.php"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/44287-promote-a-user-membership-system/#findComment-215126 Share on other sites More sharing options...
cmgmyr Posted March 26, 2007 Share Posted March 26, 2007 I usually use "level" or "type" in my membership databases that allow a member into different parts of the site. Quote Link to comment https://forums.phpfreaks.com/topic/44287-promote-a-user-membership-system/#findComment-215129 Share on other sites More sharing options...
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.