The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
no permission message based on usergroup
can anyone help me to display different no permission error message based on usergroup instead of displaying default one to all user groups
|
#2
|
||||
|
||||
Look in the API (link in Quick Links) for the function "standard_error" and you should see how to modify the message. Then just put a condition around each error based on the usergroup:
PHP Code:
|
#3
|
|||
|
|||
Quote:
sorry where is the quick links (API)? |
#4
|
||||
|
||||
Quick Links is in the navbar on the right side under the search bar.
|
#5
|
|||
|
|||
ye but which template or file to edit? also userinfo or usergroup?
|
#6
|
||||
|
||||
You'll have to figure out which hook location to use based on where you are using this code (if you are making a plugin) or if you are showing/not showing some info based on the codition, you will have to figure out which template (To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. Sometimes the template is the one mentioned at the very top of the page source). You never said where you are using this, so I can't offer advice. When in debug mode, you can see a list of all the plugins used on the page on the bottom of the page as well as all the templates.
And you use $vbulletin->userinfo in that particular function. That function, is_member_of, is also in the API. You can go see what variables are accepted in there and that passing the userinfo is an OK thing (the userinfo contains the usergroup for the user). |
#7
|
|||
|
|||
im using when downloading an attachment or when a user trying to enter premium section of a forum
|
#8
|
||||
|
||||
OK. So are you going to be using the code in a plugin or a template? What are you trying to hide/show from people? You need to figure out what template or variable you are trying to hide/show.
|
#9
|
|||
|
|||
no permission when trying to download an attachment
|
#10
|
||||
|
||||
Any attachment? You can simply set it so users in a usergroup aren't allowed to download the attachment in the Attachment Manager. Or you could probably use the "attachment_start" hook location to send an error based on the usergroupid as posted above.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|