Category dependent links in navigation

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
snifty
Posts: 40
Joined: Thu Aug 26, 2010 2:21 pm

Category dependent links in navigation

Post by snifty »

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!
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Category dependent links in navigation

Post by Klemen »

You can use the hesk_okCategory function:

Code: Select all

if ( hesk_okCategory(1, false) )
{
        // show the link...
}
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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image 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
snifty
Posts: 40
Joined: Thu Aug 26, 2010 2:21 pm

Re: Category dependent links in navigation

Post by snifty »

Hi Klemen!

Thank you very much for your fast answer.
This is excactly what i was looking for! :D
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.
Post Reply