![]() |
Adsense as second post. 2 Sizes - Big for guests, small for members
Hi
I made this template mod for my medical Forum and I decided to share this with you This hack is for forums that use the standard Postbit Template If you use the postbit_legacy template >> click here << What this hack does: This modification displays adsense as second post in every thread. Guest see a post like adsense with a product Referral (firefox in this code) and a large rectangle as post content. Members only see a standard banner so they don't get annoyed by the big advertising. I also included an information for guests, that they see a different not so disturbing ad if they register. This serves to purposes, one is to get more members to register of course the second purpose is to blend the advertising better into the post layout. ADD-ON: In addition you can add a Google Adsense link unit as last post of a thread on any page for members and guests. This advertising will only show if the thread has more then one post so that it does not show 2 advertisings directly below each other in case that the thread has no replies yet. Google Adsense has updated its ToS so that you are now allowed to use up to three link units on one page. So if you already use my "Adsense Link Unit in Navbar" Mod there woun't be a problem. See screenshots ;) How to install: In template postbit search: Code:
<!-- / post $post[postid] popup menu --> Code:
<!-- Google AdSense in Posts for Guests --> Add this code below the last line of my above code: Code:
<!-- Google AdSense Link unit as last post for all --> <!-- Adsense Referal Code start --> <!-- Adsense large rectangle start --> <!-- Adsense standard banner start --> Add-on: <!-- Adsense Link Unit start --> replace "YOUR PUB ID HERE" with your pub-ID and fit the colors of adsense to your color scheme Demo: Elternfragen.net - Das Forum f?r Eltern mit (medizinischen) Fragen Just go into any thread. I hope you like it and if you do, don't forget to mark es installed ;) Changelog: v1.15 - 2007/07/22: NO CHANGES, just removed my Pub-ID from the hack! v1.15 - 2007/06/11: Add-on - Google Adsense Link unit as last post of every thread for guests and members. v1.1 - 2007/05/06: Condition altered to show advertising as second post on every page, not just the first. If you want more good placements for adsense then check out my newest mod: Adsense Link Unit in Navbar StarBuG If you did not register for an Adsense account yet but you plan to, feel free to contact me. If you register via my referral I am willing to help you get the most out of your adsense placement by assisting you during the setup process and implementing the best adsense modifications. Just write me a Private message. |
Nevermind, had adblock extension on firefox on and it wasn't showing up lol, works great!
|
Awesome mod, but i got a question, how do I make it so that it only shows on the first page for everyone and not just admins? Because I'm seeing that it displays on everyone page for members, but not for admins. So i want to disable on every other page but for the first page.
Also for guests it should show on each page. |
For guests it does show on every page.
I am a little confused right now why it does not show for admins on second page. I totaly missed that because I block advertisings anyway on my browser. I took the condition from some similar hack I found a longer time ago. I realy have no clue but I think it has something to do with $post[postid] == $GLOBALS['qrfirstpostid'] Sorry that I can't help you with that but maybe someone else has an Idea? |
O_O yup can't wait for it.
|
Just what I was looking for - thanks a lot! Is this OK with Google's TOS?
|
Yes it is.
The Ads are clearly marked as such and there is no "tricking the user" to click. But if you want to be sure write them and ask google to review your placement if it confirms with their ToS. That is always the safest way to go. |
Confirmed. :)
Per Google: I can confirm that your current implementation is compliant with our policies and is a well optimized ad layout up for your forums. Thanks again! |
Your welcome ;)
|
thanks goin to install
|
Thank you, nice and easy to install.
|
Thank You, very Good :)
|
Installed with modifications to fit postbit legacy.
You can check out how I did it here... http://www.hometheatershack.com/forums |
|
Is it also possible to hide adsense from certain usergroups? What is the difference between postbit & postbit_legacy?
thanks |
In the if condition at the very beginning of my code add:
Code:
AND $bbuserinfo['usergroupid'] == 'X' So that it looks like this: Code:
<if condition="THIS_SCRIPT == 'showthread' AND $post[postid] == $GLOBALS['qrfirstpostid'] AND (!$show[member]) AND $bbuserinfo['usergroupid'] == '1'"> postbit_legacy is the old version to display posts (from vB 2.x times). The userinfos are on the left site not on the top like it is here. StarBuG |
Hi StarBuG,
thank you for answering that fast. It somehow does not work , yet. ;) I would like adsense not to show up for moderators (usergroup: 7) & admins (6). You could also say that I only want registered users who belong to usergroup 2 should see adsense. I have tried to add "AND $bbuserinfo['usergroupid'] == 'X'' at he begining of the code. But the beginning of your code is for guests, right? The problem is that I want logged in moderators & admins not to see adsense. I also tried to use: Code:
<if condition="THIS_SCRIPT == 'showthread' AND $post[postid] == $GLOBALS['qrfirstpostid'] AND (!$show[member]) AND $bbuserinfo['usergroupid'] == '1'"> |
This is really nice.
|
to exclude usergroups you need to add:
Code:
AND $bbuserinfo['usergroupid'] != 'X' to include Usergroups: Code:
AND $bbuserinfo['usergroupid'] == 'X' you could also wrap my whole code from above inside this: Code:
<if condition="is_member_of($bbuserinfo, X)"> |
I think this modification doesn't work if you have this installed
https://vborg.vbsupport.ru/showthrea...hreadid=131544 Im using 3.6.4 |
How should this be modified for Legacy? I'm using a skin that doesn't have the new postbit option :(
|
@roger.kore: I have not installed the hack you mentioned but from the quick look I see no reason why it should not work.
@insolentmuse: I have published the postbit_legacy Version here: https://vborg.vbsupport.ru/showthread.php?t=139093 StarBuG |
Exactly what I wanted and so easy to install. It took just a couple of minutes.
I like how it encourages visitors to join and avoid the advertising. |
Quote:
Thank you, I guess I need to learn how to search better. :eek: |
How would I adjust this, so that even registered members (like guests) will see an ad on the second post of EVERY page. I'd still like registered members to only see the thin display as you have it.
We have a 'premium user' class that we'll show zero ads for. Thank you so much! |
Quote:
I published it because you were the first to ask ;) |
Quote:
It works great, btw :) Thanks! |
No matter what I do with all of your suggestions, I can't exclude a usergroup no matter which method I use...
Can anyone confirm a method that works perfectly? |
<if condition="THIS_SCRIPT == 'showthread' AND $post[postid] == $GLOBALS['qrfirstpostid'] AND ($show[member]) AND $bbuserinfo['usergroupid'] != 'X'">
This means... if user is a registered member and NOT a member of usergroup X then show the advertising. StarBuG |
That code would seem not to work with any users who don't have the usergroup as top level.
How would I get this: <if condition="is_member_of($bbuserinfo,14)"> ...to work inside of YOUR conditional? :) Usergroup 14 above is my "Premium" group, but I don't put members in their as their MAIN group. Wrapping the whole conditional I just stated around the "ads for members" section of your code will NOT work. There is a conflict somehow contained in your if if I put my if before it (which has worked before when I simply put the google ads at the top of the showthread before I tried your mod).. Any suggestions? :) |
I found the resolution...
In order to not show this to a particular group (difference here being this works even if it's not their MAIN group), insert this code instead.. Code:
<!-- Google AdSense in Posts for Members --> Hope that helps someone... |
Yes, that works as well
Glad you figured it out ;) If you lose the ! before "is_member_of", the statement will only include the usergroups you named (X) by the way ;) |
What is this condition good for?!
Code:
<if condition="!$post['islastshown']"><!-- this is not the last post shown on the page --></if> |
This code is copied from the "postbit_wrapper" template.
Here it does not serve any purpose. I just forgot to take it out. You can delete it if you want. It is just an html comment that is added when the the above post is followed by another one. StarBuG |
how do you know what postbit you use?
|
If you are asking that, then you are using the "postbit" template ;)
To use the "postbit_legacy" template you have to copy the content from that template to "Postbit" ;) |
Thanks for this great hack. However, I don't like guest to see the "wide" ad, it looks early that way. How do I make guest will see ads the same way as registered users?
Thanks |
If you want everyone to see the same ad you don't need the coditions.
Simply only use the member code and get rid of all the rest. use this: Code:
<if condition="$show['spacer']"> |
Hi,
How can I change this so that it shows up as the last post on a page? (instead of the second post) THANKS! :D |
use this as your 1st IF statement:
Code:
<if condition="$post[postcount] == 10"> |
All times are GMT. The time now is 04:59 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|