XF 1.1 How do I add a single Ad within the 1st post only, in a thread?

Marco Famà

Active member
Dear all,
what I would like to achieve is something like what you can see here
http://forum.telefonino.net/showthread.php?t=858407
That is, I need to publish my Ad code within the first message of a thread, and nothing more.

Can this be done with ease? I've seen several post regarding AdSense under the breadcrumb or after the first post. I need it to appear aside.

thanks guys
Marco
 
Great!
For future reference (maybe it can help someone with the very same question of mine?), this is how I solved it:

Code:
<xen:hook name="ad_message_body" />
<xen:if is="{$post.position} == 0 AND !{$message.conversation_id}">
<div style="display: block; float: right; vertical-align: middle">
 
// here it goes my code
 
</div>
</xen:if>

Thanks Brogan, really appreciate your help
Marco
 
ciao Brogan,
is there another way to edit the following code

Code:
<xen:if is="!{$message.conversation_id} AND !{$ajaxInsert} AND {$post.position} == 0">

to make something appear only in the first post of each page?
If I remove the AND {$post.position} == 0 the banner gets replicated into ALL posts, and I'm not sure I understood why

Can you please help Brogan/all?

Thanks!
Marco
 
http://xenforo.com/community/resources/conditional-statements.1604/

How can I show content after post x on every page in a thread?
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == x AND !{$message.conversation_id}">
This content will show after post x on every page in a thread
</xen:if>

hey Brogan
do you know if a conditional statement to check which browser the user is navigating forum froms, is available? Tried searching your link with no result... can you please help?

Thanks
Marco
 
Top Bottom