Quote:
Originally Posted by Ducks
I'm trying to use a variable in SHOWTHREAD, but it's not showing for some reason.
Hook Location: showthread_start
variable: $msgbox
template variable: {vb:raw msgbox}
What can be wrong?
|
Depending on where you want to place it. For example, if you want to place above the thread, use the
showthread_above_posts template hook, then create a plugin using the
showthread complete hook location. If you open showthread.php, examine around line 2176 and below.
Try this example:
1. Add a new custom template with the following contents:
Product:
vBulletin (or if you are creating a mod, choose your product id)
Style: Style of your choice
Title: mytemplate
HTML Code:
<div id="pagetitle" class="pagetitle">
<h1>Thread: <span class="threadtitle">{vb:raw msgbox}</a></span></h1>
</div>
2. Create a new plugin:
Product:
vBulletin (or if you are creating a mod, choose your product id)
Hook Location:
showthread_complete
Execution Order: Leave as default
Plugin PHP Code:
PHP Code:
$msgbox = "Hello World";
$templater = vB_Template::create('mytemplate');
$templater->register('msgbox', $msgbox);
$template_hook[showthread_above_posts] .= $templater->render();
Plugin Is Active: Yes