Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-29-2013, 05:44 AM
doob doob is offline
 
Join Date: Dec 2009
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 04-29-2013, 06:20 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cannot suggest anything without some code to look at
Reply With Quote
  #3  
Old 04-30-2013, 01:34 AM
doob doob is offline
 
Join Date: Dec 2009
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 04-30-2013, 01:54 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 04-30-2013, 07:24 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Also, try using {$GLOBALS['includedphp']} in place of $includedphp (in the template)
Reply With Quote
  #6  
Old 04-30-2013, 05:32 PM
doob doob is offline
 
Join Date: Dec 2009
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 04-30-2013, 07:16 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by doob View Post
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.
Reply With Quote
Благодарность от:
tbworld
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:40 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.03921 seconds
  • Memory Usage 2,219KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (1)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete