vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Splitting Long/Bulky Templates - Not Working (https://vborg.vbsupport.ru/showthread.php?t=212615)

nando99 05-01-2009 02:08 PM

Splitting Long/Bulky Templates - Not Working
 
Ok.. so I've followed Kerry-Anne's instructions from
https://vborg.vbsupport.ru/showthread.php?t=119933

I get the template to show, just no where I want it...


----------------

This is my plugin info:

Code:

Plugin Name: testtemp_plugin

Hook Location: parse_templates

Plugin PHP Code: eval('$testtemp = "' . fetch_template('testtemp') . '";');

Code:

Plugin Name: Cached - testtemp_plugin

Hook Location: cache_templates

Plugin PHP Code: $globaltemplates = array_merge($globaltemplates, array('testtemp'));

My template name is: testtemp and it contains "Hello World... Testing... "

----------------

Ok so it works fine when I put in the showthread template but not in the postbit template... thats a problem though, because I'm trying to split the postbit template...

I have many conditionals if certain forums, certain post number etc etc and i'd really like to split the template...

Not sure why its not working in the postbit template...

Any help is appreciated, thanks in advance....

Dismounted 05-02-2009 12:46 AM

postbit is created and processed inside an object, which means your variable is not in scope. You need to bring it into scope with a plugin at postbit_display_complete, and the global keyword.

nando99 05-02-2009 12:49 AM

ok... i think...

so which plugin do I make postbit_display_complete the hook location and what do you mean about global keyword?

thanks in advance, seriously...

Dismounted 05-02-2009 02:37 AM

Did you try searching for documentation?

http://www.php.net/manual/en/languag...bles.scope.php


All times are GMT. The time now is 07:32 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.01098 seconds
  • Memory Usage 1,713KB
  • 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_code_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