vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Standard Error Page (https://vborg.vbsupport.ru/showthread.php?t=205063)

dfc005 02-11-2009 08:29 PM

Standard Error Page
 
Is there some global function or check I can use to see if the current page is an error page? I have a custom right hand menu that I'd like to hide some stuff in when an error page is shown.

--------------- Added [DATE]1234391543[/DATE] at [TIME]1234391543[/TIME] ---------------

I'd also like to know if the same can be found out about the standard redirect as well.

Dismounted 02-12-2009 04:52 AM

Add plugins at error_generic and redirect_generic and create a variable that sets to true. Check this variable in your templates.

dfc005 02-12-2009 08:31 AM

OK, have created a plugin at error_generic that has this simple bit of code....

PHP Code:

$hide_stuff "true"

And the in my template I have this....

HTML Code:

<if condition="$hide_stuff != 'true'">
    <div style="width:300px;float:left;margin-bottom:5px;">
        $poll_sidebar
    </div> 
</if>

Doesn't seem to be working though. Doesn't look like the template has the variable set.

Marco van Herwaarden 02-12-2009 08:59 AM

Make sure that the variable is in global scope, add the following line as 1st line of that plugin:

PHP Code:

global $hide_stuff


dfc005 02-12-2009 09:06 AM

Nope, still doesn't set any value. I must be missing something....

Dismounted 02-12-2009 10:17 AM

Which template are you putting your code in?

dfc005 02-12-2009 10:22 AM

It's a custom template that gets included via a different plugin. Could that be the problem?

Dismounted 02-13-2009 08:53 AM

If the template is called before the variables are defined, it is not going to work.

dfc005 02-13-2009 09:28 AM

So which gets called first? error_generic or parse_templates?

Dismounted 02-13-2009 10:37 AM

parse_templates

Paul M 02-13-2009 10:39 AM

Turn debug mode on and you will see all the hooks that are called and in what order.

dfc005 02-15-2009 09:04 PM

Quote:

Originally Posted by Dismounted (Post 1742750)
parse_templates

Well then, I can't set a variable in error_generic to be used in parse_templates can I?

Any other ideas?


All times are GMT. The time now is 06:51 PM.

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.01054 seconds
  • Memory Usage 1,734KB
  • 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
  • (1)bbcode_html_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (12)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