The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Menu Permissions & Viewing
#1
Just a brief question, I've got multiple permission levels setup, lets say levels 2, 3, 4, and 5. I've got multiple dropdown menus in my menu. I want menu dropdown option 1 to be visible to permissions 2 and 3, and then menu dropdown option 2 to be visible to permissions 4 and 5. Is there a way to do this? I've been messing around with the code below, but can't seem to get it to work properly for multiple permissions

<?php if (checkMenu(#,$user->data()->id)){?>
Content
<?php } ?>
  Reply
#2
My logic might be a little bit off but you can probably do

<pre>
Code:
if (checkMenu(3,$user->data()->id) || (checkMenu(4,$user->data()->id)){
</pre>

Code:
//Links for permission level 3/4

Code:
?>

There may be a missing or added () in there somewhere
  Reply
#3
Found my error in your mention of the ().

For anyone who may encounter the same issue, what worked for me was:

<pre>
Code:
<?php if (checkMenu(2,$user->data()->id) || checkMenu(7,$user->data()->id) || checkMenu(8,$user->data()->id) || checkMenu(9,$user->data()->id) || checkMenu(12,$user->data()->id) || checkMenu(13,$user->data()->id)){?>
</pre>
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)