XF 2.1 Native advertisement system shows ad below each deleted post even if not defined to show like that

Andro

Well-known member
Hi,

I show only 3 ads per page on any thread. But if moderators delete any post ad get shown below every deleted posts. For undeleted posts, the advertisement system works as expected.

Strage thing is, if i delete only 1 or 2 post it doesn't happen but if many posts deleted (may be post containing ad below it) it happens.

Hopefully some workaround will be implemented to fix this pesky bug.
 
We have our own conditions defined which shows ads after 1st, 4th, 7th post but if multiple posts get deleted ads get messed up and shown below each deleted posts.
 
You likely need to factor the visible state of the post within that condition. If you share the exact conditional code you're using at the moment, I may be able to advise how to expand it.
 
For below 4th post:
<xf:if is="$post.position % $xf.options.messagesPerPage == 4">
<xf:if is="$post.position % $xf.options.messagesPerPage == 4 AND $post.message_state == 'visible'">

For below last post (10 posts per page page):
<xf:if is="$post.position % $xf.options.messagesPerPage == 9">
<xf:if is="$post.position % $xf.options.messagesPerPage == 9 AND $post.message_state == 'visible'">
 
Back
Top Bottom