vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Includes plugin won't work in STANDARD ERROR template (https://vborg.vbsupport.ru/showthread.php?t=297675)

doob 04-29-2013 05:44 AM

Includes plugin won't work in STANDARD ERROR template
 
I stumped. I'm having a problem getting an includes plugin to display on the STANDARD ERROR template. The plugin works fine in every other template, but won't load for that one. Any suggs?

tbworld 04-29-2013 06:20 AM

Cannot suggest anything without some code to look at :(

doob 04-30-2013 01:34 AM

Its just a standard includes plugin similar to:

ob_start();
include('path/to/this/file/myfile.php');
$includedphp = ob_get_contents();
ob_end_clean();

The plugin works on dozens of other templates, so I am guessing that something about STANDARD_ERROR doesn't allow the use of an includes plugin for security or some other reason.

What I'm looking for is advice on including a php page on the STANDARD_ERROR template.

Thanks.

Lynne 04-30-2013 01:54 AM

It all depends on the hook used. Did you go into debug mode and verify the plugin hook you are using is being called on that page?

kh99 04-30-2013 07:24 AM

Also, try using {$GLOBALS['includedphp']} in place of $includedphp (in the template)

doob 04-30-2013 05:32 PM

Very interesting. The plugin was using the hook global_start, which works for every other template I've tried. Also, in debug mode when displaying the STANDARD_ERROR template, in this case, the permissions error one might see when posting a new thread while not logged on, these are the "Hooks Called" according to the debug:

init_startup
cache_permissions
fetch_foruminfo
style_fetch
cache_templates
global_start
parse_templates
global_setup_complete
newthread_start
error_nopermission
error_fetch
forumjump
navbits
navbits_complete
error_generic

What is interesting is that global_start is listed, however the plugin wouldn't work until switched to the "error_generic" hook.

Am I misinterpretting what the debug output means when it lists the hooks? Is there something funky about using the global_start hook on the STANDARD_ERROR template?

In any case, seem to have got what I need working, but a little confused about why global_start wouldn't work with this template.

Thanks Lynn and KH_99 as always for your input!

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

KH99. You're solution got it working with the global_start hook. Any implications to using the {$GLOBALS['include']} syntax in terms of load or security?

kh99 04-30-2013 07:16 PM

Quote:

Originally Posted by doob (Post 2419285)
KH99. You're solution got it working with the global_start hook. Any implications to using the {$GLOBALS['include']} syntax in terms of load or security?

No, it's just another name for your variable. If a template is used inside a function (which apparently is true for the STANDARD_ERROR template), then you can't use global variables except through the $GLOBALS array, or by using a plugin to declare them "global". So another thing that might work would be to create another new plugin using hook error_generic and one line of code:
Code:

global $includedphp;

but as far as I know there's no difference between using that and using $GLOBALS.


All times are GMT. The time now is 03:28 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.01022 seconds
  • Memory Usage 1,726KB
  • 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_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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