vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   usergroup based error messages (https://vborg.vbsupport.ru/showthread.php?t=126591)

Lionel 09-14-2006 10:14 AM

usergroup based error messages
 
Is there a way to customize the generic error messages?
If for example someone is trying to access a page that can be seen only by a certain group, I'd like for the error message to be more specific, to be able to put links and things in there.

It's been only 6 years I've been trying to do this, since the 2.20 days.

paul41598 09-14-2006 06:36 PM

Well, this is the half ass way of doing it. I could probably get something better going, (like maybe a hook) just not right this second.

However the generic msg uses a function called print_no_permission() located in functions.php So whenever you see this function in any of the files where you want the error msg to occur you could replace that function with something else.

For Example:

- I have custom permissions on one of my forums set to "Cannot View Forum" so when a user clicks on it, they get the generic msg. However I want a custom error message instead.

- I can open up forumdisplay.php and look for this code:
PHP Code:

// get permission to view forum
$_permsgetter_ 'forumdisplay';
$forumperms fetch_permissions($foruminfo['forumid']);
if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['canview']))
{
    
print_no_permission()



Then I can simply replace: print_no_permission()

with something like:

PHP Code:

eval(standard_error("I'm Sorry, You Don't Have Permission<br /><br /> <b>Contact An Admin</b>")); 


Lionel 09-14-2006 08:31 PM

It's a little more involved in my case. I want to use it for specific usergroups with vbadvanced and other groups based hack.

If you do that hook, you'll be like God sent to me.

Lionel 09-23-2006 12:34 AM

Thank you. I got it


All times are GMT. The time now is 11:04 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.01872 seconds
  • Memory Usage 1,714KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete