herghost Posted September 15, 2008 Share Posted September 15, 2008 Hi, I am wondering if anyone can help me with this. I have a site which is basically a social network site, when a user logs in a menu bar appears, done by the code {if $user->user_exists != 0} which I understand basically means, if the user exists, then show the menu. On the menu I have a set up links, all in this format: <td class='menu_item'> <a href='user_contactmodel.php' class='menu_item'><img src='./images/icons/phone.gif' border='0' class='icon'>{$header26}</a> </td> which works fine, the all display. I also have different user groups, depending on the type of account they have, as far as I can tell, from phpmyadmin the data is stored in a table called se2_users and is controlled by an element user_level_id, with levels 1,2,3 or 4 Say I wanted to only give access to level 4, what would I need to do? Also the file is a template file (.tpl) does this affect anything? I assumed it would be something like : {if $user->user_level_id != 4} but this gives me a smarty error. Thanks for any help Link to comment https://forums.phpfreaks.com/topic/124341-solved-help-with-hiding-content-from-user-groups/ Share on other sites More sharing options...
dezkit Posted September 15, 2008 Share Posted September 15, 2008 {if $user->user_level_id >= 4} Link to comment https://forums.phpfreaks.com/topic/124341-solved-help-with-hiding-content-from-user-groups/#findComment-642149 Share on other sites More sharing options...
herghost Posted September 15, 2008 Author Share Posted September 15, 2008 Thanks for this, however this makes it cant be viewed unless its is set to 0? What am I not thinking about?! Link to comment https://forums.phpfreaks.com/topic/124341-solved-help-with-hiding-content-from-user-groups/#findComment-642284 Share on other sites More sharing options...
adam291086 Posted September 15, 2008 Share Posted September 15, 2008 post all the code for the menu stuff the line dezkit gave you should work Link to comment https://forums.phpfreaks.com/topic/124341-solved-help-with-hiding-content-from-user-groups/#findComment-642299 Share on other sites More sharing options...
herghost Posted September 15, 2008 Author Share Posted September 15, 2008 {if $user->user_level_id >= 4} <td class='menu_item'> <a href='user_contactmodel.php' class='menu_item'><img src='./images/icons/phone.gif' border='0' class='icon'>{$header26}{/if}</a> </td> Link to comment https://forums.phpfreaks.com/topic/124341-solved-help-with-hiding-content-from-user-groups/#findComment-642304 Share on other sites More sharing options...
herghost Posted September 15, 2008 Author Share Posted September 15, 2008 Fixed! {if $user->user_info.user_level_id >= 4} Link to comment https://forums.phpfreaks.com/topic/124341-solved-help-with-hiding-content-from-user-groups/#findComment-642320 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.