![]() |
Quote:
|
Quote:
PHP Code:
|
well your plugin would hook where ever you wish and to access the variable in the header template it would be something like this
{vb:raw random_number} --------------- Added [DATE]1258370775[/DATE] at [TIME]1258370775[/TIME] --------------- Lynne thanks I posted there because its a huge design flaw in the new system IMO. I added my own hook name and it works fine but using the str_replace or something is needed I think because the whole point of the plugin system is to NOT make hand edits to files templates etc. anyway here is the code I posted using etc Template question for plugins. Now say for instance I want to show a block of info on forumhome. I know I can do this since the template_hook is now a super global. Code:
$templater = vB_Template::create('forumhome_addon'); Code:
|
Quote:
Furthermore, while providing more information, in the following example: PHP Code:
|
Quote:
|
Well if you can no longer display a block before the forumbits because you can not longer do a str_replace and there is not a hook for there its a design flaw. I do not beleive the point of vb4 was to go backwards from vb3 in the plugin system. if vb is going to make the only way you can include a template is through the hook system since its a superglobal then they need to do hooks everywhere. The whole purpose of the plugin system is to keep you from having to hack vb files templates.
i did what I needed to do by creating a new template hook name and editing the forumhome template to include the template hook where i wanted it. Remember in vb3 how alot of hacks appeared right before the forumbits or right after. there are no hook locations in forumhome other than in who's online. In vb3 you just did a str_replace to print your template right after the navbar. So if you can not longer do a str_replace and have to use a hook instead and there are non then its a design flaw especially somewhere as prized a location as the top of bottom of the forumbits. Just my Opinion ;) --------------- Added [DATE]1258376073[/DATE] at [TIME]1258376073[/TIME] --------------- Pitman You need to register any variables for use in a template. The initial post in this thread by lynne gives examples ;) |
I think there's now a way to preRegister the variables, so as i understood it, you'll need no more str_replace ;)
I hope realy that there will be some great articles for vB4. The best way would be, if some vbulletin developers would write articles, because they could show "us" the best way to extend vB4 |
Quote:
For example, if i want to use the template_hook method, and my template name is abc, my var name is var, and i want to use it in the forumhome template, the code should be something like this? PHP Code:
|
@Yellow Slider:
If I understand correctly, you want to evaluate the template "abc" and make the result available in the FORUMHOME template via the variable "var" ? |
Quote:
|
All times are GMT. The time now is 12:57 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|