View Full Version : Show Thread Enhancements - Google Adsense after first post (or other advertisements)
Allan
12-31-2009, 10:00 PM
With this mod, you can add an advertisement as Google Adsence or other advertisements.
In the "postbit" or "postbit_legacy", add to the end:<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<div class="attachments">
<div style="width: 100%; text-align: center">
Your text here
</div>
</div>
</vb:if>
2nd method, in the "ad_showthread_firstpost" template, add: <div class="attachments">
<div style="width: 100%; text-align: center">
Your text here
</div>
</div>PS: I use class "attachments", it's just for the fun ^^
Cableguy69
01-02-2010, 01:14 AM
Nice mod thanks.
Nice work, was hoping it was like the 3.8 mod. ;)
https://vborg.vbsupport.ru/showthread.php?t=194817
Alecsmith
01-02-2010, 05:59 AM
Tagged for future :)
fayax
01-02-2010, 06:05 AM
Nice work, was hoping it was like the 3.8 mod. ;)
https://vborg.vbsupport.ru/showthread.php?t=194817
Yup I could like that too?
will it be made like that eventually?
ninjashoes
01-03-2010, 07:25 PM
How would I exclude this from certain forums and also show to guests only?
fayax
01-04-2010, 05:01 AM
hmm.. I mustve done something wrong. Couldnt get it to work. Not voted anyway.
Krysalid
01-05-2010, 10:12 AM
Merci Allan .. ;)
KevinGupta
01-05-2010, 07:25 PM
ok 2 questions...
1) In "Your Text Here" field do you put in the HTML version for the advertisement? If Yes, how do you do it? (Sorry, I am not good at coding at all)
2) How can I exclude it from certain usergroups? I need this, importantly
:) Waiting for your reply now :D
haluk
01-05-2010, 07:54 PM
How Can I add an ad after second or third posts ?
Is there a way ?
meissenation
01-08-2010, 02:01 PM
How Can I add an ad after second or third posts ?
Is there a way ?
Change:
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
to:
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '2')">
-or-
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '3')">
respectively.
albrens
01-08-2010, 04:42 PM
Thank you
But there a blank speac :(
Have look
http://upload.traidnt.net/upfiles/Sg776678.png
Gene Steinberg
01-10-2010, 02:36 PM
How about a method to reduce the width to the normal maximum of 728pixels, and then center that object without the gray border? Or just eliminate the gray background?
How is that done?
Also is there a code to have it go after the 1st and 4th posts and perhaps the last post too?
Peace,
Gene
SpongeBob71
01-14-2010, 04:46 PM
Does anyone else have the issue of NOT having a space between the end of the first thread and the mods grey box? Mine is stuck together and does not have the space.
I have 4.1.
-SB
cagbaazee
01-16-2010, 03:33 AM
I donot find the code here... please discuss
justhackerz
01-16-2010, 06:45 AM
I got alot of Error with this try to Fix it to work with AdBrite.:mad:
Cableguy69
01-16-2010, 08:24 AM
How about a method to reduce the width to the normal maximum of 728pixels, and then center that object without the gray border? Or just eliminate the gray background?
How is that done?
Also is there a code to have it go after the 1st and 4th posts and perhaps the last post too?
Peace,
Gene
Does anyone else have the issue of NOT having a space between the end of the first thread and the mods grey box? Mine is stuck together and does not have the space.
I have 4.1.
-SB
Method 1
<br \>
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<div class="body">
<div style="width: 100%; text-align: center">
<a href="ink to ad"><img src="http://your-ad-image-link.com" width="728"></a>
</div>
</div>
</vb:if>
Method 2
<br \>
<div class="body">
<div style="width: 100%; text-align: center">
<a href="ink to ad"><img src="http://your-ad-image-link.com" width="728"></a>
</div>
</div>
Both methods above will make a space get rid of the border and resize the images to 728px wide.
if you want to resize the height you should add height="X" (change x to your own value)
EG: <img src="http://your-ad-image-link.com" width="728" height="75">
The grey border is caused by <div class="attachments"> so in my examples I've changed it to <div class="body"> to make the border disappear.
barcena
01-16-2010, 04:58 PM
I used the first option
?In the "postbit" or "postbit_legacy", add to the end:
Where it says Enter Text i did enter the Ad HTML code... Is that right?
I can't see anything so far between posts or in any place at all, what I'm doing wrong please?
barcena
01-16-2010, 05:29 PM
Id manage, my mistake, was entering the code after the very ending after the raw thing, sorry i'm not coder at all.
Now, if I can just get rid of those white areas will be a blessing.
utahraves
01-16-2010, 05:41 PM
I like mine to display every 5 posts... so I use this line. :)
<vb:if condition="(THIS_SCRIPT == showthread) AND (($post[postcount] % 5) == 0)">
barcena
01-17-2010, 03:48 AM
How can I do so it will display on every page of every thread?
Right now is only showing on the first page of a given thread.
Bear w/ me since i'm not coder.
Thanks.
djbaxter
01-20-2010, 02:30 PM
Your code:
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<div class="attachments">
<div style="width: 100%; text-align: center">
Your text here
</div>
</div>
</vb:if>
places the ad ONLY after Post#1.
How to modify it so that if the thread spans multiple pages the ad appears after the first post on each page?
ninjashoes
01-20-2010, 04:18 PM
I know theres an if conditional to get this to appear in the subforums you want. I just don't know exactly what I need to put in there.
I need one of the smart coders on here to give me what I need for this to work. This is just the first part. It worked before version 4.0
<vb:if condition="$foruminfo['forumid'] == 9 OR $foruminfo['forumid'] == 20 OR $foruminfo['forumid'] == 11 OR $foruminfo['forumid'] == 21 OR $foruminfo['forumid'] == 48 OR THIS_SCRIPT == 'newthread' OR THIS_SCRIPT == 'editpost' OR THIS_SCRIPT == 'register' OR THIS_SCRIPT == 'search' OR THIS_SCRIPT == 'usercp' OR THIS_SCRIPT == 'inlinemod' OR THIS_SCRIPT == 'member' OR THIS_SCRIPT == 'online' OR THIS_SCRIPT == 'newreply' OR THIS_SCRIPT == 'login' OR THIS_SCRIPT == 'private'">
nomoreturn
01-24-2010, 01:49 PM
installed but gor this error
The following error occurred when attempting to evaluate this template:
Parse error: syntax error, unexpected '[' in /home/****/public_html/includes/adminfunctions_template.php(4597) : eval()'d code on line 12
993ti
01-26-2010, 03:07 PM
Your code:
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<div class="attachments">
<div style="width: 100%; text-align: center">
Your text here
</div>
</div>
</vb:if>
places the ad ONLY after Post#1.
How to modify it so that if the thread spans multiple pages the ad appears after the first post on each page?
Instead of
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
Use
<vb:if condition="(THIS_SCRIPT == showthread) AND !$GLOBALS['FIRSTPOSTID']">
Works for me :)
djbaxter
01-26-2010, 03:22 PM
Instead of
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
Use
<vb:if condition="(THIS_SCRIPT == showthread) AND !$GLOBALS['FIRSTPOSTID']">
Works for me :)
That's perfect. Thank you!
haluk
01-27-2010, 06:37 AM
Instead of
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
Use
<vb:if condition="(THIS_SCRIPT == showthread) AND !$GLOBALS['FIRSTPOSTID']">
Works for me :)
Thank you. But how can I add ads after second or third (or fourth) post on every page?
RedHacker
01-27-2010, 07:51 PM
Dont show anything and if put second method show ads inside first post...
RedHacker
01-28-2010, 05:36 PM
I have 16:9 1920*1080....
mrfrisky
02-07-2010, 03:20 PM
Is there a way though, to show the same size adsense ad just above or below the reply box?
RedHacker
02-07-2010, 03:21 PM
Not supported uninstall
djbaxter
02-07-2010, 03:39 PM
Is there a way though, to show the same size adsense ad just above or below the reply box?
Not supported uninstall
You really don't need this or any other add-ons to do this. It can be done within standard vBulletin 4.x:
Admin CP | Styles & Templates | Edit Templates =>
ad_showthread_beforeqr
Aclikyano
02-08-2010, 01:59 PM
^ i used
ad_showthread_firstpost :)
perfect!
haXan
02-15-2010, 07:56 AM
I need this adsense codes must be every page.
But this code putting adsense only first message below. Not every page. Only first page.
How can I put every page ?
murratti
02-15-2010, 10:23 AM
can we use this hack for custom forums? For example my forum has a A-B-C-D titles forums, and i only want to display my advertisement at C Forum...Not every forum thread...i think i could tell my problem...Can we have a chance for it?
regards
haXan
02-15-2010, 11:16 AM
can we use this hack for custom forums? For example my forum has a A-B-C-D titles forums, and i only want to display my advertisement at C Forum...Not every forum thread...i think i could tell my problem...Can we have a chance for it?
regards
I think you cant do this via this hack...
djbaxter
02-15-2010, 12:25 PM
I need this adsense codes must be every page.
But this code putting adsense only first message below. Not every page. Only first page.
How can I put every page ?
See https://vborg.vbsupport.ru/showpost.php?p=1967132&postcount=26
gsmlover4u
02-21-2010, 04:40 AM
uninstalled not working
utahraves
02-22-2010, 01:50 AM
was working with 4.0.1 but not 4.0.2 :(
Spika
02-27-2010, 07:36 AM
The grey border is caused by <div class="attachments"> so in my examples I've changed it to <div class="body"> to make the border disappear.
Works fine with this change in 4.0.2 pl1!
Thanks!
See https://vborg.vbsupport.ru/showpost.php?p=1967132&postcount=26
Worked Perfectly well for me.Thanks.
Diablotic
03-09-2010, 09:24 AM
How to add adsense after last post in the thread?
Figured it out: http://www.vbulletin.com/forum/showthread.php?t=157022
Mostjolly
03-14-2010, 08:42 PM
how i show adsense after post 1,5 and 8 at the SAME TIME?
Dr.osamA
03-17-2010, 02:45 AM
installed
thanxxx Allan keep it up
5 Stars
domi681
03-17-2010, 08:15 AM
Hello, I read all the comments and there are many choices, but please explain how I can insert it to the last post written. Is that all users see and the one for prints.
thanks.
meonet
03-17-2010, 01:31 PM
standard vbulletin 4.0.2 already have this function so i can think that this modification it's not more needed.
Admin CP -> Styles & Templates -> Style Manager -> Edit Templates -> Ad Location Templates -> ad_showthread_firstpost
domi681
03-18-2010, 11:13 AM
Please, help, How i can insert to it to the last post?
YankForum
03-18-2010, 06:01 PM
just change that 1 to maybe 10 or 15 (depends on how many posts are shown on each page)
domi681
03-19-2010, 06:05 AM
Hello, this way can not be, there must be some variable that whenever you type in the last post showing the advertising
Sgroove
03-19-2010, 06:06 PM
Hi, nice mod.
I was wondering if this mod will work if I want to insert a Search Engine between the first and second post.
sadiq6210
03-21-2010, 03:10 AM
Thanks
ZuFett
03-21-2010, 01:40 PM
Thanks, thats great!
But one Question:
How i show it only my Guests?
fayax
03-25-2010, 07:36 AM
standard vbulletin 4.0.2 already have this function so i can think that this modification it's not more needed.
Admin CP -> Styles & Templates -> Style Manager -> Edit Templates -> Ad Location Templates -> ad_showthread_firstpost
Thanks. Worked like a charm in 4.01 also.
thinkfast
04-01-2010, 07:02 PM
hello sir i just want to ask one question
how to make the ads not show to super moderator like at advertisement option
Display this ad if...
User does not belong to usergroup Super Moderator
wacnstac
04-01-2010, 07:29 PM
What happens when you use a replacement variable to place the advertisement and a user uses quick reply (AJAX) to make the post that forces this ad unit? I have had problems with this in the past.
bugzy
04-02-2010, 08:05 PM
hello sir i just want to ask one question
how to make the ads not show to super moderator like at advertisement option
Display this ad if...
User does not belong to usergroup Super Moderator
I'm surprised no mod has come out similar to the one for 3.8 that allows full control of ads
thinkfast
04-12-2010, 11:09 PM
hello sir i just want to ask one question
how to make the ads not show to super moderator like at advertisement option
Display this ad if...
User does not belong to usergroup Super Moderator
found some my self
just add this before and after the code
<vb:if condition="!is_member_of($bbuserinfo, 5)">
code
<vb:if condition="$adsshown[] = 9"></vb:if></vb:if>
cheers ;)
thinkfast
04-12-2010, 11:25 PM
Thanks, thats great!
But one Question:
How i show it only my Guests?
if you has create ads through advertisement at admin cp then you should see the code
example. if you has create ads with show only for guest at below navbar then you will find <vb:if code at
Style Manager --->>> edit template --->>> Ad Location Templates --->>> ad_global_below_navbar
and take the code and attach before and after the code that you attach at ad_showthread_firstpost
<vb:if condition="!is_member_of($bbuserinfo, 5)">
your ads code
<vb:if condition="$adsshown[] = 9"></vb:if></vb:if>
it's work for me
i hope this is helpful, sorry for my bad English :p
marshal_ramdev
04-21-2010, 04:38 AM
thank you .......
bugzy
04-22-2010, 11:56 PM
found some my self
just add this before and after the code
<vb:if condition="!is_member_of($bbuserinfo, 5)">
code
<vb:if condition="$adsshown[] = 9"></vb:if></vb:if>
cheers ;)
what is the "9" for?
Markos
05-03-2010, 07:29 PM
what is the "9" for?
i just used this as well and was wondering what the 9 was for lol
ShawneyJ
05-04-2010, 02:43 AM
this is great thanks.
how would i go about adding the google ad inside the first post only please?
EDIT: i worked it out to put google inside first post of every page
find in postbit_legasy
<div class="content">
add under that:
<vb:if condition="(THIS_SCRIPT == showthread) AND !$GLOBALS['FIRSTPOSTID']">
YOUR ADSENSE CODE HERE
<BR><BR>
</vb:if>
hope this helps anyone.
Endurer
05-04-2010, 07:55 AM
Hi,
I want to show different ads (two networks) for different forums. Is this possible?
Boko577
05-04-2010, 02:06 PM
This would be better as a mod so that I could make it to where only certain people see it and not my premium members.
casper04
05-22-2010, 03:11 AM
I want it displays above the list users say thank because I use thank you mod. Can you help me pls?
tommac3
05-25-2010, 11:02 PM
Is there a way to limit this only to guests ?
how can exclude some forums
ChaFF
08-25-2010, 09:20 PM
no files to download ;(
The_Big_K
09-09-2010, 02:41 PM
Can someone fix this for vBulletin 4.0.6? The ad_showthread_first template was removed from it and it's a confirmed bug.
I tried the above code but it does not display the block properly. :( (Overlaps with the first post).
x YNWA x
03-24-2011, 11:01 PM
How do I get something like this so it is after the LAST post and not the first? The thing is, I already have an advert just below the footer, so you can see that advert and the one below the first post if the first post is not too long. So I would prefer it to be just above the quick reply bar but cannot seem to be able to do it.
JHUMON
09-18-2011, 09:22 AM
dosent work on vb 4.1.6
Furcal15
10-01-2011, 01:42 AM
4.1.6 users, all you need to do is enter this code at the end of postbit/postbit legacy. It's only one code, not two.
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<div class="attachments">
<div style="width: 100%; text-align: center">
Your text here
</div>
</div>
</vb:if>
matt94gt
10-01-2011, 08:11 PM
4.1.6 users, all you need to do is enter this code at the end of postbit/postbit legacy. It's only one code, not two.
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<div class="attachments">
<div style="width: 100%; text-align: center">
Your text here
</div>
</div>
</vb:if>
That is all I have to do to have this mod work on 4.1.6? I have to do it per each theme? Where do I put the adsense code?
Thanks
matt94gt
12-11-2011, 03:28 AM
No one?
Scyther
12-11-2011, 10:44 AM
nice one...marked installed...
drdoc
01-25-2012, 08:04 AM
I am trying to place space for ad after 1st post so tried following code
In the "postbit" or "postbit_legacy", add to the end:
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<div class="attachments">
<div style="width: 100%; text-align: center">
Your text here
</div>
</div>
</vb:if>
When i try to save am getting the below error..why?
You may not use the function parsePhrase()!!!
With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression.
The following functions are allowed in template conditional expressions:
and() or() xor() in_array() is_array() is_numeric() isset() empty() defined() array() can_moderate() can_moderate_calendar() exec_switch_bg() is_browser() is_member_of() construct_phrase() iif()
drdoc
01-25-2012, 08:06 AM
and when am trying with 2nd method as said by developer am not able to see any changes
nd method, in the "ad_showthread_firstpost" template, add:
Code:
<div class="attachments">
<div style="width: 100%; text-align: center">
Your text here
</div>
</div>
My verison is 4.1.7 but am trying this for testing over VB DEMO 4.1.8
PALAZAN
02-02-2012, 02:31 AM
Ok this mite be a silly qestion but any way to not show this to a special group on my forums , say i want everyone to see the ads but admins is there a way to do this?
How to add adsense after last post in the thread?
Figured it out: http://www.vbulletin.com/forum/showthread.php?t=157022
I have the same question, its possible configured for appears like a post, or if its not possible, its possible configured with space after banner? I add a code < br > but not works.
Thanks and regards!
Change:
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
to:
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '2')">
-or-
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '3')">
respectively.
I want configured for appears after second and ten post but on every page (I have threads with more 500 replys) how configured this?
Thanks and regards!
BlueCheri
07-18-2012, 05:11 AM
Working fine :)
Thanx
BlueCheri
11-01-2012, 12:36 PM
That's working fine.
Many Thanx
G!
found some my self
just add this before and after the code
<vb:if condition="!is_member_of($bbuserinfo, 5)">
code
<vb:if condition="$adsshown[] = 9"></vb:if></vb:if>
cheers ;)
rgvtruck
07-01-2013, 09:17 PM
Will this work with DragonByte Tech: Advanced Post Thanks / Like mod?
RichieBoy67
07-31-2013, 08:30 PM
Will this work with DragonByte Tech: Advanced Post Thanks / Like mod?
It will not effect the thank you mod..
insidegames
10-30-2015, 08:39 PM
Don't work with 4.2.3
RichieBoy67
10-31-2015, 02:50 AM
Which one? What is happening? Error or just not showing adsense?
Anyways try this.
<vb:if condition="(THIS_SCRIPT == showthread) AND !$GLOBALS['FIRSTPOSTID']">
Adsense Code
</vb:if>
Ps - add <br /> 's if needed
insidegames
10-31-2015, 10:18 AM
Instead of
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
Use
<vb:if condition="(THIS_SCRIPT == showthread) AND !$GLOBALS['FIRSTPOSTID']">
Works for me :)
Works, but how can i say, show me the ad on the first post and fith post on every site?
insidegames
10-31-2015, 10:18 AM
Instead of
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
Use
<vb:if condition="(THIS_SCRIPT == showthread) AND !$GLOBALS['FIRSTPOSTID']">
Works for me :)
Works, but how can i say, show me the ad on the first post and fith post on every site?
@RichieBoy67 it works right now
Hello.
I want publish ad by 2 methods:
1 every 2 posts but in the odd posts (for example: 1,3,5,7,9...)
2 and the other, also, every 2 posts but in the couple posts (for example: 2,4,6,8,10...).
I search, but I don't view how made this.
Can help me?
Regards!!
I have another question:
In PostbitLegacy (is my template) I view on insert my adsense code for appars at end of post (post/text by user) but appears, logicaly, in all posts.
I want appears ever 3 posts, for example:
I add this code:
<vb:if condition="$post[postcount] % X == 0">
But not work, first post appears ell, other posts of same tjread appears wwong.
Ins opssible made this?
Regards.
MarkFL
04-21-2018, 11:23 PM
Try changing the "X" to a "3".
Sorry, yes, I try to change X to 3.
I have the problem indicate above.
I insert my adsense code, with this code indicate above just after this in postbit_legacy template
<div id="post_message_{vb:raw post.postid}">
<blockquote class="postcontent restore ">
{vb:raw post.message}
</blockquote>
</div>
Work if not insert
<vb:if condition="$post[postcount] % 3 == 0">
Work in first post, but the rest of post of some thread appears lie "unbalanced".
If you want I can attach a screenshoot.
Thanks and regards!!
MarkFL
04-22-2018, 12:42 AM
Locate this at the very end:
{vb:raw template_hook.postbit_end}
Directly above that, try adding:
<vb:if condition="(THIS_SCRIPT == showthread) AND !($post[postcount] % 3)">
<div style="clear: both; margin: 1em 0;" class="attachments">
<div style="text-align: center">
Your text here.
</div>
</div>
</vb:if>
Thanks MarkFL,
With your code, I have my text every 3 posts but between posts.
My iddea, if its possible, is, just at end of the text/reply of the post user, inside the post.
Again, thank you! :)
MarkFL
04-22-2018, 12:04 PM
Thanks MarkFL,
With your code, I have my text every 3 posts but between posts.
My iddea, if its possible, is, just at end of the text/reply of the post user, inside the post.
Again, thank you! :)
Try putting the code directly below this block:
<div id="post_message_{vb:raw post.postid}">
<blockquote class="postcontent restore ">
{vb:raw post.message}
</blockquote>
</div>
Thanks MarkFL,
Works perfect!!
I try in other positions, but in this position, work perfect!!!
Appears the code at end of post inside post :)
Thanks!!!
In other question, its possible insert the code for, ever 3 or 5 posts but with different content? I'm explain:
<vb:if condition="(THIS_SCRIPT == showthread) AND !($post[postcount] % 3)">
My text A here
And:
<vb:if condition="(THIS_SCRIPT == showthread) AND !($post[postcount] % 5)">
My text B here
I try this, at end of postbit_legacy, (I try a since days ago) but not fine...
Again, thank you!
Edit: Now I try with your code and yes, works perfect :)
Thanks master.
Hello.
In this lasts weeks I edit this ads in location, but continue with my last doubt, if its is possible, real are fantastic:
My iddea:
We have the code A of adsense (for one add) and also, we have the code B for other/config add.
Mi iddea, if its possible.
In the first post number 3 (for example) appears the code A, in the post 6 de code B, in the post 9 de code A, in the post 12 the code B...etc...
.
If I use this:
<vb:if condition="(THIS_SCRIPT == showthread) AND !($post[postcount] % 3)">
Code A
and:
<vb:if condition="(THIS_SCRIPT == showthread) AND !($post[postcount] % 5)">
Code B
In the post number 15 and in the 30, 45...appears the 2 adds (or to codes) and I don't want this, I want only appear one add.
Sorry if I not explained well.
This, is a little important for me :)
Thanks in advanced!
Regards!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.