View Single Post
  #7  
Old 06-17-2010, 06:45 AM
Kyle55155 Kyle55155 is offline
 
Join Date: Mar 2010
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DragonBlade View Post
Ah I see. This should help alot:
https://vborg.vbsupport.ru/showthread.php?t=228078

If you dont understand, feel free to ask and I'll gladly help
Dragonblade,

I read this thread a month ago when I was first trying to figure out how to get all my php code into my custom pages. It didn't make much sense back then. It makes a little more sense now. I was planning on going live with my site next week. I assume the Plugin method I chose is ok for now.

I would like to understand the method in that thread though and if it makes sense I will redo my custom pages later when I have a more firm understanding of how to implement what the thread describes

"Now, with the result of the rendering we can do several things:
.
Output template directly - custom pages

So I'm trying to understand the post in that thread. So I have lots of pages of php + html. Its basically a complete php app. So with the plugin method I am assigning a variable to an entire page of php\html content and then placing that variable in the VB template (the one found via edit > templates).

In the article I am I doing something similar right? IE assigning a variable to a page of php\html?

I'm reading the passage below and trying to figure out exactly how my custom code gets assigned to a variable.
The code in each of my php pages is unique.

PHP Code:
$templater = vB_Template::create('mytemplate');
$templater->register_page_templates();
$templater->register('my_var', $my_var);
$templater->register('my_array', $my_array);
print_output($templater->render());
This immediatly outputs the template. Use this if you have created your own page, for example.
Note the second line, which is special for this type of use:

I'm a bit of a beginner when it comes to PHP coding.
"
/* Some Code, setting variables, (multidimensional) array */
$my_var = "abc";"

so they are defining the value of $my_var as "abc" ok so how to I set a variable to my php code. Would it be $my_var = "mycustomphp.php" ??

So using my 2 template examples above (what goes where using this method to output the contents of termsbody.php??
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01029 seconds
  • Memory Usage 1,768KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete