View Full Version : template... hooks... php added...help?!
29 Apr 2008, 02:45
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.
29 Apr 2008, 03:24
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.
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 (http://www.vbulletin.org/forum/showthread.php?t=82625&highlight=plugin+hook) Take a look in the forum and read up a little to make it easier to do.
29 Apr 2008, 15:26
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
How about "None of the Above"?
If you have a hook in a template, it will look like (this one if from "postbit":
$template_hook[postbit_userinfo_right]And then in a plugin, you could go (like in the hook location "postbit_display_start"):
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".
vBulletin® v3.8.11 Beta 1, Copyright ©2000-2017, vBulletin Solutions, Inc.