<xen:hook name="ad_message_below" />
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND {$thread.reply_count} > 0">
<xen:if is="!{$visitor.user_id}">
<li class="message">
<div class="messageUserInfo">
<div class="messageUserBlock">
<div class="avatarHolder" style="height: 102px; width: 102px">
<span class="helper"></span>
<img src="http://cliptheapex.com/data/avatars/m/0/2.jpg" alt="Avatar" height="96px" width="96px" style="border: 1px solid #C0C0C0; padding: 2px" />
</div>
<h3 class="userText">
<span style="font-weight: bold">Google AdSense</span>
<em class="userTitle" itemprop="title">Guest Advertisement</em>
</h3>
<span class="arrow"><span></span></span>
</div>
</div>
<div class="messageInfo primaryContent">
<div class="messageContent">
<article>
<blockquote class="messageText ugc baseHtml">
<script type="text/javascript"><!--
google_ad_client = "***";
/* Message Below */
google_ad_slot = "***";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br /><br /><label for="LoginControl"><span style="font-weight: bold; color: #004400"><a href="login/" class="concealed noOutline">Log in or Sign up</a></span></label> to hide all adverts.
</blockquote>
</article>
</div>
</div>
</li>
</xen:if>
</xen:if>
Doesn't help. The ad is still appearing in conversations and is still appearing after every post.Have you tried:
<xen:if is="{$message.position} == 0 AND !{$message.conversation_id}">
I know it works in ad_message_below.I can confirm those conditionals work in the ad_ templates, I use them myself.
Here's mine:
Code:<xen:hook name="ad_message_below" /> <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND {$thread.reply_count} > 0"> <xen:if is="!{$visitor.user_id}"> <li class="message"> <div class="messageUserInfo"> <div class="messageUserBlock"> <div class="avatarHolder" style="height: 102px; width: 102px"> <span class="helper"></span> <img src="http://cliptheapex.com/data/avatars/m/0/2.jpg" alt="Avatar" height="96px" width="96px" style="border: 1px solid #C0C0C0; padding: 2px" /> </div> <h3 class="userText"> <span style="font-weight: bold">Google AdSense</span> <em class="userTitle" itemprop="title">Guest Advertisement</em> </h3> <span class="arrow"><span></span></span> </div> </div> <div class="messageInfo primaryContent"> <div class="messageContent"> <article> <blockquote class="messageText ugc baseHtml"> <script type="text/javascript"><!-- google_ad_client = "***"; /* Message Below */ google_ad_slot = "***"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <br /><br /><label for="LoginControl"><span style="font-weight: bold; color: #004400"><a href="login/" class="concealed noOutline">Log in or Sign up</a></span></label> to hide all adverts. </blockquote> </article> </div> </div> </li> </xen:if> </xen:if>
Here is the listener file:EDIT: Oh I see. Can I see your Listener?
<?php
class TwistedPromotion_TagCloud_Listener_Listener
{
public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
if ($hookName == 'ad_message_below')
{
$contents .= $template->create('twistedpromotion_tagcloud');
}
}
}
?>
<?php
class TwistedPromotion_TagCloud_Listener_Listener
{
public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
if ($hookName == 'ad_message_below')
{
$contents .= $template->create('twistedpromotion_tagcloud', $template->getParams());
}
}
}
?>
That's not working either:Try this:
PHP:<?php class TwistedPromotion_TagCloud_Listener_Listener { public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template) { if ($hookName == 'ad_message_below') { $contents .= $template->create('twistedpromotion_tagcloud', $template->getParams()); } } } ?>
if ($hookName == 'message_below')
{
$contents .= $template->create('twistedpromotion_tagcloud', $hookParams);
}
Thanks. That's fixed the message appearing after every post issue.Yeah, thought so. It's basically what Jake said.
You need to use the message_below hook instead, but slightly different to what I said earlier.
This works:
Code:if ($hookName == 'message_below') { $contents .= $template->create('twistedpromotion_tagcloud', $hookParams); }
Thanks, that did the trick.It will be: AND !{$post.conversation_id}
$post and $message aren't used together. It's usually one or other.
We use essential cookies to make this site work, and optional cookies to enhance your experience.