Announcement

Collapse
No announcement yet.

Show ad (or whatever) after every X post

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Show ad (or whatever) after every X post

    Add the following to the bottom of display_contenttype_threadview_footer:

    Code:
    {vb:set conversationCount, {vb:math ({vb:var postIndex} + ({vb:var pagingInfo.currentpage} - 1) * {vb:var pagingInfo.perpage}) + 0}}
    <vb:if condition="$conversationCount % 15 == 0">
    <div>YOUR CONTENT</div>
    </vb:if>
    With posts per page == 15, this will show YOUR CONTENT after every 1st post on every page.
    This even works when using the AJAX pagination.

    #2
    Originally posted by enduroforum View Post
    This even works when using the AJAX pagination.
    Thanks for the code. But if you put an ad code which is usually in Javascript (e.g. AdSense), the ad wouldn't be generated using the AJAX pagination.
    Helpful? Donate. Thanks!
    Buy me a coffeePayPal QR Code
    Fast VPS Host for vBulletin:
    A2 Hosting & IONOS

    Comment

    Users Viewing This Page

    Collapse

    There is 1 user viewing this forum topic.

    • Guest Guest

    Latest Posts

    Collapse

    Working...
    X
    Searching...Please wait.
    An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

    Please push the back button and reload the previous window.'
    An unexpected error was returned: 'Your submission could not be processed because the token has expired.

    Please push the back button and reload the previous window.'
    An internal error has occurred and the module cannot be displayed.
    There are no results that meet this criteria.
    Search Result for "|||"