PDA

View Full Version : Usergroup needed to view links on forum


SoulForge
10-26-2009, 11:03 PM
Need a tiny bit of code that checks user is logged in before showing a link on my forum but not only does the user require to be logged in but needs a certain usergroup also

Or can the usergroup bit cover the not logged in part also??

I was wondering if it was down to the condition bit of the link but not really sure :S

Thanks in advance

James Birkett
10-27-2009, 12:00 AM
You can't condition a hyperlink.

You'd need a hook (possibly on showthread_complete).

The usergroup would cover the logged in bit, as you'd have to log in to be part of a usergroup.

To check if a member is part of a usergroup:
if(is_member_of($bbuserinfo['usergroupid'], {ids of usergroups separated by commas}))

As for showing links, probably have to use str_replace.