Back to vBulletin 3.6 Template Modifications

Google AdSense (or other) after post...
Mod Version: 1.00, by goranbaxy

This modification is in the archives.
vB Version: 3.6.8 Rating: (4 votes - 5.00 average) Installs: 59
Released: 29 Jan 2008 Last Update: Never Downloads: 17
Not Supported Template Edits Re-usable Code Translations  

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 -->
After ad:

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 is how it will look like: http://www.dojaja.biz/dforum/forum-igraona/269-kaladont-na-bodove-287.html

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">
...after the first post, but only for guests:
Code:
<if condition="$post[postcount] == 1 AND !$bbuserinfo[userid]">
...after the first post, but only if the thread has at least 2 replies (so you never see a banner and only 1 post):
Code:
<if condition="$post[postcount] == 1 AND $GLOBALS[threadinfo][replycount] >= 2">
...after the first post, but only in specific forums (where X,Y,Z is a comma list of forumids):
Code:
<if condition="$post[postcount] == 1 AND in_array($GLOBALS[forumid], array(X,Y,Z))">
...after every X posts (replace X with a number):
Code:
<if condition="$post[postcount] % X == 0">
...after the last post on every page:
Code:
<if condition="$post['islastshown']">
...between the last and second to last post on every page (need to move the above code to the very top of the template instead of the bottom, then use the same condition as above):
<if condition="$post['islastshown']">
You can use pieces of these conditions to do different combinations. For example, this condition will show the banner after the first post on every page (instead of just the first page), but only for guests, and only in certain forums (where X,Y,Z is a comma list of forumids):
Code:
<if condition="$post[postcount] % $vboptions[maxposts] == 1 AND !$bbuserinfo[userid] AND in_array($GLOBALS[forumid], array(X,Y,Z))">
Please click to "Mark as Installed"

Download

No files for download.

Screenshots

Click image for larger version
Name:	web.jpg
Views:	1400
Size:	50.2 KB
ID:	75187  

Similar Mods

Show Thread Enhancements Google Adsense / Adbrite Ads Based on Length of First Post vBulletin 3.6 Add-ons

vblts.ru supports vBulletin®, 2022-2024