The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
I can't follow this on two sites. I guess I'll check the other thread tomorrow morning. However, if you didn't post all your code over there, then I'm not gonna be able to help. (Actually, you should probably continue this over here if you need code help since they don't like discussing plugin code and such over there.) So, post your code here and we'll see if we can figure out what is wrong. Include template code if you are calling templates also.
|
#12
|
||||
|
||||
Quote:
PHP Code:
|
#13
|
|||
|
|||
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'); $templater->register_page_templates(); $templater->register('block_info', $block_info); $template_hook['navbar_end'] .= $templater->render(); Code:
$templater = vB_Template::create('forumhome_addon'); $templater->register_page_templates(); $templater->register('block_info', $block_info); $thistemplater = $templater->render(); $search_text = '<div id=\"pagetitle\">'; $vbulletin->templatecache['FORUMHOME'] = str_replace($search_text,$thistemplater.$search_text,$vbulletin->templatecache['FORUMHOME']); |
#14
|
||||
|
||||
Quote:
Furthermore, while providing more information, in the following example: PHP Code:
|
#15
|
||||
|
||||
What design flaw do you mean exactly ?
|
#16
|
|||
|
|||
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 |
#17
|
|||
|
|||
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 |
#18
|
|||
|
|||
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:
|
#19
|
||||
|
||||
@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" ? |
#20
|
|||
|
|||
Yes.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|