vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Help in migrating a site to PHP from HTML (https://vborg.vbsupport.ru/showthread.php?t=52135)

mr e 05-07-2003 03:26 PM

it's confusing, but you use the gettemplate thing, NOT the doouput to assign a whatever text is in the template to a variable, then when you do a dooutput all those templates you assigned to variables can be used in the final dooutput template

not sure if that makes sense, it is confusing till you get the hang of it

leviw 05-07-2003 04:28 PM

Thanks for the suggestion, Logician's webtemplates hack is nice but you cant use templates from inside it, which pretty much makes it useless to me.

Sorry for being dense, but I'm still kinda confused on what exactly to use. Is this code correct, if I have a template made in forum/admin called demotemplate?

eval( '$demotemplate=( "' . gettemplate( 'demotemplate' ) . '" );' );

I ask because since php doesnt use templates per se, this is really just a creative use of variables and I think there must be some missing piece(s) here.

Could you post a full example for clarity, or if you dont know exactly I'll fiddle around with it tonight and see if I get lucky.

mr e 05-07-2003 09:32 PM

it goes like this
PHP Code:

code

eval( '$demotemplate=( "' gettemplate'demotemplate' ) . '" );' ); 
// any variables defined above can be used in this template
//the gettemplate is making $demotemplate equal everything inside the template

more code
eval( '$demotemplate1=( "' gettemplate'demotemplate1' ) . '" );' ); 
//again anything defined above this can be used in the template, even if it was above the other gettemplate

eval( 'dooutput( "' gettemplate'home' ) . '" );' );
//any variables defined above this ($demotemplate and $demotemplate1) can be used in this template
//but what happens here is that instead of having a variable equal this template you display the contents of this template to the user 

got a better idea now? :D

leviw 05-08-2003 01:19 AM

Perfect, worked like a charm! Thanks SO much for your help mr_e!

mr e 05-08-2003 02:06 AM

Glad to help :D


All times are GMT. The time now is 02:24 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.01683 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete