The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
How can I work with $threadid in the navbar template?
|
#2
|
||||
|
||||
![]()
You would have to preregister the variable for use in that template. Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide
|
#3
|
||||
|
||||
![]()
Thanks! This is what worked for me:
On showthread.php replace PHP Code:
Code:
$templater = vB_Template::create('navbar'); // Resolve the root segment $templater->register('bbmenu', $vbulletin->options['bbmenu']); $templater->register('ad_location', $GLOBALS['ad_location']); $templater->register('foruminfo', $GLOBALS['foruminfo']); $templater->register('navbar_reloadurl', $GLOBALS['navbar_reloadurl']); $templater->register('thread', $thread); $templater->register('navbits', $navbits); $templater->register('notices', $GLOBALS['notices']); $templater->register('notifications_menubits', $GLOBALS['notifications_menubits']); $templater->register('notifications_total', $GLOBALS['notifications_total']); $templater->register('pmbox', $GLOBALS['pmbox']); $templater->register('return_link', $GLOBALS['return_link']); $templater->register('template_hook', $GLOBALS['template_hook']); $navbar = $templater->render(); |
#4
|
||||
|
||||
![]()
Notice: For working with the $show variable array, you need to put the $navbar creation code in showthread.php after the $show variables are set.
|
#5
|
||||
|
||||
![]()
Why don't you just preRegsiter the variable in the hook? No need to replace code in the php file.
Code:
vB_Template::preRegister('navbar', array('thread' => $thread)); |
#6
|
||||
|
||||
![]() Quote:
In this particular case I am happy to have it with the file edit as I have put the navbar template code below the part, where the $show variables are set. But I know, I may create the $show variables in a plugin, too. Just think that the 4.0.x releases are very few, so file edits are okay for me now ![]() |
#7
|
||||
|
||||
![]()
File edits are a thing of the past and not necessary anymore. But to each his own.
|
#8
|
||||
|
||||
![]() Quote:
![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|