Current time: 08-23-2017, 10:53 AM
How To? Permissions for additional Navbar links ?
07-19-2012, 10:46 AM
Post: #1
Permissions for additional Navbar links ?
Hi guys,

i got a question for you. I know how to add links to the Navbar, but is there a way to make it so for example such a link would be only work for registered user instead of a guest user ?

Wolfseye
Quote

Namecheap.com

07-19-2012, 16:54 PM
Post: #2
RE: Permissions for additional Navbar links ?
Yes you would need to set permissions for each link, could be done with a plugin.

The contents of this section are hidden from your usergroup.

$10 Off any hostgator package - Coupon Code: The contents of this section are hidden from your usergroup.
25% Off any hostgator package - Coupon Code: The contents of this section are hidden from your usergroup.
$25 Off all reseller packages - Coupon Code: The contents of this section are hidden from your usergroup.
Quote

Namecheap.com

07-19-2012, 17:04 PM
Post: #3
RE: Permissions for additional Navbar links ?
But I suppose there is no such plugin to make that in an easy way, right ? Is there no PHP code that can be used to make that ? Because I learned today, when I asked a guy how make pages created with the PAGE MANAGER plugin, only accessible when you're at least registered and not only a guest.

That was possible like that, using PHP for the page.

Quote:The contents of this section are hidden from your usergroup.

Register

So I wonder if something like this would be possible in the templates, around a link.
Quote

Namecheap.com

07-19-2012, 17:16 PM
Post: #4
RE: Permissions for additional Navbar links ?
You must have the php plugin installed to use php in templates: http://www.mybbextras.net/showthread.php?tid=159

Then use this:
PHP Code:
The contents of this section are hidden from your usergroup

Register

That will block users in usergroup 1,5,7 from viewing that link

The contents of this section are hidden from your usergroup.

$10 Off any hostgator package - Coupon Code: The contents of this section are hidden from your usergroup.
25% Off any hostgator package - Coupon Code: The contents of this section are hidden from your usergroup.
$25 Off all reseller packages - Coupon Code: The contents of this section are hidden from your usergroup.
Quote

Namecheap.com

07-19-2012, 20:30 PM
Post: #5
RE: Permissions for additional Navbar links ?
Ok, thats cool. But better would be, for example, lets say I have interesting things / pages on my Forum. So now I want to encourage people to signup so they can see these things, which normal guests cant.

Hiding the link all together would not be so good, because they dont see what they might miss out. It would be much better if the link to whatever content would be still visible, yet clicking on it as guest would give them a "NO PERMISSION" message. Thats what people get when I use the above PHP code (the one I posted earlier) in the PAGE MANAGER plugin for the individual pages. They are not hidden. They just can be access when one is at least a registered member.
Quote

Namecheap.com

07-19-2012, 20:43 PM
Post: #6
RE: Permissions for additional Navbar links ?
You cant do that with page manager. You'll need a plugin to trigger an error for specific usergroups.

The contents of this section are hidden from your usergroup.

$10 Off any hostgator package - Coupon Code: The contents of this section are hidden from your usergroup.
25% Off any hostgator package - Coupon Code: The contents of this section are hidden from your usergroup.
$25 Off all reseller packages - Coupon Code: The contents of this section are hidden from your usergroup.
Quote

Namecheap.com

07-20-2012, 06:14 AM
Post: #7
RE: Permissions for additional Navbar links ?
(07-19-2012 20:43 PM)Echo Wrote:  The contents of this section are hidden from your usergroup.

Register
Well, it works the way i posted above, in Page Manager. Just would like to have it work the same way with links in the Navbar.
Quote

Namecheap.com

07-20-2012, 08:48 AM
Post: #8
RE: Permissions for additional Navbar links ?
If it works the way you posted above then why aren't you using it on your links? I'm kinda confused now to what your problem actually is?

The contents of this section are hidden from your usergroup.

$10 Off any hostgator package - Coupon Code: The contents of this section are hidden from your usergroup.
25% Off any hostgator package - Coupon Code: The contents of this section are hidden from your usergroup.
$25 Off all reseller packages - Coupon Code: The contents of this section are hidden from your usergroup.
Quote

Namecheap.com

07-20-2012, 08:50 AM
Post: #9
RE: Permissions for additional Navbar links ?
I only know how to use in in a php file. How I can use that in a header template for navbar links, I don't know. As I said, i am not good with PHP and that stuff.
Quote

Namecheap.com

07-20-2012, 08:56 AM
Post: #10
RE: Permissions for additional Navbar links ?
This is what I'm saying, you can only use your code in a php file, you cannot use your code and trigger an error message in your templates. You can use my code above to block usergroups seeing specific elements within your templates, which is no good in your case.

This is why you'll need a plugin to create a function that will run permission checks to see who can access specific links.

The contents of this section are hidden from your usergroup.

$10 Off any hostgator package - Coupon Code: The contents of this section are hidden from your usergroup.
25% Off any hostgator package - Coupon Code: The contents of this section are hidden from your usergroup.
$25 Off all reseller packages - Coupon Code: The contents of this section are hidden from your usergroup.
Quote

Namecheap.com



Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [How To?] Additional Usergroups NekoNeji 0 713 10-02-2011 16:47 PM
Last Post: NekoNeji
  [How To?] make code links as live links 1master1 6 2,725 12-02-2010 13:47 PM
Last Post: Echo


User(s) browsing this thread: 1 Guest(s)