![]() |
Insert a faux post between the first and second posts
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. Code:
<li class="postbitlegacy postbitim postcontainer" id="post_faux"> Code:
Hook location: cache_templates Code:
Hook location: showthread_postbit_create I have been following this thread (https://vborg.vbsupport.ru/showthrea...ht=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? |
The template isn't cached because it isn't $THIS_SCRIPT, it should be simply THIS_SCRIPT.
And what did you add to the SHOWTHREAD template to get this code/template to display? Since all the posts are added by this single line in that template, I really can't see how you think what you are doing is going to add something between the first and second post: HTML Code:
{vb:raw postbits} |
I used this if statement to intercept the create of the postbit.
Code:
if ($show['fauxcanview'] === true AND $counter == 1 AND $fetchtype == 'post' AND $post['visible'] == 1) |
I don't see how that is going to work in the SHOWTHREAD template. $postbits is already defined by the time the template is being rendered, so exactly how are you going to slip a post into that array while in the SHOWTHREAD template?
|
We already have a mod for inserting messages/ads where you are asking for them.
https://vborg.vbsupport.ru/showthread.php?t=239981 Simply download that and input whatever you want into it. |
OK - I missed the last part of my if statement.
Code:
if ($show['fauxcanview'] === true AND $counter == 1 AND $fetchtype == 'post' AND $post['visible'] == 1) Quote:
Mark |
It has the ability to exclude usergroups and forums built in :P
|
Quote:
OK - here is my final code. I used the showthread_post_start hook location instead of the postbit_display_complete. I don't know if it make a difference both are only called once. Code:
if ($show['fauxcanview'] === true AND $counter == 1 AND $fetchtype == 'post' AND $post['visible'] == 1) --------------- Added [DATE]1367196421[/DATE] at [TIME]1367196421[/TIME] --------------- Quote:
|
All times are GMT. The time now is 02:03 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|