p3gator
Member
Hello everyone, looking for some advice on how to get text/quotes/pics to word wrap to the left, or align properly with displaying a google adsense (or any) ad in the first and last post of every thread. So far I have it showing correctly where I want it to, but I have had no luck with a variety of div usages and floats. Either a quote in a post gets put on top of it or the text of the post gets placed beneath.
I referenced this good thread (Adding Advertisements with templates), and searched to no avail finding if someone had an example of a proper usage of the css or div to have good formatting of the ad within the post.
Here is my code, need help with the formatting to get the ad to display:
- Within the post
- Right side of the post window
- Allow the traditional user post to wrap around the box on the left side and beneath
I don't need any troubleshooting with the conditionals (unless there is a better way to clean it up!), but mention what works for me since it may help someone else. I found all of these thanks to others that posted them across different threads here, and just combined them to get what I wanted/desired. The conditionals that are working successfully (for me at least), are to:
- Not display to anyone in usergroup 19 (contributors)
- Show on first post
- Show on last post OR Show on last post of only 1 page
- Do not show in conversations
Attached are two example pics of what it is generating with the ads, and arrows pointing where I want the ad to be.
I imagine that this is probably very trivial to some of you, but it has been eluding me on how to properly format. Thanks in advance for anyone that can help me out.
John
I referenced this good thread (Adding Advertisements with templates), and searched to no avail finding if someone had an example of a proper usage of the css or div to have good formatting of the ad within the post.
Here is my code, need help with the formatting to get the ad to display:
- Within the post
- Right side of the post window
- Allow the traditional user post to wrap around the box on the left side and beneath
Code:
<xen:if is="!{$message.conversation_id}">
<xen:if is="!{xen:helper ismemberof, $visitor, 19}">
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0">
<div style=”display:block;margin: 5px 5px 5px 5px;”>
AD CODE FIRST POST AD
</div>
<xen:else />
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == {$xenOptions.messagesPerPage} - 1 OR {$post.position} == {$totalPosts} - 1">
<div style=”display:block;margin: 5px 5px 5px 5px;”>
AD CODE LAST POST AD
</div>
</xen:if>
</xen:if>
</xen:if>
</xen:if>
I don't need any troubleshooting with the conditionals (unless there is a better way to clean it up!), but mention what works for me since it may help someone else. I found all of these thanks to others that posted them across different threads here, and just combined them to get what I wanted/desired. The conditionals that are working successfully (for me at least), are to:
- Not display to anyone in usergroup 19 (contributors)
Code:
<xen:if is="!{xen:helper ismemberof, $visitor, 19}">
Code:
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0">
Code:
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == {$xenOptions.messagesPerPage} - 1 OR {$post.position} == {$totalPosts} - 1">
Code:
<xen:if is="!{$message.conversation_id}">
Attached are two example pics of what it is generating with the ads, and arrows pointing where I want the ad to be.
I imagine that this is probably very trivial to some of you, but it has been eluding me on how to properly format. Thanks in advance for anyone that can help me out.
John