Where are you adding that code? To which template?
You should be using the ad_ templates now.
<xen:include template="adsense_firstpost_fakeuser" />
If anyone can figure out how to get it to appear after the first post on every page (instead of just the first page), let me know.
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !in_array({$forum.node_id}, array(99,126,134)) AND !{$visitor.user_id}">
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
</xen:if>
<xen:if is="!in_array({$forum.node_id}, array(99,126,134)) AND !{$visitor.user_id}">
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
</xen:if>
<xen:if is="!{$visitor.user_id}" OR { ??? }>
ADSENSE
</xen:if>
<xen:if is="!{$visitor.user_id} OR {$contentTemplate} == 'EWRporta_Portal'">
ADSENSE CODE
</xen:if>
How can I find out which template to edit?I just can't figure out how to say... only on the main XenPorta page.
Any ideas?
<xen:hook name="ad_thread_view_below_messages" />
<xen:if is="{$visitor.user_group_id} == 1 OR {$visitor.user_group_id} == 2 OR {$visitor.user_group_id} == 4 OR {$visitor.user_group_id} == 6 OR {$visitor.user_group_id} == 9 OR {$visitor.user_group_id} == 10">
<div style="text-align: center">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-xxx";
/* RD Bottom Links */
google_ad_slot = "xxx";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</xen:if>
Is anyone having an issue with this code?
While the ad shows up great, if you attempt to do an in-line edit on the first post of the thread.... when you click save the 'Save Changes'' button, the first post goes away until you refresh the page.
<xen:hook name="ad_message_below" />
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
<xen:comment>after 1st post</xen:comment>
</li><li id="after_1st_post_ad" class="message">
<div align="center" style="background: white; padding: 10px; margin: 10px auto; border: 1px solid black; border-radius: 10px;">
<xen:if is="{xen:helper ismemberof, $visitor, 20, 12, 9}">
SFN Supporters & VIPs don't see this ad.
<xen:else />
<xen:if is="{$forum.node_id} == 6">
adult ad code here
<xen:else />
adsense ad code here
</xen:if>
</xen:if>
</div>
<xen:else />
<xen:comment>between all other posts & PCs</xen:comment>
</xen:if>
<xen:hook name="ad_message_below" />
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id} AND !{xen:helper ismemberof, $visitor, 20, 12, 9}">
<div align="center" style="background: white; padding: 10px; margin: 10px auto; border: 1px solid black; border-radius: 10px;">
adsense ad code here
</div>
</li>
</xen:if>
How can I find out which template to edit?
Using your browser, view the page source and look for a line of code near the top of the page which begins
<div id="content" class="; the class is the name of the template. So for the main forum page, the line of code is:
<div id="content" class="forum_list">, which makes the template forum_list.
http://xenforo.com/community/threads/frequently-asked-questions.5183/#post-181112
The list of conditionals is here: http://xenforo.com/community/threads/frequently-asked-questions.5183/#post-182355
How can I show content on a specific page?
<xen:if is="{$contentTemplate} == 'xyz'">
This content will show on the xyz template</xen:if>
<xen:if is="{$contentTemplate} != 'xfr_useralbums_member_albums_list_grig' AND {$contentTemplate} != 'xfr_useralbums_album_view' AND {$contentTemplate} != 'xfr_useralbums_albums_list_grid'">
<xen:if is="!in_array({$contentTemplate}, array('xfr_useralbums_add_images', 'xfr_useralbums_albums_list', 'xfr_useralbums_albums_list_grid', 'xfr_useralbums_album_view', 'xfr_useralbums_member_albums_list', 'xfr_useralbums_member_albums_list_grig', 'xfr_useralbums_add_images', 'xfr_useralbums_image_view'))">
We use essential cookies to make this site work, and optional cookies to enhance your experience.