![]() |
Adsense after first post
Hey guys i think many of you will find this very usefull :)
With the template edit you can display adsense or banner after every 1st post. i have chosen to use my amazon affilite code. Add this to the bottom of your postbit template. Demo PHP Code:
|
Hi,
I want to have the adsense stuff for people NOT in specific groups. For example: Admins, mods, staff etc. should not get the adsense stuff. Can you give an example how to modify your template to make this possible? btw. thanks for sharing :D |
Didn't Kirby post this somewhere??
Thanks anyway. |
Yup.
https://vborg.vbsupport.ru/showpost....10&postcount=2 :) Mental Note: Tagging the post was a good idea :D |
Quote:
i copied this code and pasted at the end of postbit template as you said and i put all the adsense code in this space u provided , if i am not mistaken. (<adsense code here> ) Could you please tell me where i went wrong?? Thanks |
try this one
Code:
<if condition="$post[postcount] == 1"> |
What's more fun and challenging - because of ajax issues, is adsense in the last post. ;) That really gets the ad right where the reader's eyes are.
http://www.eaforums.com/forums/364919-post1.html Find: Code:
<!-- message --> Code:
<if condition="(($post[postcount]==1) or ($post[islastshown] and !$GLOBALS['vbulletin']->GPC['ajax']))"> |
Hmm, keeping database read marking in mind:
Wouldn't the first unread post be the best place? Cause the last Post doesn't necessarily get read - the first unread post will. |
True. But, is there a conditional for it?
|
There must be as Posts carry Icons for Read/Unread.
So if this Icon changes to Unread for the first time it is the right Post. |
Quote:
I am going to be adding adsence, however, do not want contributing members or sponsors to see them. Any help is appreciated!! |
I've posted this often already, but i'll post it once again :)
<if condition="!is_member_of($bbuserinfo, x, y, z) AND !$GLOBALS['FIRSTPOSTID']"> |
Quote:
Thanks :) |
Yep (regarding the replacement of x, y and z).
|
Quote:
Thanks Kirby!! Hey I seem to remember a thread one of the vBulletin Devs put out in regards to adding adsense....it had quite a few examples. Do you remember that? |
That is odd, I placed the usergroup 1 (admin) in that code and it still shows the adsense?
**edit** disregard, it did remove it, however, completely did something odd with the formatting?? When I get home I will get a screen print. |
Quote:
Thanks kirby works great :D |
Usergroup 1 is Guest, not Admin?
|
Quote:
Somehow it messes up the formatting on the page, I will get a screenshot to show. Thanks as always Kirby! |
Quote:
try replacing HTML Code:
<if condition="!$GLOBALS['FIRSTPOSTID']"> HTML Code:
<if condition="!$GLOBALS['FIRSTPOSTID'] and Then replace x with the usergroupid that you do NOT want this ad to show for. |
Quote:
|
you must be doing something crazy xtremeoff-road as kirbys code works for me.
|
Keep adding
Code:
and $vbulletin->userinfo[usergroupid] != 'x' |
I think this Code won't work, as $vbulletin is not within the Scope of the Postbit Class.
|
I can be wrong though.
|
Quote:
I will get a screen shot when I get home. |
I tried a few methods I found at vb.com and vb.org. This one is the only one that would work for me. Just one problem is that after I make a quick reply, the sponsoered link header apears BUT the ads do not show. In other words it hsouldn't show up at all. Oh well it got ads betwen the first and second post so I'm happy!
|
Quote:
amy - you might want to check with Google. The way you have the ad placed inside the post may violate their TOS. You can email adsense and ask for a review. |
<a href="http://img339.imageshack.us/img339/1489/bannerproblem0cy.gif" target="_blank">http://img339.imageshack.us/img339/1...problem0cy.gif</a>
^ Does anyone else get this problem after editing a post?.. |
I am not using this hack, but something similar i created myself, and i have the same if using quick reply. Doesn't bother me enough to search for a fix.
|
Quote:
or at least, I read the last post first as that's what shows up on the forumindex, and many threads are ones I follow for new posts. just making a point. ;) |
Quote:
|
Quote:
This happens often when there's multiple Adsense ads on the same page for me. |
trilljester, not to answer for Amy, but I don't think that's an issue related to the hack, if there aren't enough ads to display or google adsense bot has not picked the page up yet, which is rare, it will display the alternate color or alternate ad you have in place. So just specify an alternate ad in your adsense code for those times when it doesn't show up.
|
Yep. Generally, my adsense goes to my alternate ad broker though.
|
Okie doke, I'll do that.
It looks great except when there's a quote in the last message, then it shifts everything off by a little. I'm torn now between using Amy's or the "just after the first post" deal. Hrmmm...decisions decisions... :nervous: |
I tinkered with my quote template to make the div not have a width of 100%. When I removed that, it solved the problem.
|
Quote:
|
Quote:
|
might want to add it to postbit_legacy
|
All times are GMT. The time now is 04:52 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:
|