How do I add a random banner after the first post of a thread?

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • daemon
    replied
    Try using this conditional instead:

    Code:
    <if condition="[color=red]$post['postid'] == $GLOBALS['FIRSTPOSTID'][/color] AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))">
    I added the red code. That should work .

    Leave a comment:


  • AlexanderT
    replied
    Originally posted by Jake Bunce
    Use something like the previous code I posted, except change the red section to this:

    Code:
    <if condition="[color=red]$post[postcount] % $vboptions[maxposts] == 1[/color] [color=blue]AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))[/color]">
    That should work.
    It is not working correctly. For instance, if a user chooses 40 posts / page, the ad will be placed fine on the first page, but it will be misplaced on the following pages (i.e. does not appear after the 1st post of each page).

    Leave a comment:


  • Ramiro S
    replied
    Thank you very much... I was hacking the showthread.php to add a line but this is better.

    Leave a comment:


  • Jake Bunce
    replied
    Originally posted by Ramiro S
    How can I make it work after the first post in every thread page?
    Use something like the previous code I posted, except change the red section to this:

    Code:
    <if condition="[color=red]$post[postcount] % $vboptions[maxposts] == 1[/color] [color=blue]AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))[/color]">
    That should work.

    Leave a comment:


  • Ramiro S
    replied
    How can I make it work after the first post in every thread page?

    Leave a comment:


  • Roxie
    replied
    It shows only on the first page. I have it and it works great. Cheers.

    Leave a comment:


  • bchawla
    replied
    If a thread has 4 pages, does this show the advertisements after each 1st post on each thread

    or the first post of the whole thread.
    Last edited by bchawla; Wed 15 Dec '04, 6:11pm.

    Leave a comment:


  • Jake Bunce
    replied
    Originally posted by hdtvoice
    what is the code to only show these ads to everyone but 3 specific groups (mods, admin, donators)?
    If the 3 groups are all primary groups, then use this blue code instead:

    Code:
    <if condition="$post[postcount] == [color=green]1[/color] [color=blue]AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))[/color]">
    If some are secondary groups, then use this expanded blue code:

    Code:
    <if condition="$post[postcount] == [color=green]1[/color] [color=blue]AND !is_member_of($bbuserinfo, X) AND !is_member_of($bbuserinfo, Y) AND !is_member_of($bbuserinfo, Z)[/color]">
    Where X, Y, and Z are the usergroupids of the 3 groups.

    Originally posted by hdtvoice
    how would i go about adding more than one of these per thread? say I currently have it showing the banner after the third post, and I wanted it to load the banner code again after the 6th post as well..... basically, every three posts to a thread would show a new banner.... can this be done?
    Replace the first part of the condition (shown in red):

    Code:
    <if condition="[color=red]$post[postcount] == 1[/color] [color=blue]AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))[/color]">
    ...with the new red code:

    Code:
    <if condition="[color=red]$post[postcount] % 3 == 0[/color] [color=blue]AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))[/color]">

    Leave a comment:


  • hdtvoice
    replied
    one last thing...

    how would i go about adding more than one of these per thread? say I currently have it showing the banner after the third post, and I wanted it to load the banner code again after the 6th post as well..... basically, every three posts to a thread would show a new banner.... can this be done?

    Leave a comment:


  • hdtvoice
    replied
    Thanks!..

    one more thing..

    what is the code to only show these ads to everyone but 3 specific groups (mods, admin, donators)?

    Leave a comment:


  • Jake Bunce
    replied
    Originally posted by hdtvoice
    any way you can have this only shown to unregistered members?
    Add the blue code:

    Code:
    <if condition="$post[postcount] == 1 [color=blue]AND !$bbuserinfo[userid][/color]">
    
    $spacer_open
    <div style="padding:0px 0px $stylevar[cellpadding]px 0px">
    
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
    <tr>
    	<td class="thead" align="left">Sponsored Links</td>
    </tr>
    <tr>
    	<td class="alt1" align="center">
    		[color=red]BANNER CODE HERE[/color]
    	</td>
    </tr>
    </table>
    
    </div>
    $spacer_close
    
    </if>
    Originally posted by hdtvoice
    and anyway you can make this shown after the 3rd or so reply to the message?
    Change the number in green:

    Code:
    <if condition="$post[postcount] == [color=green]1[/color] [color=blue]AND !$bbuserinfo[userid][/color]">
    
    $spacer_open
    <div style="padding:0px 0px $stylevar[cellpadding]px 0px">
    
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
    <tr>
    	<td class="thead" align="left">Sponsored Links</td>
    </tr>
    <tr>
    	<td class="alt1" align="center">
    		[color=red]BANNER CODE HERE[/color]
    	</td>
    </tr>
    </table>
    
    </div>
    $spacer_close
    
    </if>

    Leave a comment:


  • hdtvoice
    replied
    and anyway you can make this shown after the 3rd or so reply to the message?

    Leave a comment:


  • hdtvoice
    replied
    any way you can have this only shown to unregistered members?

    Leave a comment:


  • Jake Bunce
    replied
    I just created this thread that explains how to do this.

    As for displaying your own random banners... you will probably find some banner rotation systems on www.vbulletin.org, the official vB hacking site.

    Leave a comment:


  • How do I add a random banner after the first post of a thread?

    sort of like they have at dvdtalk after the first post in the thread..

    they have sponsored goodle links, but I want my own random banners...

    example

widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...