The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Google AdSense (or other) after post... Details »» | ||||||||||||||||||||||||||
I found this cod on vublletin.org and did some customization, I found this very useful and good place for ads.
Show a banner/ad after first (or somewhere else) post, show it to guests | register users | users with less then X posts... This is what I have: - It will show ad/banner after first post on every page (instead of just the first page) but only to guests. Admin CP -> Styles & Templates -> Style Manager -> ? ? -> Postbit Templates -> Edit postbit or postbit_legacy (depending on which layout you are using) Find: Code:
<!-- / post $post[postid] popup menu --> Code:
<if condition="$post[postcount] % $vboptions[maxposts] == 1 AND !$bbuserinfo[userid]"> <div style="padding: $stylevar[cellpadding]px 0px 0px 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"> BANNER CODE HERE </td> </tr> </table> </div> </if> Here are several other conditions you can use in the above code to show the banner in different places. Simply replace the first "if" statement. ...after the first post on every page (instead of just the first page): Code:
<if condition="$post[postcount] % $vboptions[maxposts] == 1"> Code:
<if condition="$post[postcount] == 1 AND !$bbuserinfo[userid]"> Code:
<if condition="$post[postcount] == 1 AND $GLOBALS[threadinfo][replycount] >= 2"> Code:
<if condition="$post[postcount] == 1 AND in_array($GLOBALS[forumid], array(X,Y,Z))"> Code:
<if condition="$post[postcount] % X == 0"> Code:
<if condition="$post['islastshown']"> Quote:
Code:
<if condition="$post[postcount] % $vboptions[maxposts] == 1 AND !$bbuserinfo[userid] AND in_array($GLOBALS[forumid], array(X,Y,Z))"> Show Your Support
|
Comments |
#12
|
|||
|
|||
If you are displaying ads only to guests you can replace this code:
Code:
<td class="thead" align="left">Sponsored Links</td> Code:
<td class="thead" align="left"><a href="http://www.mysite.com/linkToPost.php">Remove ads from forum!</a></td> |
#13
|
|||
|
|||
thanks..
installed. |
#14
|
|||
|
|||
very nice, thanks.
|
#15
|
|||
|
|||
How would you make it visible only to certain usergroups?
I'd like to make it not visible to admins, mods, and donors. |
#16
|
|||
|
|||
You can try this:
Code:
<if condition="!is_member_of($bbuserinfo, X, Y, Z)"> Try it and let me know did it work. |
#17
|
|||
|
|||
Hi,
I tried using this conditional code of yours... Quote:
In a thread with a total of 37 posts, it displays the ad after the 5th post, 15th post, 25th post and 35th post. But it is just making space for the ad after the 10th post, 20th post, 30th post. But not showing the ad. Why? Please can you help fix this for me. This also spoiled the display of ads after the last post in every page that was working fine earlier. I'm also using conditionals for "after 1st post on every page", that is working fine. Thanks in advance. |
#18
|
|||
|
|||
@induslady: can you add a screen shoot, I'm not sure I understand what you're talking about.
|
#19
|
|||
|
|||
Hello,
Thank you for your response. I am attaching screen shots and have explained below what's happening on using this condition... Quote:
Meaning, I want to show Google ads below every 5th post in the thread. My forum threads have max 10 posts per page. Using the above condition, I am able to get ads displayed below 5th post. (refer image 1 - showing ad) But ads are not getting displayed below 10th post. (refer image 2 - no ad - white space) While ads are getting displayed below 15th post too. (refer image 3 - showing ad) But again ads are not getting displayed below 20th post. (refer image 4 - no ad - white space) I used to have conditions included for displaying ads "below the 1st post in all pages of the thread and below the last post in all pages of the thread". After I included the above condition to display ad below the 'X' post, the condition for displaying ads below last post in all pages of a thread is also not working. While I have ads below 1st post in all pages of a thread working fine. Hope my issue is clear now with the screen shots and the explanation. Please advise. Thanks. |
#20
|
|||
|
|||
Did you use this code to display ads on last post on every page?
Code:
<if condition="$post['islastshown']"> |
#21
|
|||
|
|||
Yes, to display ads below the last post in all pages of the thread, I use...
Quote:
Quote:
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|