vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   no permission message based on usergroup (https://vborg.vbsupport.ru/showthread.php?t=214019)

raagaswaram 05-19-2009 01:46 AM

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

Lynne 05-19-2009 04:02 AM

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:

if (is_member_of($vbulletin->userinfox,y))  {
error 1
} else if (is_member_of($vbulletin->userinfoa,b))   {
error 2
} else {
error 3



raagaswaram 05-19-2009 05:29 PM

Quote:

Originally Posted by Lynne (Post 1813276)
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:

if (is_member_of($vbulletin->userinfox,y))  {
error 1
} else if (is_member_of($vbulletin->userinfoa,b))   {
error 2
} else {
error 3



hey,
sorry where is the quick links (API)?

Lynne 05-19-2009 06:15 PM

Quick Links is in the navbar on the right side under the search bar.

raagaswaram 05-20-2009 02:48 AM

ye but which template or file to edit? also userinfo or usergroup?

Lynne 05-20-2009 03:24 AM

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).

raagaswaram 05-20-2009 04:00 AM

im using when downloading an attachment or when a user trying to enter premium section of a forum

Lynne 05-20-2009 03:35 PM

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.

raagaswaram 05-21-2009 01:20 AM

no permission when trying to download an attachment

Lynne 05-21-2009 02:20 AM

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.


All times are GMT. The time now is 01:46 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01035 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete