PDA

View Full Version : Template Hook on Postbit Legacy


Black Snow
05-19-2015, 12:51 PM
I'm using a plugin to add some info to each post in a thread:

Template hook: parse_templates
$templater = vB_Template::create('new_info');
$template_hook['postbit_messagearea_start'] .= $templater->render();

I have used similar code before to insert a script into my header template which works a charm like this:
$templater = vB_Template::create('new_javascript');
$template_hook['headinclude_javascript'] .= $templater->render();

All I have in the template is:
hello

But the word "hello" is not being shown on my postbit. Can any see anything I've done wrong?

--------------- Added 1432047452 at 1432047452 ---------------

Found out the issue. I used parse_templates instead of postbit_display_complete hook.

--------------- Added 1432048884 at 1432048884 ---------------

I've got another issue now. When using postbit_display_complete hook, I am trying to display a link to the post ID using this:
<a name="post{vb:raw post.postid}" href="{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}#post{vb:raw post.postid}" class="<vb:if condition="$show['inlinemod']">ie</vb:if>postcounter">#{vb:raw post.postcount}</a><a id="postcount{vb:raw post.postid}" name="{vb:raw post.postcount}"></a>

I know this code is already on each post but I have another use for it.

When I run the plugin, all I get is a hash tag and a semi-finished link. This is the output:
http://MY_FORUM/test/showthread.php?1-test#post

And all it shows is a "#" without the post ID. It should link like:
http://MY_FORUM/test/showthread.php?1-test#post2

Is this because the plugin hook is rendered before the template? If so, what other hook could I use which would allow me to get the correct output?