PDA

View Full Version : template... hooks... php added...help?!


CommanderFluffy
29 Apr 2008, 01: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.

regards,
Fluffy

King Kovifor
29 Apr 2008, 02: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.

Lynne
29 Apr 2008, 03:12
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.

CommanderFluffy
29 Apr 2008, 14: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


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Lynne
29 Apr 2008, 16:08
How about "None of the Above"?

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


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

And then in a plugin, you could go (like in the hook location "postbit_display_start"):


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

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".