PDA

View Full Version : Randomly positioned ad in between postbits in showthread


UK Jimbo
10-09-2005, 10:00 PM
Inspired by this hack (https://vborg.vbsupport.ru/showthread.php?t=96249).

The ad is positioned randomly after one of the postbits. We use this for positioning adsense ads on visordown.com (http://www.visordown.com/forums/).

Install the attached plugin then add the following code to your postbit or postbit_legacy template:

<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 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">

<!-- ad code goes here -->

</td>
</tr>
</table>

</div>
$spacer_close
</if>


Changelog

v1.01
Bug fix: The ad code shouldn't appear on PMs any more (template change)

Donations

Hopefully this plugin will earn you provide you with some good revenue. If you'd like to show your appreciation please donate as little or as much as you like.

https://vborg.vbsupport.ru/external/2010/02/12.gif (https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=james%2epaypal%40jump%2daround%2ecom&item_name=vBulletin%2eorg%3a%20Random%20Google%20A dSense%20ads&no_shipping=0&no_note=1&tax=0&currency_code=GBP&bn=PP%2dDonationsBF&charset=UTF%2d8)

Wachtmeister
10-10-2005, 07:44 PM
I'll give this one a try, because the "Adsense after first post" did not work with Firefox at "Quick Reply". Thanks for releasing this one.

edit: works perfect.

dieselpowered
10-10-2005, 08:20 PM
I had the same problem with the adsense code affecting the functionality of AJAX. Quick reply would work ONLY if you did not have to click to activate it. One thing you may want to test is to attempt to click quick reply in a post AFTER the display of the adsense and see if it works.

The code I have now will allow you to click quick reply in a post above the adsense, however, not in a post below it.

If this works I will be using it :)

DeeperImage
10-11-2005, 01:53 AM
I've installed the plugging and the code and this is not working, What am I doing wrong? Thanks.

It just doesn't show up.

auz1111
10-11-2005, 02:28 AM
nice one! just wish we could add/edit the ads without going into the template.

hbalagh1
10-11-2005, 03:35 AM
can you select certain usergroups not to see this?

Keyser S?ze
10-11-2005, 04:57 AM
yea i got the same question, id prefer only guests see the ads, not logged in members, i get more guests than anything

GrendelKhan{TSU
10-11-2005, 05:01 AM
mandatory "is there a screen shot?" request. ;) :p

Doc Great
10-11-2005, 08:38 AM
To make only guest see the ads take this code and add it at the end of the postbit (_legacy) template.

<if condition="in_array($bbuserinfo[usergroupid], array(1))">
<if condition="$GLOBALS['adsense_position'] == $post['postcount']">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 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">

<!-- ad code goes here -->

</td>
</tr>
</table>

</div>
$spacer_close
</if>
</if>

@UK Jimbo, do you allow me to translate/modify and post this modification @ www.vbhacks-germany.com (of course with your copyright)? :)

UK Jimbo
10-11-2005, 09:36 AM
Thanks for posting the usergroup variation Doc Great. I've got no issues with you re-posting the code elsewhere as long as it's not being sold!

UK Jimbo
10-11-2005, 09:41 AM
mandatory "is there a screen shot?" request. ;) :p

done

Doc Great
10-11-2005, 10:17 AM
Thanks for posting the usergroup variation Doc Great. I've got no issues with you re-posting the code elsewhere as long as it's not being sold!
Thats for sure :) i hate making profit with "simple" php code :D Thanks for sharing.

dsotmoon
10-11-2005, 04:48 PM
how do you add additional usergroups? to

<if condition="in_array($bbuserinfo[usergroupid], array(1))">

like this?

<if condition="in_array($bbuserinfo[usergroupid], array(1, 2, 3, 4))">

ect etc?

dieselpowered
10-11-2005, 04:49 PM
This does appear to work with click for quick reply.

**clicks install**

UK Jimbo
10-11-2005, 05:07 PM
To limit it just to certain user groups I'd recommend the following conditional rather than the in_array() solution posted above. This version ensures that secondary group assignments are checked too.

For a single user group (1 in this case)
<if condition="is_member_of($bbuserinfo, 1)">

For multiple user groups (1, 2 & 3 in this case)
<if condition="is_member_of($bbuserinfo, array(1,2,3))">

Andreas
10-11-2005, 05:30 PM
What about:
Show Adsense in (or under, above) first unread Post of a Thread.
I think this is the place that would get the most user attention?

UK Jimbo
10-11-2005, 05:55 PM
That's a nice idea and one I'll look into. I think it will be possible to use the $threadview variable but it'll require slightly more CPU and will have to deal with cases where the latest the newest post isn't displayed on the page.

dieselpowered
10-11-2005, 06:36 PM
How can I get this to not show in the PM's???

For some reason it is screwing up the page formatting when viewing private messages.

hbalagh1
10-11-2005, 06:39 PM
How can I get this to not show in the PM's???

For some reason it is screwing up the page formatting when viewing private messages.

same here, didn't even bother to check that till you said that...

dieselpowered
10-11-2005, 06:53 PM
same here, didn't even bother to check that till you said that...

Ya I was surprised to see it there as well :surprised:

DeeperImage
10-11-2005, 07:23 PM
How can I get this to not show in the PM's???

For some reason it is screwing up the page formatting when viewing private messages.

I've installed and no-one seems to care about my question, but nonetheless this hack only works in the PM's section with my site and nowhere else, and like you said it is messing up with the recipients name, it's adding an extra space and a ; to it.

UK Jimbo
10-11-2005, 07:24 PM
How can I get this to not show in the PM's???

For some reason it is screwing up the page formatting when viewing private messages.

Sorry this is one I didn't see as only guests on visordown.com have the ads turned on.

This problem can be fixed with a simple template change. I've adjusted the code listed above to include the additional condition: $GLOBALS['adsense_position'] > 0

UK Jimbo
10-11-2005, 07:25 PM
I've installed and no-one seems to care about my question

Awwwwww :(

Copy/paste the code you've put in your template and I'll try to help.

dieselpowered
10-11-2005, 07:28 PM
I've installed and no-one seems to care about my question, but nonetheless this hack only works in the PM's section with my site and nowhere else, and like you said it is messing up with the recipients name, it's adding an extra space and a ; to it.

Just a shot in the dark, however, do you have the correct postbit template changed? Appears you are using the postbit_legacy so did you change that template?? The code goes at the very end.

DeeperImage
10-11-2005, 07:32 PM
Just a shot in the dark, however, do you have the correct postbit template changed? Appears you are using the postbit_legacy so did you change that template?? The code goes at the very end.
I tried it both in Postbit and Postbit_legacy and it was all the same. It does not show up. I am using a test account I created and my normal admin account and the only place I see it is in PM's

dieselpowered
10-11-2005, 07:32 PM
Sorry this is one I didn't see as only guests on visordown.com have the ads turned on.

This problem can be fixed with a simple template change. I've adjusted the code listed above to include the additional condition: $GLOBALS['adsense_position'] > 0

Hey man, sorry but that errors out...won't even let me save the template with the new code?

DeeperImage
10-11-2005, 07:33 PM
Awwwwww :(

Copy/paste the code you've put in your template and I'll try to help.


I've placed it at the end right after

<!-- / post $post[postid] popup menu -->

<if condition="$show['spacer']">
</div>
$spacer_close
</if>
<!-- / post #$post[postid] -->

<if condition="$GLOBALS['adsense_position'] == $post['postcount']">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 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">

<script type="text/javascript"><!--
google_ad_client = "removed for obvious reasons";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "191933";
google_color_bg = "333366";
google_color_link = "99CC33";
google_color_url = "FFCC00";
google_color_text = "FFFFFF";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

</td>
</tr>
</table>

</div>
$spacer_close
</if>

UK Jimbo
10-11-2005, 07:41 PM
Hey man, sorry but that errors out...won't even let me save the template with the new code?

Are you using the full conditional as per the template mod at the top of the page?

<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">

dieselpowered
10-11-2005, 07:41 PM
I've placed it at the end right after

<!-- / post $post[postid] popup menu -->

<if condition="$show['spacer']">
</div>
$spacer_close
</if>
<!-- / post #$post[postid] -->

<if condition="$GLOBALS['adsense_position'] == $post['postcount']">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 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">

<script type="text/javascript"><!--
google_ad_client = "removed for obvious reasons";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "191933";
google_color_bg = "333366";
google_color_link = "99CC33";
google_color_url = "FFCC00";
google_color_text = "FFFFFF";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

</td>
</tr>
</table>

</div>
$spacer_close
</if>

I wonder if that threaded view above your forums is messing it up? Looking at the code nothing really stood out as wrong??

You already installed the plugin right? Is it active?

dieselpowered
10-11-2005, 07:44 PM
Are you using the full conditional as per the template mod at the top of the page?

<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">

Hmmm ya I was...I reverted and replaced the code. All is good now :)

Appreciate it sir!

dieselpowered
10-11-2005, 07:46 PM
Are you using the full conditional as per the template mod at the top of the page?

<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">

Sorry, quick question....can this code be placed above it so that specific usergroups do not see the ads?

<if condition="in_array($bbuserinfo[usergroupid], array(1, 2, 3, 4))">

UK Jimbo
10-11-2005, 07:47 PM
I wonder if that threaded view above your forums is messing it up?

The ad will only ever appear in the "linear" display mode. In "hybrid" or "threaded" mode it's disabled.

UK Jimbo
10-11-2005, 07:50 PM
Sorry, quick question....can this code be placed above it so that specific usergroups do not see the ads?

I'd recommend using is_member_of() in place of in_array()

You can either use:

<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0 && is_member_of($bbuserinfo,array(1,2,3))">

or put it in a separate outer conditional like:

<if condition="is_member_of($bbuserinfo,array(1,2,3))">
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">

dieselpowered
10-11-2005, 07:57 PM
I'd recommend using is_member_of() in place of in_array()

Sorry that is the conditional I meant to copy and paste :)

Thanks for the help!

DeeperImage
10-11-2005, 08:03 PM
I wonder if that threaded view above your forums is messing it up? Looking at the code nothing really stood out as wrong??

You already installed the plugin right? Is it active?


I use linear as my default and it does not work. I think the threaded view is for the non registered only. I'll change it to be safe all around.

The plugging I installed and it is active. When I upload the pluging what do I select from the drop down? I put it under Ajax_start is that the correct mode?

dieselpowered
10-11-2005, 08:09 PM
I use linear as my default and it does not work. I think the threaded view is for the non registered only. I'll change it to be safe all around.

The plugging I installed and it is active. When I upload the pluging what do I select from the drop down? I put it under Ajax_start is that the correct mode?

I guess I do not understand what you mean by mode. When you import a plugin all you do is browse to the .xml and select import...that is all.

**Edit**

I see what you are talking about...do not go to 'add new plugin' look at the bottom where it shows upload/download plugin and then import the .xml file.

DeeperImage
10-11-2005, 08:15 PM
I guess I do not understand what you mean by mode. When you import a plugin all you do is browse to the .xml and select import...that is all.

**Edit**

I see what you are talking about...do not go to 'add new plugin' look at the bottom where it shows upload/download plugin and then import the .xml file.
Ahh I see . Let me try. This was my first pluging install. :ermm: I'll report back in a few.

dieselpowered
10-11-2005, 08:20 PM
Ahh I see . Let me try. This was my first pluging install. :ermm: I'll report back in a few.

Roger that...standing by :)

dieselpowered
10-11-2005, 08:21 PM
Ahh I see . Let me try. This was my first pluging install. :ermm: I'll report back in a few.

Hey it works!!!

DeeperImage
10-11-2005, 08:21 PM
Roger that...standing by :)
That was exactly the problem..Thank you much. I manually added the pluging instead of importing into it with the automated system.. :nervous: :nervous: :nervous: :ermm: But all is well now. I hope the results are even better...Money wise.. :devious:

DeeperImage
10-11-2005, 08:22 PM
Hey it works!!!
:banana: :banana:

dieselpowered
10-11-2005, 08:22 PM
That was exactly the program..Thank you much. I manually added the pliging instead of importing into it with the automated system.. :nervous: :nervous: :nervous: :ermm: But all is well now. I hope the results are even better...Money wise.. :devious:

Did you use the updated code to fix it so that it does not show im the PM's?

DeeperImage
10-11-2005, 08:23 PM
Did you use the updated code to fix it so that it does not show im the PM's?
No I will have to change it. I didn't realize they had updated the code.. this thread is moving to fast for me.. :devious:

dieselpowered
10-11-2005, 08:35 PM
No I will have to change it. I didn't realize they had updated the code.. this thread is moving to fast for me.. :devious:

LOL NP, after you do that you should be all set...now if you want ads to only be viewed by guest or by certain usergroups, you will need to add a conditional:

<if condition="is_member_of($bbuserinfo,array(1,2,3))">

where 1,2,3 are the numbers of the usergroups you do not want to see the code.

Gottcha
10-11-2005, 10:22 PM
ok...this is all new to me but i added the code and i see the bar that says sponsored ads but i dont see any ads???

www.fragtraders.com/forums

DeeperImage
10-11-2005, 10:31 PM
ok...this is all new to me but i added the code and i see the bar that says sponsored ads but i dont see any ads???

www.fragtraders.com/forums

This may be a stupid question but did you replace the <!-- ad code goes here --> with your google adsense or Yahoo code?

Gottcha
10-11-2005, 10:34 PM
good question and i did replace the code with my adsense code.

i also checked another forum from a member on here and didnt see the ads there either

this is the other site....again i see the bar but no ads under it

http://www.atvpros.net/forums/showthread.php?t=8

DeeperImage
10-11-2005, 10:37 PM
good question and i did replace the code with my adsense code.

i also checked another forum from a member on here and didnt see the ads there either

Some things that I did wrong you want or may have already done.

- Make sure the forums threaded and Display options under VBULLETIN OPTIONS is turned off.
- Make sure you uploaded the pluging through the browse option and not manually.
- Place the code in Postbit at the bottom, or try the Postbit_legacy
- Try logging in with a test account set to normal user. Maybe because you are an admin or mod you can't see the ads.
- Double check your adsense code since the pluging seems to be working.

Whats a link to your site I'll look around see if I have any luck.

DeeperImage
10-11-2005, 10:38 PM
good question and i did replace the code with my adsense code.

i also checked another forum from a member on here and didnt see the ads there either

this is the other site....again i see the bar but no ads under it

http://www.atvpros.net/forums/showthread.php?t=8

I am seeing the banners and bar so maybe you have some kind of AD blocker or remover.


EDIT: I just went to your site and I can see the ads just fine.

http://www.fragtraders.com/forums/showthread.php?p=3097#post3097

Gottcha
10-11-2005, 10:40 PM
<a href="http://www.fragtraders.com/forums/showthread.php?t=44" target="_blank">http://www.fragtraders.com/forums/showthread.php?t=44</a>

this is my site

DeeperImage
10-11-2005, 10:44 PM
http://www.fragtraders.com/forums/showthread.php?t=44

this is my site
I can see the ads. See my previous post..

Gottcha
10-11-2005, 10:56 PM
just checked a friends computer and all is well...great hack.... now to find out why i cant see the ads

UK Jimbo
10-11-2005, 11:22 PM
I don't think that it's the same problem but worth me mentioning it here.

When I tested this yesterday on visordown.com (http://www.visordown.com/forums/) I noticed on some pages that the adsense ad won't appear when there's already a Google ad on the page and they don't have sufficient information about the page that the ad's on. The issue is covered in the Google Adsense FAQ here (https://www.google.com/support/adsense/bin/answer.py?answer=10522&topic=159)

The multiple ad units system detects the number of ad units that are on your page, and automatically serves unique ads to each ad unit. The system is optimised for pages that have highly targeted ads available - as a result, you may sometimes see that only the first ad unit contains ads. As our ad inventory changes, or if your page content changes, you may start seeing more ads on your page.

When only one ad unit is displaying ads, any additional ad units will display as transparent boxes, or will display the alternate ad or colour that is defined in their ad code. Please note that each instance of ad code must have the alternate URL or colour specified in order to display alternate content.

I'd recommend that you put alternate ads or ad/collapsing in place in case no ad or PSAs get served.


On a totally different note the CTR has significantly increased since we moved from the old system of fixed position after the third ad to using this hack on.

Doc Great
10-12-2005, 06:19 AM
I think you have a "&" too much in you first line :)
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">

UK Jimbo
10-12-2005, 06:58 AM
I think you have a "&" too much in you first line :)

I've got just the right amount of "&"s in my first line :)

&& is the same as writing AND and is a logical AND
& is a bitwise operator

http://uk.php.net/manual/en/language.operators.logical.php
http://uk.php.net/manual/en/language.operators.bitwise.php

Doc Great
10-12-2005, 07:49 AM
Thats very strage, i get a parse error when i use your version, but with one it works perfectly....

UK Jimbo
10-12-2005, 07:59 AM
Copy/paste your template code please.

Doc Great
10-12-2005, 08:19 AM
<!-- post #$post[postid] -->
<if condition="$show['spacer']">
$spacer_open
<div id="edit$post[postid]" style="padding:0px 0px $stylevar[cellpadding]px 0px">
<if condition="!$post['islastshown']"><!-- this is not the last post shown on the page --></if>
</if>


<table class="tborder" id="post$post[postid]" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" $post[scrolltothis]>
<div class="normal" style="float:$stylevar[right]">
&nbsp;
<if condition="$show['postcount']">#<a href="showpost.php?$session[sessionurl]p=$post[postid]&amp;postcount=$post[postcount]" target="new" rel="nofollow" id="postcount$post[postid]" name="$post[postcount]"><strong>$post[postcount]</strong></a> &nbsp;</if>
<if condition="$show['reputationlink']"><a href="#" onclick="reputation($post[postid]); return false;"><img class="inlineimg" src="$stylevar[imgdir_button]/reputation.gif" alt="<phrase 1="$post[username]">$vbphrase[add_to_xs_reputation]</phrase>" border="0" /></a> &nbsp;</if>
<if condition="$show['reportlink']"><a href="report.php?$session[sessionurl]p=$post[postid]" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/report.gif" alt="$vbphrase[report_bad_post]" border="0" /></a> &nbsp;</if>
$post[iplogged]
<if condition="$show['inlinemod']">
<input type="checkbox" name="plist[$postid]" id="plist_$postid" style="vertical-align:middle; padding:0px; margin:0px 0px 0px 5px" value="$post[checkbox_value]" onclick="inlineMod.toggle(this)" />
</if>
</div>

<div class="normal">
<!-- status icon and date -->
<a name="post$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/post_$post[statusicon].gif" alt="$post[statustitle]" border="0" /></a>
<if condition="!$show['announcement']">
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
<else />
<phrase 1="$post[startdate]" 2="$post[enddate]">$vbphrase[x_until_y]</phrase>
</if>
$post[firstnewinsert]
<!-- / status icon and date -->
</div>
</td>
</tr>
<tr>
<td class="alt2" style="padding:0px">
<!-- user info -->
<table cellpadding="0" cellspacing="$stylevar[cellpadding]" border="0" width="100%">
<tr>
<if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if>
<td nowrap="nowrap">

<div id="postmenu_$post[postid]">
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
$post[onlinestatus]
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</div>

<if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
<if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>

<if condition="$thread[postuserid] == $post[userid] and $post[postcount] > '1'"><div class="smallfont"> Themenstarter <img src="/images/misc/threadstarter.gif" alt="Threadstarter" /></div></if>


</td>
<td width="100%">&nbsp;</td>
<td valign="top" nowrap="nowrap">
<div class="nzbpostbit">
<div class="smallfont">
<if condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>
<if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if>
<if condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
<div>
$vbphrase[posts]: $post[posts]

</div>
<if condition="$show['reputation']"><if condition="$show['reppower']">$vbphrase[reppower]: $post[reppower] </if><div>$post[reputationdisplay]</div></if>
<div><if condition="$post[icqicon] or $post[aimicon] or $post[msnicon] or $post[yahooicon]">&nbsp; $post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon]
</if></div>
</div></div>

</td>
</tr>
</table>
<!-- / user info -->
</td>
</tr>
<tr>
<td class="alt1" id="td_post_$post[postid]">
<!-- message, attachments, sig -->

<if condition="$show['messageicon'] OR $post['title']">
<!-- icon and title -->
<div class="smallfont">
<if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if>
<if condition="$post['title']"><strong>$post[title]</strong></if>
</div>
<hr size="1" style="color:$stylevar[tborder_bgcolor]" />
<!-- / icon and title -->
</if>

<!-- message -->
<div id="post_message_$post[postid]">$post[message]</div>
<!-- / message -->

<if condition="$show['attachments']">
<!-- attachments -->
<div style="padding:$stylevar[cellpadding]px">

<if condition="$show['thumbnailattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_thumbnails]</legend>
<div style="padding:$stylevar[formspacer]px">
$post[thumbnailattachments]
</div>
</fieldset>
</if>

<if condition="$show['imageattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_images]</legend>
<div style="padding:$stylevar[formspacer]px">
$post[imageattachments]
</div>
</fieldset>
</if>

<if condition="$show['imageattachmentlink']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_images]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[imageattachmentlinks]
</table>
</fieldset>
</if>

<if condition="$show['otherattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_files]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[otherattachments]
</table>
</fieldset>
</if>

<if condition="$show['moderatedattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attachments_pending_approval]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[moderatedattachments]
</table>
</fieldset>
</if>

</div>
<!-- / attachments -->
</if>

<if condition="$post['signature']">
<!-- sig -->
<div>
__________________<br />
$post[signature]
</div>
<!-- / sig -->
</if>

<if condition="$show['postedited']">
<!-- edit note -->
<div class="smallfont"> <hr size="1" style="color:$stylevar[tborder_bgcolor]" />
<em>
<phrase 1="$post[edit_username]" 2="$post[edit_date]" 3="$post[edit_time]">$vbphrase[last_edited_by_x_on_y_at_z]</phrase>.
<if condition="$post['edit_reason']">$vbphrase[reason]: $post[edit_reason]</if>
</em>
</div>
<!-- / edit note -->
</if>

<div align="$stylevar[right]">
<!-- controls -->

<if condition="$post['editlink']">
<a href="$post[editlink]" name="vB::QuickEdit::$post[postid]"><img src="$stylevar[imgdir_button]/edit.gif" alt="$vbphrase[edit_delete_message]" border="0" /></a>
</if>
<if condition="$post['forwardlink']">
<a href="$post[forwardlink]"><img src="$stylevar[imgdir_button]/forward.gif" alt="$vbphrase[forward_message]" border="0" /></a>
</if>
<if condition="$post['replylink']">
<a href="$post[replylink]" rel="nofollow"><img src="$stylevar[imgdir_button]/<if condition="$post['forwardlink']">reply_small<else />quote</if>.gif" alt="$vbphrase[reply_with_quote]" border="0" /></a>
</if><a href="#top" onclick="self.scrollTo(0, 0); return false;"><img src="$stylevar[imgdir_button]/up.gif" alt="nach oben" border="0" /></a>
<if condition="$show['quickreply'] AND !$show['threadedmode']">
<a href="$post[replylink]" rel="nofollow" id="qr_$post[postid]" onclick="return false"><img src="$stylevar[imgdir_button]/quickreply.gif" alt="$vbphrase[quick_reply_to_this_message]" border="0" /></a>
</if>
<if condition="$show['moderated']">
<img src="$stylevar[imgdir_misc]/moderated.gif" alt="$vbphrase[moderated_post]" border="0" />
</if>
<if condition="$post['replylink'] AND $show['multiquote']">
<img src="$stylevar[imgdir_misc]/mq_img_off.gif" alt="$vbphrase[multiquote]" border="0" width="21" height="15" name="multiquote_$post[postid]" id="multiquote_$post[postid]" onclick="toggleMultiQuote($post[postid], this)" style="cursor:pointer" />
</if>
<!-- / controls -->
</div>

<!-- message, attachments, sig -->

</td>
</tr>
</table>

<!-- post $post[postid] popup menu -->
<div class="vbmenu_popup" id="postmenu_$post[postid]_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">$post[username]</td>
</tr>
<if condition="$show['profile']">
<tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$post[userid]">$vbphrase[view_public_profile]</a></td></tr>
</if>
<if condition="$show['pmlink']">
<tr><td class="vbmenu_option"><a href="private.php?$session[sessionurl]do=newpm&amp;u=$post[userid]"><phrase 1="$post[username]">$vbphrase[send_private_message_to_x]</phrase></a></td></tr>
</if>
<if condition="$show['emaillink']">
<tr><td class="vbmenu_option"><a href="sendmessage.php?$session[sessionurl]do=mailmember&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[send_email_to_x]</phrase></a></td></tr>
</if>
<if condition="$show['homepage']">
<tr><td class="vbmenu_option"><a href="$post[homepage]"><phrase 1="$post[username]">$vbphrase[visit_xs_homepage]</phrase></a></td></tr>
</if>
<if condition="$show['search']">
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=finduser&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[find_all_posts_by_x]</phrase></a></td></tr>
</if>
<if condition="$post['userid'] AND $show['member']">
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]"><phrase 1="$post[username]">$vbphrase[add_x_to_buddy_list]</phrase></a></td></tr>
</if>
</table>
</div>
<!-- / post $post[postid] popup menu -->




<if condition="$show['spacer']">
</div>
$spacer_close
</if>
<!-- / post #$post[postid] -->


<if condition="in_array($bbuserinfo[usergroupid], array(1))">
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] & $GLOBALS['adsense_position'] > 0">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 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">

<!-- Werbung Start -->

<!-- Werbung Ende -->


</td>
</tr>
</table>

</div>
$spacer_close
</if></if>

UK Jimbo
10-12-2005, 08:42 AM
Hi DG,

It might be a plan to remove the vBulletin code from that post above.

Copy/pasted that template from above and it works fine for me with the &&.

I don't why there should/would be an error, it's low level fundamental PHP.

You might be better off replacing the && with AND on your system.

James, puzzled

Doc Great
10-12-2005, 08:51 AM
Hi Jimbo,

ok now i'm gettn crazy :D i tested AND --> works perfectly - then thought bout testing && again --> also works :confused: why ....

I'm shure i tested it before several times with getting parse errors.

UK Jimbo
10-12-2005, 09:04 AM
Magic. PEBKAC (http://www.google.co.uk/search?hl=en&q=PEBKAC&btnG=Google+Search&meta=).

dsotmoon
10-12-2005, 05:23 PM
install, thanks for this Jimbo, works perfectly

dsotmoon
10-13-2005, 01:05 AM
one last question, i think, what would I add to the following to keep this from showing in certain forums...

<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0 && is_member_of($bbuserinfo,array(1,2,3,4,8,9,11,14,1 5,19))">

Doc Great
10-13-2005, 08:12 AM
I did (it again :D) --> a little modification to show all guests Ad, but let the reg. users choose if they want to get ad-posts or not.

Install: new profile field (single choice) On/Off (parameters) - note the field numer (e.g. 6)

Ad the following code at the end of your postbit (_legacy)

<if condition="in_array($bbuserinfo[usergroupid], array(1))">
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 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">

<!-- Ad Start -->

<!-- Ad between -->


</td>
</tr>
</table>

</div>
$spacer_close
</if></if>

<else />

<if condition="$vbulletin->userinfo['field6'] == 'On'">
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 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">

<!-- Ad Start -->

<!-- Ad between -->

</td>
</tr>
</table>

</div>
$spacer_close
</if></if>Finished - have fun :)

lebstars.com
10-16-2005, 03:04 PM
Could some1 tell me where to put the HTML code,
i installed the xml file through plug-in manager, but What Now?

UK Jimbo
10-16-2005, 04:43 PM
Could some1 tell me where to put the HTML code,
i installed the xml file through plug-in manager, but What Now?

At the end of your postbit or postbit_legacy templates.

The vBulletin manual (http://www.vbulletin.com/docs/html/) explains how to edit styles/templates. :)

Xplorer4x4
10-21-2005, 05:20 AM
What about:
Show Adsense in (or under, above) first unread Post of a Thread.
I think this is the place that would get the most user attention?

If this helps you guys i tried using the following IF condition to do this but vB said it was not alowed.

<if condition="$threadview = fetch_bbarray_cookie('thread_lastview', $thread['threadid']);">

It says:

With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression.

somedevil
10-21-2005, 07:13 PM
OK, I added Doc's code....doesn't seem to be working. All members are seeing the ads with the default for members set to off.

Doc, where you have ad start and ad between twice in the code, am I right in thinking the adsense code should be inserted in both areas?

lsgworldl
11-04-2005, 09:37 AM
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0"> $spacer_open <div style="padding:0px 0px $stylevar[cellpadding]px 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"> <!--e-bannerx.com code begin-->
<SCRIPT language=JavaScript type=text/javascript>
<!--
var rnd = Math.round(Math.random() * 10000000);
document.writeln('<SCR'+'IPT language=JavaScript type=text/javascript src="http://www.e-bannerx.com:8888/adrevolver/banner?js&place=13471&cpy='+rnd+'">');
document.writeln('</SC'+'RIPT>');
//-->
</SCRIPT><NOSCRIPT>
<IFRAME src="http://www.e-bannerx.com:8888/adrevolver/banner?place=13471&cpy=1" width=468 height=60 scrolling=no allowtransparency=true frameborder=0 marginheight=0 marginwidth=0>
<A href="http://www.e-bannerx.com:8888/adrevolver/href?place=13471&rnd=1000" target="_blank">
<IMG src="http://www.e-bannerx.com:8888/adrevolver/banner?img&place=13471&rnd=1000" width=468 height=60 border=0 alt="e-bannerx.com" ismap></A></IFRAME></NOSCRIPT>
<!--e-bannerx.com code end--> </td> </tr> </table> </div> $spacer_close </if>
($hook = vBulletinHook::fetch_hook('postbit_imicons')) ? eval($hook) : false;

where in postbit do I add this, I have tried the end it dont work

UK Jimbo
11-04-2005, 09:46 AM
where in postbit do I add this, I have tried the end it dont work

Are you using legacy postbits? If so add it to postbit_legacy.

I've no idea what you're doing with the code $hook = vBulletinHook::fetch_hook('postbit_imicons')) that shouldn't be in a template anywhere and isn't part of this hack.

lsgworldl
11-04-2005, 09:52 AM
add it where, I dont know where to add it, and I copied and pasted from this thread

lsgworldl
11-04-2005, 09:52 AM
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 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">

<!-- ad code goes here -->

</td>
</tr>
</table>

</div>
$spacer_close
</if>

UK Jimbo
11-04-2005, 11:07 AM
Install the plugin then at the end of the postbit or postbit_legacy template copy in the code as per the instructions at the top of this thread.

Info on how to edit templates and how to upload plugins is described in detail on the vBulletin site. http://www.vbulletin.com/

lohman
11-04-2005, 11:41 PM
Brilliant! This is exactly the kind of ad placement that I was hoping to find. Tower and header/footer ads get ignored, and intrusive pop-over ads are just wrong. This is perfect!

Many Thanks!

lsgworldl
11-05-2005, 01:43 PM
where in the end why isnt there a find this and add below it like most plugins?

Install the plugin then at the end of the postbit or postbit_legacy template copy in the code as per the instructions at the top of this thread.

Info on how to edit templates and how to upload plugins is described in detail on the vBulletin site. http://www.vbulletin.com/

ConqSoft
11-05-2005, 02:41 PM
where in the end why isnt there a find this and add below it like most plugins?

At the very end. After everything else. Very simple.

lsgworldl
11-06-2005, 06:12 AM
At the very end. After everything else. Very simple.
I did that and it didnt work, thats how simple it is

its only simple if you know what you are doing like anything is simple to ppl who know what they are doing, like I said why not have a find and put below that would make it simple

UK Jimbo
11-06-2005, 08:44 PM
I did that and it didnt work, thats how simple it is

its only simple if you know what you are doing like anything is simple to ppl who know what they are doing, like I said why not have a find and put below that would make it simple

The instructions I gave are dead simple. I suggest that you:


Read the instructions
Read them again
Read the instructions a third time
Install it


If you still don't get anywhere then I don't think this hack is for you. Maybe get someone else to help you out.

:)

The Chief
11-08-2005, 05:07 AM
great addition, I hope this helps me out :D

Milez
11-08-2005, 03:24 PM
This hack is brilliant, installed in 30 seconds. nice work!

dieselpowered
12-07-2005, 03:25 PM
UK, just wanted to let you know that this works with 3.5.2, incase you wanted to change the version at the top of the thread :)

Warrior
12-15-2005, 04:28 PM
This is perfect - works with the click for quick reply too! Just what I needed...

gc1
12-15-2005, 04:37 PM
Yes this is very nice, I have a Advertiser that pays 100 bucks a month for that spot :)

UK Jimbo
12-15-2005, 09:28 PM
Yes this is very nice, I have a Advertiser that pays 100 bucks a month for that spot :)

I'll take 10% please ;)

Zilvia
12-16-2005, 03:27 AM
Is there any way to have this display after the 1st post?

Cebby
12-18-2005, 07:23 PM
Works Great! Thanks!!

*Installed*

UK Jimbo
12-18-2005, 10:59 PM
Is there any way to have this display after the 1st post?

Yes - but you don't need to install the hack to do that. Just add the following (untested) to the end of the postbit and postbit_legacy templates:


<if condition="$post['postcount'] == 1">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 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">

<!-- ad code goes here -->

</td>
</tr>
</table>

</div>
$spacer_close
</if>

mikepmm
12-19-2005, 12:07 AM
best adsense mod !!!

wedgey
12-27-2005, 02:16 AM
This is great! Thank You!

I'm a newbie to vBulletin so it took me about 10 minutes to install. For other newbs, if it doesn't work the first time, try the other template (postbit OR postbit_legacy).

I have no idea what the difference is, but this plugin worked for me in v3.5.2 in the postbit_legacy template.

Thanks again!

http://forums.airlinepilotcentral.com

GamerJunk.net
01-01-2006, 09:11 AM
Awesome thanks.

kommuni
01-01-2006, 12:17 PM
Awesome thanks.

I have no idea what the difference is, but this plugin worked for me in v3.5.2 in the postbit_legacy template.

there are two "styles" to display posts in vbulletin- one of both has the avatar and information about a user above his/her post (the default setting) the other "old style" is the one wich shows it on the left like here in this forums. That's the difference.

Awesome idea - i hope that will pull up my click-through rate a bit... :D

*installed*

PolyMarauder
01-05-2006, 03:20 PM
Brilliant? Absolutely Brilliant?

Cheers! (installed)

Here is my thank you? enjoy ;)

http://img313.imageshack.us/img313/6827/visordown392x727xa.jpg

lochie
01-05-2006, 10:31 PM
Does this deffinetly work with 3.5.3? I've installed it and it doesn't appear at al;l no matter which of the 2 postbits I put the code in. I'm having some issues with my skin since upgrading and not sure if this is all connected.

I know it's for 3.5.2 but wasn't sure if it's just not compatible with my version or caused by my other issues.

PolyMarauder
01-06-2006, 12:16 PM
I usually just do the patches and wait a week or so to see if there are any issues like this. I have to admit though with the new plugin system it will be a lot easier to do a global update. For me now its not a matter of reinstalling my hacks itÂ’s more of will they work with the next version. Anyway I too would like to know if anyone else is having an issue.

neutek
01-10-2006, 02:56 PM
thanks 1st of all
this works fine for me to show to everyone - i can see ads

but doesnt work for me when i change to this - (so usergroups cannot see)

<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0 && is_member_of($bbuserinfo,array(1,2,3))">



my code:

<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 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">
<!-- MY AD CODE HERE -->
</td>
</tr>
</table>
</div>
$spacer_close
</if>


i would really like some help
just want certain usergroups not to be able to see

TitanJeff
01-13-2006, 02:25 PM
Just installed and lovin' it. Mine also needed to go to the postbit-legacy.

I do have one question. I have a space below my ad and my other posts don't have that. If possible, I would like to remove that space below my ad. Anyone know how?

adobepoint
01-14-2006, 04:01 PM
Is there a way to post the ads on top of the first post?

PolyMarauder
01-15-2006, 05:40 AM
I have a space below my ad and my other posts don't have that. If possible, I would like to remove that space below my ad. Anyone know how?
I don't know for sure but I think if you remove the "$spacer_close" part at the end of the code that will get rid of the space.

TitanJeff
01-15-2006, 01:19 PM
A little help for a newbie.

I got this working great and then wanted to set it up to show up only for guests, etc.

I got this error after making the change:
The following error occurred when attempting to evaluate this template:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/jfuqua/public_html/goForum/includes/adminfunctions_template.php(3532) : eval()'d code on line 223

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

Here's what I added:
<!-- / post #$post[postid] -->
<if condition="is_member_of($bbuserinfo,array(2,5,6,7))">
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">

My goal is for groups 2,5,6,7 to not see the ads.

Where did I goof? Thanks.

TitanJeff
01-15-2006, 03:12 PM
I don't know for sure but I think if you remove the "$spacer_close" part at the end of the code that will get rid of the space.
Thanks but that didn't take care of it for me.

TitanJeff
01-15-2006, 03:21 PM
just want certain usergroups not to be able to see
Me too.

Also, I'm wondering if there is a way to randomize ads for that area if you want to rotate banners along with AdSense.

TitanJeff
01-18-2006, 09:02 PM
Bump for the cause.

bloggerMel
01-20-2006, 05:30 AM
thanks for the hack, works well :)

Dreamchaser
01-21-2006, 08:36 PM
Does this deffinetly work with 3.5.3? I've installed it and it doesn't appear at al;l no matter which of the 2 postbits I put the code in. I'm having some issues with my skin since upgrading and not sure if this is all connected.

I know it's for 3.5.2 but wasn't sure if it's just not compatible with my version or caused by my other issues.

I am using vb 3.5.3 and this works great with no problem and did anyone find a best way to restrict some user groups in seeing the ads or anyway where every can see the ads ?

Thanks for the wonderful hack!

DC

UK Jimbo
01-25-2006, 02:21 AM
Here's what I added:
<!-- / post #$post[postid] -->
<if condition="is_member_of($bbuserinfo,array(2,5,6,7))">
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">

My goal is for groups 2,5,6,7 to not see the ads.

Where did I goof? Thanks.

Did you add an other </if> to close the statement?

You're logic would also only show it to users that are in groups 2,5,6,7. If you want to stop them from seeing it I suggest you use the template code listed in my first post with the following change:

instead of

<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">

use

<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0 && ! is_member_of($bbuserinfo,array(2,5,6,7))">

This will mean the ad is not shown to groups 2,5,6 and 7.

If you wanted to do the opposite and only show it to groups 2,5,6 and 7 then you should remove the ! like:

<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0 && is_member_of($bbuserinfo,array(2,5,6,7))">

No other changes to the template will be necessary

UK Jimbo
01-25-2006, 02:23 AM
Update: I've changed the tested version info to v3.5.3 as it runs fine in this latest version.

UK Jimbo
01-25-2006, 02:25 AM
Is there a way to post the ads on top of the first post?

Have a look back through this thread. The same question was asked a while back and I posted the solution.

You just need to do a template change, no plugin is required.

TitanJeff
01-25-2006, 11:26 AM
My thanks for taking the time to further explain. The changes worked perfectly.

UK Jimbo
01-25-2006, 04:30 PM
Excellent!

lochie
01-27-2006, 09:31 PM
I've installed this on a clean install of vbulletin 3.5.3 using iSkin form extremepixels at www.djstalk.com and it doesn't show up at all. :(

UK Jimbo
01-28-2006, 01:54 AM
I've installed this on a clean install of vbulletin 3.5.3 using iSkin form extremepixels at www.djstalk.com and it doesn't show up at all. :(

Is the plugin definitely installed?

Which templates have you added the extra template code to and in which style?

Run me though the steps you took.

lochie
01-28-2006, 06:41 PM
I accessed the admin area, clicked on the plugin section and browsed for your xml file, uploaded it and made sure it was enabled. I then opened up the postbit-legacy template and edited that to include the code you supplied with my google adsense code. I added your code to the very bottom just before the very last line of code.

XtremeOffroad
01-29-2006, 08:54 PM
Fantastic, Works great and much appreciated.
Clicks Install

UK Jimbo
01-30-2006, 06:12 AM
I accessed the admin area, clicked on the plugin section and browsed for your xml file, uploaded it and made sure it was enabled. I then opened up the postbit-legacy template and edited that to include the code you supplied with my google adsense code. I added your code to the very bottom just before the very last line of code.

OK

You're definitely using the legacy template not the postbit one on your forum?

You're definitely looking at the forum using that style or an inherited one?

lochie
01-30-2006, 11:38 AM
I definitley am using the legacy template yes, and I am definitely using the correct skin. I've even tried using the other skin (the default one) and adding the code into the standard post bit.

www.djstalk.com - if you want to take a look yourself, I'm happy to let you.

UK Jimbo
01-30-2006, 11:54 AM
Are the plugins definitely enabled and the templates edit: not overridden elsewhere?

I'm happy to take a further look if you want. If you setup an account with permissions to the admincp and PM the details you can then delete/change the permissions on the account or delete it after I'm done.

fluentdesigns
02-05-2006, 08:50 PM
I got everything working but for some reason my ad keeps showing Gulf Hurrican Relief ad. Is there configuring that I need to do to get my ads more targeted?

UK Jimbo
02-05-2006, 08:55 PM
I got everything working but for some reason my ad keeps showing Gulf Hurrican Relief ad. Is there configuring that I need to do to get my ads more targeted?

It sounds like Google hasn't yet indexed your pages or is unable to target any suitable ad to it. When this is the case it will use a public service ad in place of a paid one.

Have a look in the AdSense FAQ and this is explained there :)

fluentdesigns
02-05-2006, 08:57 PM
Ok.. I just setup my account Early early this morning. Would that have a reason why?

UK Jimbo
02-05-2006, 09:02 PM
As per my last post:

Have a look in the AdSense FAQ and this is explained there :)

fluentdesigns
02-05-2006, 09:05 PM
heheh im lookin im lookin... :)

hotrod1
02-21-2006, 02:07 PM
Great hack, thanks a bunch!

hbalagh1
03-06-2006, 07:55 PM
how can we not have this display on certain forums ;)
thanks

UK Jimbo
03-06-2006, 08:08 PM
how can we not have this display on certain forums ;)
thanks

You should be able to test against $thread['forumid'] with something like:

don't display in forum id 22
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0 && $thread['forumid'] != 22">

don't display in forums id 21,22 or 23
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0 && ! in_array($thread['forumid'],array(21,22,23))">

I haven't tested these - let me know how you get on.

hbalagh1
03-06-2006, 08:49 PM
seems to work great :)

Fuzz
03-07-2006, 07:00 PM
***INSTALL****

Works great and thank you for sharing. Much appreciated!

Gottcha
03-07-2006, 07:50 PM
edited the templated....installed the xml and i see the sponsored link on the forums but i dont see the ads .... any ideas?

UK Jimbo
03-07-2006, 08:12 PM
edited the templated....installed the xml and i see the sponsored link on the forums but i dont see the ads .... any ideas?

Did you put the Google AdSense code where the comment says: <!-- ad code goes here -->

?

Gottcha
03-07-2006, 09:36 PM
yes i did .... replaced the whole line with the adsense code.

UK Jimbo
03-07-2006, 10:05 PM
yes i did .... replaced the whole line with the adsense code.

can you PM me the contents of the template please?

tribedude
03-08-2006, 06:17 PM
This was working great for us initially (so I thought) but I am now getting many users who are complaining of blank pages and threads that lead to http:///

It seems all of these users are on IE. I haven't been able to replicate this behaviour on IE or Firefox.

Here is my postbit legacy:

<!-- post #$post[postid] -->
<if condition="$show['spacer']">
$spacer_open
<div id="edit$post[postid]" style="padding:0px 0px $stylevar[cellpadding]px 0px">
<if condition="!$post['islastshown']"><!-- this is not the last post shown on the page --></if>
</if>

<table id="post$post[postid]" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center">
<tr>
<if condition="$show['announcement']">
<td class="thead" style="font-weight:normal" colspan="2">
<img class="inlineimg" src="$stylevar[imgdir_statusicon]/post_$post[statusicon].gif" alt="$post[statustitle]" border="0" />
<phrase 1="$post[startdate]" 2="$post[enddate]">$vbphrase[x_until_y]</phrase>
</td>
<else />
<td class="thead" style="font-weight:normal" $post[scrolltothis]>
<!-- status icon and date -->
<a name="post$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/post_$post[statusicon].gif" alt="$post[statustitle]" border="0" /></a>
$post[postdate]<if condition="!$show['detailedtime']">, $post[posttime]</if>
$post[firstnewinsert]
<!-- / status icon and date -->
</td>
<td class="thead" style="font-weight:normal" align="$stylevar[right]">
&nbsp;
<if condition="$show['postcount']">#<a href="showpost.php?$session[sessionurl]p=$post[postid]&amp;postcount=$post[postcount]" target="new" rel="nofollow" id="postcount$post[postid]" name="$post[postcount]"><strong>$post[postcount]</strong></a></if>
<if condition="$show['inlinemod']">
<input type="checkbox" name="plist[$postid]" id="plist_$postid" style="vertical-align:middle; padding:0px; margin:0px 0px 0px 5px" value="$post[checkbox_value]" onclick="inlineMod.toggle(this)" />
</if>
</td>
</if>
</tr>
<tr valign="top">
<td class="alt2" width="175">

<div id="postmenu_$post[postid]">
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
<script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script>
<else />
$post[musername]
</if>
</div>

<if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
<if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>

<if condition="$show['avatar']">
<div class="smallfont">
&nbsp;<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
</div>
</if>

<div class="smallfont">
&nbsp;<br />
<if condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>
<if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if>
<if condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
<div>
$vbphrase[posts]: $post[posts]
</div>
<if condition="$show['reputation']"><div><if condition="$show['reppower']">$vbphrase[reppower]: $post[reppower]</if>$post[reputationdisplay]</div></if>
<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
</div>

</td>
<if condition="$show['moderated']">
<td class="alt2" id="td_post_$post[postid]">
<else />
<td class="alt1" id="td_post_$post[postid]">
</if>

<if condition="$show['messageicon'] OR $post['title']">
<!-- icon and title -->
<div class="smallfont">
<if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if>
<if condition="$post['title']"><strong>$post[title]</strong></if>
</div>
<hr size="1" style="color:$stylevar[tborder_bgcolor]" />
<!-- / icon and title -->
</if>

<!-- message -->
<div id="post_message_$post[postid]">$post[message]</div>
<!-- / message -->

<if condition="$show['attachments']">
<!-- attachments -->
<div style="padding:$stylevar[cellpadding]px">

<if condition="$show['thumbnailattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_thumbnails]</legend>
<div style="padding:$stylevar[formspacer]px">
$post[thumbnailattachments]
</div>
</fieldset>
</if>

<if condition="$show['imageattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_images]</legend>
<div style="padding:$stylevar[formspacer]px">
$post[imageattachments]
</div>
</fieldset>
</if>

<if condition="$show['imageattachmentlink']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_images]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[imageattachmentlinks]
</table>
</fieldset>
</if>

<if condition="$show['otherattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attached_files]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[otherattachments]
</table>
</fieldset>
</if>

<if condition="$show['moderatedattachment']">
<fieldset class="fieldset">
<legend>$vbphrase[attachments_pending_approval]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
$post[moderatedattachments]
</table>
</fieldset>
</if>

</div>
<!-- / attachments -->
</if>

<if condition="$post['signature']">
<!-- sig -->
<div>
__________________<br />
$post[signature]
</div>
<!-- / sig -->
</if>

<if condition="$show['postedited']">
<!-- edit note -->
<div class="smallfont"> <hr size="1" style="color:$stylevar[tborder_bgcolor]" />
<em>
<phrase 1="$post[edit_username]" 2="$post[edit_date]" 3="$post[edit_time]">$vbphrase[last_edited_by_x_on_y_at_z]</phrase>.
<if condition="$post['edit_reason']">$vbphrase[reason]: $post[edit_reason]</if>
</em>
</div>
<!-- / edit note -->
</if>

</td>
</tr>
<tr>
<td class="alt2">
$post[onlinestatus]
<if condition="$show['reputationlink']"><a href="reputation.php?$session[sessionurl]p=$post[postid]" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/reputation.gif" border="0" alt="<phrase 1="$post[username]">$vbphrase[add_to_xs_reputation]</phrase>" /></a></if>
<if condition="$show['reportlink']"><a href="report.php?$session[sessionurl]p=$post[postid]" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/report.gif" alt="$vbphrase[report_bad_post]" border="0" /></a></if>
$post[iplogged]
&nbsp;
</td>
<if condition="$show['moderated']">
<td class="alt2" align="$stylevar[right]">
<else />
<td class="alt1" align="$stylevar[right]">
</if>
<!-- controls -->
<if condition="$post['editlink']">
<a href="$post[editlink]" name="vB::QuickEdit::$post[postid]"><img src="$stylevar[imgdir_button]/edit.gif" alt="$vbphrase[edit_delete_message]" border="0" /></a>
</if>
<if condition="$post['forwardlink']">
<a href="$post[forwardlink]"><img src="$stylevar[imgdir_button]/forward.gif" alt="$vbphrase[forward_message]" border="0" /></a>
</if>
<if condition="$post['replylink']">
<a href="$post[replylink]" rel="nofollow"><img src="$stylevar[imgdir_button]/<if condition="$post['forwardlink']">reply_small<else />quote</if>.gif" alt="$vbphrase[reply_with_quote]" border="0" /></a>
</if>
<if condition="$show['quickreply'] AND !$show['threadedmode']">
<a href="$post[replylink]" rel="nofollow" id="qr_$post[postid]" onclick="return false"><img src="$stylevar[imgdir_button]/quickreply.gif" alt="$vbphrase[quick_reply_to_this_message]" border="0" /></a>
</if>
<if condition="$show['moderated']">
<img src="$stylevar[imgdir_misc]/moderated.gif" alt="$vbphrase[moderated_post]" border="0" />
</if>
<!-- / controls -->
</td>
</tr>
</table>

<!-- post $post[postid] popup menu -->
<div class="vbmenu_popup" id="postmenu_$post[postid]_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">$post[username]</td>
</tr>
<if condition="$show['profile']">
<tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$post[userid]">$vbphrase[view_public_profile]</a></td></tr>
</if>
<if condition="$show['pmlink']">
<tr><td class="vbmenu_option"><a href="private.php?$session[sessionurl]do=newpm&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[send_private_message_to_x]</phrase></a></td></tr>
</if>
<if condition="$show['emaillink']">
<tr><td class="vbmenu_option"><a href="sendmessage.php?$session[sessionurl]do=mailmember&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[send_email_to_x]</phrase></a></td></tr>
</if>
<if condition="$show['homepage']">
<tr><td class="vbmenu_option"><a href="$post[homepage]"><phrase 1="$post[username]">$vbphrase[visit_xs_homepage]</phrase></a></td></tr>
</if>
<if condition="$show['search']">
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=finduser&amp;u=$post[userid]" rel="nofollow"><phrase 1="$post[username]">$vbphrase[find_more_posts_by_x]</phrase></a></td></tr>
</if>
<if condition="$post['userid'] AND $show['member']">
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]"><phrase 1="$post[username]">$vbphrase[add_x_to_buddy_list]</phrase></a></td></tr>
</if>
</table>
</div>
<!-- / post $post[postid] popup menu -->

<if condition="$show['spacer']">
</div>
$spacer_close
</if>
<!-- / post #$post[postid] -->
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0 && $thread['forumid'] != 13">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left"><a name="post$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/post_$post[statusicon].gif" alt="$post[statustitle]" border="0" /></a></td>
</tr>
<tr>
<td class="alt1" align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxx";
google_alternate_ad_url = "http://";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="5418150519";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "22229C";
google_color_url = "000000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

</td>
</tr>
</table>

</div>
$spacer_close
</if>

SIINSI
03-08-2006, 06:42 PM
This was working great for us initially (so I thought) but I am now getting many users who are complaining of blank pages and threads that lead to http:///

It seems all of these users are on IE. I haven't been able to replicate this behaviour on IE or Firefox.

Here is my postbit legacy:

I dunno if it's a coincidence or what but, my Firefox users have reported quick replying sending them to a blank white page.... I dunno if it's this hack. I dunno what it is...

tribedude
03-08-2006, 06:46 PM
I think it might be the google alternate ad going to http://

I just saw that and put a functioning URL in there and we will see what happens....

SIINSI
03-08-2006, 09:07 PM
I think it might be the google alternate ad going to http://

I just saw that and put a functioning URL in there and we will see what happens....

Try this man....

http://www.vbulletin.com/forum/showthread.php?t=156807&page=2&highlight=firefox

http://www.vbulletin.com/forum/showthread.php?t=157022

Worked for me :D

Miguel

tribedude
03-09-2006, 01:46 AM
Try this man....

http://www.vbulletin.com/forum/showthread.php?t=156807&page=2&highlight=firefox

http://www.vbulletin.com/forum/showthread.php?t=157022

Worked for me :D

Miguel

Thanks Miguel but installing this plugin solved the quick reply issue for me a long time ago, however I am still getting complaints from users who click on threads in IE and end up going to http:///

UK Jimbo
03-09-2006, 07:28 AM
Thanks for the PMs Gottcha, I think that your problem is running multiple Google ads on the same page. Have a read here (https://www.google.com/support/adsense/bin/answer.py?answer=10522&ctx=en-uk:search&query=multiple&topic=0&type=f) and try doing a search for "multiple" in the Google AdSense search section.

mattyk72
03-21-2006, 02:28 AM
clicking install :)

Marv
03-23-2006, 11:06 AM
Hi UK Jimbo,

I?ve got my own custom Ads showing up above the first post and under the lastpost. Any chance that your plugin could show the Ads only under the firstpost and above the lastpost ? Otherwise sometimes there would be 2 Ads showing up and that?s not nice and clean..

Guess it could be done with another conditional in <if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">

I need it that way, that ads delivered by this plugin only appear

under the first post
above the last post
if the whole thread has at least 3 posts (so the plugin-ads can show up between the first and second or second and third post)



Any ideas ?

Marv
03-25-2006, 08:24 AM
I need it that way, that ads delivered by this plugin only appear
under the first post
above the last post
if the whole thread has at least 3 posts (so the plugin-ads can show up between the first and second or second and third post)
Jason,

even better would be a second one for registered users where Adsense only appears:


under the first post
above the last post
if the whole thread has at least 5 posts (so the plugin-ads can show up without overloading the thread with ads)
under the lastpost as Andreas mentioned before. The reason is clear - that?s the post most users read first and should lead to the best reveniews

Would turn this plug-in into a must-have for all AdSense and Yahoo publishers, which have already own custom ads or adservers running on their forums ;)

Marv
03-30-2006, 01:39 PM
under the first post
above the last post ($perpage=10)
if the whole thread has at least 3 posts (so the plugin-ads can show up between the first and second or second and third post)

May be someone can help me out. I?ve tried to implement these 3 conditions that way_

<!-- RandomAds for unregistered users -->
<if condition="is_member_of($bbuserinfo, 1) AND $GLOBALS[threadinfo][replycount] >= 3">
<if condition="$post['postid'] > '1' AND $post['postid'] <> '10' AND $post['postid'] <> '20' AND $post['postid'] <> '30' AND $post['postid'] <> '40' AND $post['postid'] <> '50' AND $post['postid'] <> '60' AND $post['postid'] <> '70' AND $post['postid'] <> '80' AND $post['postid'] <> '90'">
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="alt2" align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxx";
google_alternate_ad_url = "http://www.mysite.com/forum/google_adsense_script.html";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="9100589350";
google_color_border = "EFF0F3";
google_color_bg = "EFF0F3";
google_color_link = "445683";
google_color_url = "445683";
google_color_text = "798AB4";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
</table>
</div>
$spacer_close
</if>
</if>
</if>
<!-- / RandomAds for unregistered users -->

But I hit and miss. Does anyone see, where I went wrong..? Guess I can?t see the wood because of all the trees... :confused:

UK Jimbo
03-30-2006, 01:47 PM
@Marv

Try replacing the plugin code with this (untested)

edit: removed, that's not going to work. Have a meeting to go to now but will look at it a bit later

UK Jimbo
03-30-2006, 01:50 PM
Took less time than I thought - give this a try:

// only for non-threaded display
if($threadedmode == 0) {

// only need to do the calculation once
if( $counter == 2 && empty($GLOBALS['adsense_position'] && $totalposts >= 3 ) ) {

$_min = $postcount;
$_max = min($totalposts,$_min+$perpage-1) - 1;

$GLOBALS['adsense_position'] = rand($_min,$_max);
}

}

EyeCrave
03-30-2006, 11:59 PM
I get this error with that code above:

Parse error: parse error, unexpected T_BOOLEAN_AND, expecting ')' in /pathto/showthread.php(1031) : eval()'d code on line 5

BTW - awesome plugin.

UK Jimbo
03-31-2006, 06:38 AM
OOps - that's what happens when you do things in a hurry. Try this for size:

// only for non-threaded display
if($threadedmode == 0) {

// only need to do the calculation once
if( $counter == 2 && empty($GLOBALS['adsense_position']) && $totalposts >= 3 ) {

$_min = $postcount;
$_max = min($totalposts,$_min+$perpage-1) - 1;

$GLOBALS['adsense_position'] = rand($_min,$_max);
}

}

EyeCrave
03-31-2006, 08:02 PM
Works. Thank you!

Marv
04-01-2006, 08:46 AM
OOps - that's what happens when you do things in a hurry.

Thx UK-Jimbo,

I?ll give it a try and report back to you asap.

The Chief
04-05-2006, 04:23 PM
installed and works great!!

UK Jimbo
04-06-2006, 02:38 AM
Thx UK-Jimbo,

I?ll give it a try and report back to you asap.

Any luck?

GrendelKhan{TSU
04-06-2006, 11:17 AM
I don't know if cause I installed this wrong or the Googlebot just isn't doing its job (so to speak)...

but I'm having trouble actually getting relevant ads. I don't think the googlebot is actually "reading" the content of the page. I always get ads for "free forum software" and related.

ie: I think its basically only reading the footer. or something

any ideas as to what is blocking or causing the Gbot to not actually dig into the content?

UK Jimbo
04-06-2006, 03:09 PM
Hi GrendelKhan

Are the pages publically visible or do you have to register to see them? If Googlebot can't get at the pages (and content) from the same URL that you're using to access it then it can't index it. Sometimes it might take a while for pages to get indexed. I'd give it a couple of days and see how it goes. Post back and let me know how you get on.

GrendelKhan{TSU
04-08-2006, 12:28 PM
Hi GrendelKhan

Are the pages publically visible or do you have to register to see them? If Googlebot can't get at the pages (and content) from the same URL that you're using to access it then it can't index it. Sometimes it might take a while for pages to get indexed. I'd give it a couple of days and see how it goes. Post back and let me know how you get on.

Hey jimbo, thanks for the reply (sorry I've been out this week and didn't see it).

The threads are all public. (no registration necessary to read)
And its been like this for weeks. :/

(eg:
here's one with a ton of text about the superbowl and ward winning MVP...but again, the ads are still "free forum software etc."
http://www.naestar.net/forums/showthread.php?t=19196 )

UK Jimbo
04-09-2006, 08:37 AM
(eg:
here's one with a ton of text about the superbowl and ward winning MVP...but again, the ads are still "free forum software etc."
http://www.naestar.net/forums/showthread.php?t=19196 )

Hotels in Seoul of Korea
Animaged images for ?150
All Steelers games on DVD

were the ads I got. Looks like it's working.

GrendelKhan{TSU
04-09-2006, 09:11 AM
Hotels in Seoul of Korea
Animaged images for ?150
All Steelers games on DVD

were the ads I got. Looks like it's working.

really? :/
is some kinda of geo-location in effect? where are you located?

I get 4 forum software or other related ads. :( (ie: pretty useless)
(see image).

can you check some other threads and see if you get related ads? I'd appreciated it greatly. I want to see if its just feeding me those ads.

tamborinegal
04-10-2006, 01:44 AM
Works very well. Thank you. :)

Clancy

Makaveli105
04-10-2006, 03:20 PM
really? :/
is some kinda of geo-location in effect? where are you located?

I get 4 forum software or other related ads. :( (ie: pretty useless)
(see image).

can you check some other threads and see if you get related ads? I'd appreciated it greatly. I want to see if its just feeding me those ads.

I see relevant ads.

Steelers pendants
Pittsburg Steelers
Pittsburg Steelers
Seoul Hotels

---

Thanks UK Jimbo, I'll give it a go :D

arossphoto
04-12-2006, 12:29 AM
Took less time than I thought - give this a try:

// only for non-threaded display
if($threadedmode == 0) {

// only need to do the calculation once
if( $counter == 2 && empty($GLOBALS['adsense_position'] && $totalposts >= 3 ) ) {

$_min = $postcount;
$_max = min($totalposts,$_min+$perpage-1) - 1;

$GLOBALS['adsense_position'] = rand($_min,$_max);
}

}

I've installed and it's working very well. Will the code above display the ads after the first post and before the last? Would you mind showing me what the whole code for the post bit would look like, and is it possible to show the ads to certain usergroups?

Cheers.

Marv
04-12-2006, 12:00 PM
Any luck?

Sorry for the delay, Jimbo :)

I?ve installed your code and modified it, so that certain usergroups see/don?t see ads, and to create different ad-channels to have a better overview (targeting).

The code seemed to work fine, but in the last days I had to notice that ads also appeared under the last post. Dunno why, but that?s the situation by now.

UK Jimbo
04-12-2006, 12:10 PM
Hi guys - I'm really tied up at the moment. Will take a look ASAP but that might be in a few days time.

James

Niall Fernie
04-13-2006, 03:04 PM
I know this is a bit basic, but I missed it on about 20 ocassions during my installation on this plugin.

Make sure you have the plugin/hook system enabled on your board, I was doing a test install on my other vB setup (small site - new install) and could not get this to work at all, until I read the text that vB had been almost shouting at me since the start "the plugin/hook system is currently disabled..."

Enabled it and worked first time.

I know you've probably just wasted 30 seconds of your life reading this, but I've just read every post here before reading the error message so just hoping to save someone 10 minutes.

Great plugin, easy install (especially if you're not as dopy as me)

INSTALL

sandrodz
04-13-2006, 11:13 PM
installed, works like charm... only concern is if I can set it to display at the end of the last post only? or after the first post only? cause I believe this kind of random placing isn't efficient in my case... thank you!

imported_infitech
04-14-2006, 05:36 AM
This stretches my page

Niall Fernie
04-14-2006, 02:38 PM
Now that I have this up and running, can anyone tell me how to modify the first line condition to check for user rank, ie I would also like my Junior members to be able to see the ads. I already have it checking for forums and usergroups. Junior members (less than 30 posts) dont contribute as much content to the site as more senior members so they may as well see the ads.

Thanks in advance for any help.

The Chief
04-16-2006, 05:33 AM
Does this work on postbit template, doesn't seem to work on mine, it creates the first post normal, then every post after that just decreases in size, lol..

the last post is super small..??

AzzidReign
04-16-2006, 05:47 AM
Sweet! I've been looking for this! Thanks a lot!

I had some troubles, but once I put the code in both postbit and legacy, then the ads started showing up! Brilliant mod! Thanks very much!

UK Jimbo
04-21-2006, 09:38 AM
This stretches my page

Nice forum style - doesn't look very standard to me though.

You probably need to change the HTML accordingly :)

UK Jimbo
04-21-2006, 09:41 AM
Does this work on postbit template, doesn't seem to work on mine, it creates the first post normal, then every post after that just decreases in size, lol..

the last post is super small..??

Is your postbit standard? Are you sure you pasted the code in correctly.

Without more info it's impossible to speculate what might be wrong.

UK Jimbo
04-21-2006, 09:57 AM
I've installed and it's working very well. Will the code above display the ads after the first post and before the last? Would you mind showing me what the whole code for the post bit would look like, and is it possible to show the ads to certain usergroups?

Cheers.

The postbit code should remain the same.

If you look back through the thread you'll see information on how to restrict the ad to appear/hide for given user groups.

Shout if you get stuck.

UK Jimbo
04-21-2006, 10:03 AM
installed, works like charm... only concern is if I can set it to display at the end of the last post only? or after the first post only? cause I believe this kind of random placing isn't efficient in my case... thank you!

Trawl back through the thread. Pretty sure this has been done too :)

imported_infitech
04-21-2006, 10:24 AM
Thnks UK Jimbo. Already have.

UK Jimbo
04-21-2006, 11:43 AM
Thnks UK Jimbo. Already have.

You should click install then ;)

arossphoto
05-14-2006, 10:12 PM
To limit it just to certain user groups I'd recommend the following conditional rather than the in_array() solution posted above. This version ensures that secondary group assignments are checked too.

For a single user group (1 in this case)
<if condition="is_member_of($bbuserinfo, 1)">

For multiple user groups (1, 2 & 3 in this case)
<if condition="is_member_of($bbuserinfo, array(1,2,3))">

I only have one usergroup that I don't want to see the ads. Instead of entering all the groups that should see them like the example above, is there a way to just enter the usergroup that should not see them?

I hope that makes sense.

Thanks.

UK Jimbo
05-14-2006, 10:59 PM
I only have one usergroup that I don't want to see the ads. Instead of entering all the groups that should see them like the example above, is there a way to just enter the usergroup that should not see them?

I hope that makes sense.

Thanks.

I think it was done on this thread somewhere before you can negate it like this:

<if condition="! is_member_of($bbuserinfo, 1)">

arossphoto
05-15-2006, 12:00 AM
Thanks! Works perfectly. I did search here before I asked, but not much came up under "usergroup".

veedee
05-15-2006, 03:39 PM
Awesome hack. I've donated $25, as it's made me at least $500 so far, what about you?

arossphoto
05-19-2006, 10:59 PM
I did (it again :D) --> a little modification to show all guests Ad, but let the reg. users choose if they want to get ad-posts or not.


Is there any way to provide this option only to certain usergroups, like paying members?

UK Jimbo
05-21-2006, 08:42 PM
Is there any way to provide this option only to certain usergroups, like paying members?

Yup - the question's been asked/answered a few times in this thread already :)

arossphoto
05-21-2006, 09:15 PM
Yup - the question's been asked/answered a few times in this thread already :)

Sorry, I don't think I was being very clear in my question. Doc Great provided a solution (https://vborg.vbsupport.ru/showpost.php?p=794514&postcount=64) that would add an On/Off button to the user's control panel so they could choose to see ads or not. Maybe this isn't the right place to ask, but I'd only like to give this option to certain paying members.

With your help I have set it up already so one usergroup never sees the ads, but I would like to give them the option in the Control Panel to turn ads on or off. I think I read all the posts here and I didn't see this answered.

Cheers,

Andrew

UK Jimbo
05-21-2006, 09:34 PM
If you could create the userfield and have it specific to only certain usergroups that would solve the problem. I'm not sure if vBulletin will do that out of the box (the docs will do though!), if not I think it's probably a question for the mod requests forum on here.

Post back to let me/others know how you got on. Thanks!

T.S.
05-23-2006, 05:48 AM
Great plugin, thanks. Now if only there was one to put an ad randomly between threads on the thread list. ;)

durapuma
05-23-2006, 04:51 PM
Hello,

is it possible, that this mod does not work in vB 3.5.4 ? I have just changed the postbit template, I have add the following at the bottom :


<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsoren</td>
</tr>
<tr>
<td class="alt1" align="center">
<!-- Werbung Start -->
<script type="text/javascript"><!--
google_ad_client = "pub-4639893886504387";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- Werbung Ende -->

</td>
</tr>
</table>

</div>
$spacer_close
</if>


after that, I import the Plugin. But nothing happens :(

What is the problem ? What do you need to help me ?


Best Regards from Germany

durapuma

UK Jimbo
05-23-2006, 05:06 PM
If you're running in "legacy postbit" mode (user info goes at the left hand side of posts) then you need to edit the template postbit_legacy instead of postbit.

You also haven't clicked install for this mod :)

durapuma
05-23-2006, 07:22 PM
Hello again,

i have just restore the "postbit" template and have add the code to the postbit_lecacy template. But it don't run :(

Whats the problem :( :( ?

I will click on install, if it runs ;)

dssart
05-23-2006, 07:53 PM
Just wanted to say that this was an excellent hack. Clicked Install. Now, if it generates some cash I'd be happy to donate a little :)

One newbie type question that has me stumped. I want to make the ads visible to non-registered guests, Users awaiting EMail confirmation and to those who have a post total of less than 50. I know this really goes beyond the realm of this hack, but if anyone can clarify this I would be grateful. For some reason I can't grasp this and I'm sure it super-simple.

Here are my default usergroups and their Usergroup I.D.s:

(COPPA)-4
Administrators-6
Moderators-7
Registered-2
Super Moderators-5
Unregistered-1
Users Awaiting EMail Confirmation-3


Now here are my Usergroup Titles/Minimum Posts/I.D. #

New Member/0/1
Junior Member/20/2
Member/50/3
Senior Member/100/4


How can I edit the hack so that after a minimum post requirement a user can be "ad-free"?


Thanks!

Stop
05-23-2006, 10:27 PM
Great hack & works fine.
Thanks Jimbo

T.S.
05-23-2006, 11:46 PM
Just wanted to say that this was an excellent hack. Clicked Install. Now, if it generates some cash I'd be happy to donate a little :)

One newbie type question that has me stumped. I want to make the ads visible to non-registered guests, Users awaiting EMail confirmation and to those who have a post total of less than 50. I know this really goes beyond the realm of this hack, but if anyone can clarify this I would be grateful. For some reason I can't grasp this and I'm sure it super-simple.

Here are my default usergroups and their Usergroup I.D.s:

(COPPA)-4
Administrators-6
Moderators-7
Registered-2
Super Moderators-5
Unregistered-1
Users Awaiting EMail Confirmation-3


Now here are my Usergroup Titles/Minimum Posts/I.D. #

New Member/0/1
Junior Member/20/2
Member/50/3
Senior Member/100/4


How can I edit the hack so that after a minimum post requirement a user can be "ad-free"?


Thanks!
I believe this would be done by adding a new usergroup and having users automatically promoted to it after 50 posts, then using the "if" by usergroup as explained earlier in the thread. Unless an "if" can be done by postcount, I am not sure. ;)

dssart
05-24-2006, 12:06 AM
Thanks T.S., I would ideally like to keep my usergroups/usertitles and have this handled by a conditional if possible..but if that can't de done, I'll try anything.

T.S.
05-24-2006, 12:14 AM
Thanks T.S., I would ideally like to keep my usergroups/usertitles and have this handled by a conditional if possible..but if that can't de done, I'll try anything.
Try this

<if condition="$post[posts] >=50">

Jimbo's code

</if>

dssart
05-24-2006, 12:17 AM
Thanks T.S.!

The first "if" line would go before Jimbo's first line of code in his hack and the last would go after his last line correct?

T.S.
05-24-2006, 12:19 AM
Thanks T.S.!

The first "if" line would go before Jimbo's first line of code in his hack and the last would go after his last line correct?
Correct.

dssart
05-24-2006, 12:20 AM
Thanks again..I'll give it a go tomorrow after I get home from my real job :)

durapuma
05-24-2006, 04:41 AM
Hello again,

i have just restore the "postbit" template and have add the code to the postbit_lecacy template. But it don't run :(

Whats the problem :( :( ?

I will click on install, if it runs ;)

Please remember my question - i need to install the hack quickly!!

Thanks

.Tim
05-26-2006, 10:26 PM
Works perfect! Thanks.

dssart
05-28-2006, 04:08 AM
Doesn't work. Thanks anyways...



Try this

<if condition="$post[posts] >=50">

Jimbo's code

</if>

T.S.
05-28-2006, 05:12 AM
Doesn't work. Thanks anyways...
I just noticed that I placed the < the wrong way. I turned it around and tried it on my own forum, but still couldn't get it working. I am still learning.

sross
05-31-2006, 12:24 AM
Hi, so is the ad displayed right after the 1st post on the page? I would like it to do the following.. is this possible:

a page has 2 posts the ad appears after post one, the page has 4 posts the ad appears after post2, page with 10 posts on it the ad appears after post5. This way the ad is always kept in the center of the postings. Thanks for any info!

T.S.
05-31-2006, 07:23 AM
Hi, so is the ad displayed right after the 1st post on the page?
This plugin displays the ad in a different random position with each page load.

UK Jimbo
05-31-2006, 10:04 AM
Hi, so is the ad displayed right after the 1st post on the page? I would like it to do the following.. is this possible:

a page has 2 posts the ad appears after post one, the page has 4 posts the ad appears after post2, page with 10 posts on it the ad appears after post5. This way the ad is always kept in the center of the postings. Thanks for any info!

I could write this for you. Drop me a PM with an idea of how much you're willing to spend on it.

Netdesignz
06-09-2006, 08:47 AM
Sorry to sound dumb and ask this question but after reading through this whole thread im still confused.
This is the first mod ive installed so please bear with me.

Ive manged uploading the xml :)

But this edit the postbit is baffling me as i cant find the file i need to edit. Ive looked through all the files i have there and there is no file called that..Can someone explain in noob terms plz :(

UK Jimbo
06-09-2006, 09:05 AM
"postbit" and "postbit_legacy" are the name of "templates". Sets of "templates" are stored in "styles".

Check out the "styles & templates" section in the vB documentation here (http://www.vbulletin.com/docs/html/)

Shout if you have any problems.

T.S.
06-19-2006, 11:23 AM
Any 3.6 update coming out? This version works for me on 3.6 but doesn't quite look right. :banana:

UK Jimbo
06-19-2006, 11:33 AM
Any 3.6 update coming out? This version works for me on 3.6 but doesn't quite look right. :banana:

Sorry - I won't have a chance to till v3.6 is stable and I've installed it on visordown.com

Hemanth
07-26-2006, 11:03 AM
Good one. Installed.

Bulent Tekcan
08-04-2006, 09:58 PM
Any news for 3.6.0 ?

dssart
08-05-2006, 09:52 PM
Hope this can work with 3.6, really looked great pre-3.6..

nsusa
08-06-2006, 01:12 AM
Works for me in 3.6. The only thing I had to change was to remove the $spacer_open and ...close as otherwise it would not go 100% in width in my case.

Christoph

brvheart
08-08-2006, 03:06 PM
great hack, I saw earlier in the thread about making the ads show up after the first unread post...has this been done yet?

*clicks install*

almukmin
08-09-2006, 08:21 AM
Works for me in 3.6. The only thing I had to change was to remove the $spacer_open and ...close as otherwise it would not go 100% in width in my case.

Christoph

Hi, do you know how to make the space above and below the box equal to the normal space between posts? I've been trying with no success.

almukmin
08-09-2006, 08:36 AM
I got the fix, change it to

<div style="padding:$stylevar[cellpadding]px 0px 0px 0px">

and remove the spacer open and spacer close

This is for 3.6.0

dssart
08-09-2006, 09:18 AM
Hi,

after we remove the spacer code from the top and bottom, where does the div style code go..at the very top? Thanks.


I got the fix, change it to

<div style="padding:$stylevar[cellpadding]px 0px 0px 0px">

and remove the spacer open and spacer close

This is for 3.6.0

mano1.com
08-09-2006, 02:12 PM
interesting, i'll give this one a shot later today. thanks!

dssart
08-16-2006, 01:08 AM
just re-installed under 3.6, using the tips from above..good work. click *install*

Is it possible to have the ads displayed when viewing the forum index, or when viewing the thread topics within a group as opposed to having the ads displayed when one views the messages within a thread as this does now?

Would also like to know if I could have two rows of ads appear instead of one..

webgroup
08-18-2006, 02:42 AM
Sorry - I won't have a chance to till v3.6 is stable and I've installed it on visordown.com


Any new of the new version?
works in 3.6.0 but the table with the ads is not squeared with the post tables anymore.

Smoothie
08-18-2006, 04:32 AM
Any new of the new version?
works in 3.6.0 but the table with the ads is not squeared with the post tables anymore.

Works with 3.6, you just need to remove the space_open and spacer_closed.

Use this:
<div style="padding:6px 0px 0px 0px">

webgroup
08-18-2006, 04:41 AM
Works with 3.6, you just need to remove the space_open and spacer_closed.

Use this:
<div style="padding:6px 0px 0px 0px">

thanks.

should I add that code or replace the spacer_closed and space_open with the code?

Smoothie
08-19-2006, 05:50 AM
thanks.

should I add that code or replace the spacer_closed and space_open with the code?

Here's what I use:
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
<div style="padding:6px 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">

<!-- ad code goes here -->

</td>
</tr>
</table>
</div>
</if>

almukmin
08-20-2006, 04:31 PM
Please read my previous post a page ago.

jklimczak
10-05-2006, 11:10 AM
can some one help me fix my code I keep geting No post after i add this

if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
<div style="padding:0px 0px $stylevar[cellpadding]px 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">

<!-- BEGIN ADVERTPRO CODE BLOCK -->

<SCRIPT language="JavaScript" type="text/javascript">
document.write('<SCR'+'IPT src="http://216.27.135.253:8080/advertpro/servlet/view/banner/javascript/zone?zid=7&pid=4&random='+Math.floor(89999999*Math.random()+1000000 0)+'&millis=' +new Date().getTime()+'" language="JavaScript" type="text/javascript"></SCR'+'IPT>');
</SCRIPT>
<NOSCRIPT>
<A href="http://216.27.135.253:8080/advertpro/servlet/click/zone?zid=7&pid=4&lookup=true&position=1" target="_top">
<IMG src="http://216.27.135.253:8080/advertpro/servlet/view/banner/image/zone?zid=7&pid=4&position=1" height="60" width="468" hspace="0" vspace="0" border="0" alt="Click Here!">
</A>
</NOSCRIPT>

<!-- END ADVERTPRO CODE BLOCK -->

</td>
</tr>
</table>
</div>
</if>

curriertech
10-05-2006, 01:49 PM
Installed and working on 3.6.2! I made one small change, being that it only shows the random ads for guests. :)

andewy3k
10-15-2006, 07:03 AM
works great, thanks

just had to remove the spacer stuff for 3.6 and add the new div tag.

thanks again...

*installed*

Domenico
10-31-2006, 08:47 PM
Removing spacer_closed and space_open and changing the div to <div style="padding:$stylevar[cellpadding]px 0px 0px 0px"> or <div style="padding:6px 0px 0px 0px"> doesn't work for me.

See -> http://www.webhostingtalk.nl/webhosting-forum/106302-directe-links-en-google-spiders-bots.html

Any ideas?

ThorstenA
12-05-2006, 09:51 PM
What about:
Show Adsense in (or under, above) first unread Post of a Thread.
I think this is the place that would get the most user attention?

That's a nice idea. I also tried to find a solution for that. For what variable should I search for?

UK Jimbo
01-16-2007, 05:36 PM
That's a nice idea. I also tried to find a solution for that. For what variable should I search for?

We tried this but after a week of research putting it there and a week of placing it randomly between the postbits we found that we got a better CTR from the randomly positioned one.

I'd urge you to do some similar research on your site to see if the same's true.

Putting the adsense after the first post would just require a template change.

jw00dy
01-17-2007, 03:09 AM
Thanks, for this. Install was a snap

Installed.

ThorstenA
01-17-2007, 08:56 AM
We tried this but after a week of research putting it there and a week of placing it randomly between the postbits we found that we got a better CTR from the randomly positioned one.

I'd urge you to do some similar research on your site to see if the same's true.

Putting the adsense after the first post would just require a template change.

I'd think that your research would be very interesting for so much people here, I would be glad to hear more about what you tried and what you think is more successfull. Do you also put adsense for registered users on showthread? How do your link units work out? I was f.e. never sure, if my link units hurt my forum more than they earn money.

Installed.

ThorstenA
01-19-2007, 04:26 PM
After playing some days, for me placement after #1 posts works better for me than random placements.

azn_romeo_4u
01-19-2007, 09:38 PM
I might be doing this wrong but it doesn't work for my 3.64 version

ThorstenA
01-20-2007, 08:08 AM
I might be doing this wrong but it doesn't work for my 3.64 version

Place code after postbit or postbit_legacy tamplate.

Stoneyreef
01-22-2007, 02:22 AM
This is my code, not only do you get a google ad in there, but you can also direct your users to sign up for a paid subscription!






<!-- / random ad code, in to add usergroups add numbers to array(1) -->
<if condition="is_member_of($bbuserinfo,array(1,2,6))">
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 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">

<!-- ad code goes here -->
</script>
<p><center>Would you like to get rid of these ads?&nbsp; Then purchase a higher level of
membership!&nbsp; Click <b><font size="4">
<a href="http://www.yourwebsite.com/forum/payments.php">here</a></font></b>
to find a membership that will work for you!</center></p>

</td>
</tr>
</table>

</div>
$spacer_close
</if>
</if>

wtrk
02-06-2007, 01:36 AM
it works fine randomly, it works fine to display after the first post, but if i wanted it display after the first unread post what do i need to change? thanks!

Cicada
10-02-2013, 09:13 PM
would this work in vb4?