vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   [help] How 2 Show Template I Created Automatically (https://vborg.vbsupport.ru/showthread.php?t=209427)

Come2Daddy 03-25-2009 05:28 PM

[help] How 2 Show Template I Created Automatically
 
Hello every one,

Actually I tried to make an HTML table, & I succeeded :D
so I paste the table code at the end of the header, and it shows wonderfull
but I want it to be extractable so I can distribute it as a plugin/product alone,

hence I created a new template, as I called this template: my_template

then I created a plugin, & choosed the hook location to be: parse_template

this plugin contains this fragment of code:

Code:

eval('$my_template = "' . fetch_template('my_template') . '";');
but my template didn't appeare, I added this variable at the end of the header: $my_template
but still didn't work.


So can any one help me by telling me, how to let this template be shown???

Come2Daddy 03-26-2009 08:58 PM

up
up

Seven Skins 03-26-2009 09:06 PM

Code:

eval('$my_template .= "' . fetch_template("my_template") . '";');

Come2Daddy 03-26-2009 09:49 PM

Thanx, Seven Skins, but it didn't work, besides I never saw this syntax in any working hack

I never saw the DOT b4 the EQUALE SIGN

Code:

...y_template .= "' . fetch_te...
I even have no idea what have u meant with this code

TigerC10 03-26-2009 10:14 PM

The = operator assigns content. the .= operator appends content. In other words, the $my_template variable already exists and is displaying - so you just add to it. This requires that you use an existing variable that is already in use somewhere.


If you don't want to do it that way, you can try doing this instead:
Code:

eval('print_output("' . fetch_template($template_name) . '");');
However, doing it that way will most likely not print the way you expect it to.

Seven Skins 03-26-2009 11:01 PM

Try adding a hook at: global_start or if you just want that table on your forumhome then forumhome_start

With your original code:
Code:

eval('$temp = "' . fetch_template('temp') . '";');
.

TigerC10 03-26-2009 11:25 PM

But that still won't output the template for view. They'd have to manually edit a template and throw the $temp variable in there.

Dismounted 03-27-2009 05:30 AM

If you just want to spit the template...
PHP Code:

eval('print_output("' fetch_template('temp') . '");'); 


Come2Daddy 04-09-2009 09:45 PM

actually nothing's worked, so I tried to create it again from the scratch, and it works, so I don't know where was my mistake, yet
but finally solved it :)

thank u all, for helping my


All times are GMT. The time now is 12: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.01498 seconds
  • Memory Usage 1,723KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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