08-03-2017, 01:20 PM
You're missing some ().
Note that there are two functions available to do this. If you only want to check for one particular permission level, you can do
or if you want to do multiple permission levels, you can do
of course you can always do the opposite logic
Finally, just so you know, you always have access to your user table with $user->data() so you can echo out the user's first name by doing
The is the column name you want to echo in the users table.
Welcome to UserSpice. I'm Dan, by the way. I use the Dan account when I'm on my phone (it has less permissions) and this one on my real pc.
Note that there are two functions available to do this. If you only want to check for one particular permission level, you can do
Code:
if(checkMenu(3,$user->data()->id){
or if you want to do multiple permission levels, you can do
Code:
if(hasPerm([2,3,4], $user->data()->id)){
of course you can always do the opposite logic
Code:
if(!hasPerm...
Finally, just so you know, you always have access to your user table with $user->data() so you can echo out the user's first name by doing
Code:
echo $user->data()->fname;
The
Code:
fname
Welcome to UserSpice. I'm Dan, by the way. I use the Dan account when I'm on my phone (it has less permissions) and this one on my real pc.