vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   template... hooks... php added...help?! (https://vborg.vbsupport.ru/showthread.php?t=177452)

CommanderFluffy 04-29-2008 12:45 AM

template... hooks... php added...help?!
 
hi. ive been trying to add a total template and i really would like it all to be a php of such since the rest of the site is. i have been trying to get my head around this hooks system since it is aparently from where ive been reading makes the templates load faster. so ive made custom hooks and what not just how do i add them or make them templates. i have html code do i add it in the plugins with the hook or what. ive looked all over and theirs really no explanation on how it makes templates. it just says to add these variables but they say nothing else about the html or php side of the system.

any help would be apreciated on how i make this work.

regards,
Fluffy

King Kovifor 04-29-2008 01:24 AM

Using the hook system is like editing files. When you add a plugin, it stores the code inside of the database. When the file is run where the hook is located, the PHP code
is automatically run.

Lynne 04-29-2008 02:12 AM

Have you tried looking through the articles forum for articles about plugins and hooks and templates. Here's one on plugins and hooks:[How to] Write Plug-ins/Hooks Take a look in the forum and read up a little to make it easier to do.

CommanderFluffy 04-29-2008 01:26 PM

ok so now i know how to use it. now how do i put a hook into a template to displat what the php is calling for? do i use the a command like
Code:

<if condition=$hook[name]></if>
or
<phrase>$hook[name]</phrase>
or
<lable>$hook[name]</lable>


Lynne 04-29-2008 03:08 PM

How about "None of the Above"?

If you have a hook in a template, it will look like (this one if from "postbit":
Code:

$template_hook[postbit_userinfo_right]
And then in a plugin, you could go (like in the hook location "postbit_display_start"):
Code:

eval('$template_hook[postbit_userinfo_right] .= " ' . fetch_template('postbit_your_own_template') . '";');
And that would spit out the content of your template "postbit_your_own_template" in the location of the $template_hook[postbit_userinfo_right]. You would write your php to spit out stuff into your template "postbit_your_own_template".


All times are GMT. The time now is 03:25 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.00930 seconds
  • Memory Usage 1,719KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete