markp_2000
04-28-2013, 07:11 PM
I am trying to insert a faux post between the first and second post of a thread.
I can't quite get if figured out.
I have a template modeled after the postbit template called postbit_faux.
<li class="postbitlegacy postbitim postcontainer" id="post_faux">
<div class="posthead">
<span class="faux-header">Community FAQ</span>
</div>
<div class="postbody">
<div class="postrow">
<div id="post_message_faux">
{vb:raw fauxmessage}
</div>
</div>
</div>
<div class="faux-postfoot">
<a href="faux.php?{vb:raw session.sessionurl}t={vb:raw threadid}"><img src="{vb:stylevar imgdir_button}/edit.gif" alt="{vb:rawphrase edit_delete_lock_faux}" border="0" /></a>
</div>
<hr />
</li>
I am using the following hooks
Hook location: cache_templates
// for a single template
if ($THIS_SCRIPT == 'showthread') {
$cache[] = 'postbit_faux';
}
Hook location: showthread_postbit_create
// posbit
$templater = vB_Template::create('postbit_faux');
$templater->register('fauxmessage',$thread['fauxmessage'];
$templatevalues['fauxmessage'] = $templater->render();
vB_Template::preRegister('SHOWTHREAD', $templatevalues);
The template does not cache (it shows up in red) and the template is not being displayed.
I have been following this thread (https://vborg.vbsupport.ru/showthread.php?t=287225&highlight=preregister) but no love.
I looked at this thread (https://vborg.vbsupport.ru/showthread.php?t=279650) and though the may be the ticket but I did not want to modify the postbit template.
Can I use a hook to accomplish what is in the above thread?
I can't quite get if figured out.
I have a template modeled after the postbit template called postbit_faux.
<li class="postbitlegacy postbitim postcontainer" id="post_faux">
<div class="posthead">
<span class="faux-header">Community FAQ</span>
</div>
<div class="postbody">
<div class="postrow">
<div id="post_message_faux">
{vb:raw fauxmessage}
</div>
</div>
</div>
<div class="faux-postfoot">
<a href="faux.php?{vb:raw session.sessionurl}t={vb:raw threadid}"><img src="{vb:stylevar imgdir_button}/edit.gif" alt="{vb:rawphrase edit_delete_lock_faux}" border="0" /></a>
</div>
<hr />
</li>
I am using the following hooks
Hook location: cache_templates
// for a single template
if ($THIS_SCRIPT == 'showthread') {
$cache[] = 'postbit_faux';
}
Hook location: showthread_postbit_create
// posbit
$templater = vB_Template::create('postbit_faux');
$templater->register('fauxmessage',$thread['fauxmessage'];
$templatevalues['fauxmessage'] = $templater->render();
vB_Template::preRegister('SHOWTHREAD', $templatevalues);
The template does not cache (it shows up in red) and the template is not being displayed.
I have been following this thread (https://vborg.vbsupport.ru/showthread.php?t=287225&highlight=preregister) but no love.
I looked at this thread (https://vborg.vbsupport.ru/showthread.php?t=279650) and though the may be the ticket but I did not want to modify the postbit template.
Can I use a hook to accomplish what is in the above thread?