Version of script: 2.6.2
Does anybody know if there is a simple way to find out if a user is in a category?
I want to add items to the navigation for users that are members of eg. category 1.
In other words, I'm trying to add lines to show_admin_nav.inc.php that will do:
if ($_SESSION['name'] is in category 1) {
<td><a href=.....
}
Thank you!
Category dependent links in navigation
Moderator: mkoch227
Re: Category dependent links in navigation
You can use the hesk_okCategory function:
The first parameter is category ID (1 in this case) and the second must be set to "false" to prevent HESK showing an error page.
Code: Select all
if ( hesk_okCategory(1, false) )
{
// show the link...
}
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Re: Category dependent links in navigation
Hi Klemen!
Thank you very much for your fast answer.
This is excactly what i was looking for!
For some reason I didn't find this function so I was fiddling with SQL Statements like "SELECT `categories` FROM `hesk_users` WHERE `name` = $_SESSION['name']" which is not really that nice...
HESK - and of course your support - is really worth each Cent! That's the reason we're using it since 2010.
Thank you very much for your fast answer.
This is excactly what i was looking for!

For some reason I didn't find this function so I was fiddling with SQL Statements like "SELECT `categories` FROM `hesk_users` WHERE `name` = $_SESSION['name']" which is not really that nice...
HESK - and of course your support - is really worth each Cent! That's the reason we're using it since 2010.