PDA

View Full Version : Adsense in last thread of search results


AWI
18 Dec 2005, 20:51
I saw some people asking for this so here it is...quick and painless.

In template search_results find:
<if condition="$show['ajax_js']">
<script type="text/javascript" src="clientscript/vbulletin_ajax_threadslist.js"></script>
<script type="text/javascript">
<!--
vB_AJAX_Threadlist_Init('threadslist');
//-->
</script>
</if>

</if>


Add below
<if condition="is_member_of($bbuserinfo, 1,2)">
<tr>
<td height="60" class="alt1">
<img src="$stylevar[imgdir_statusicon]/image.gif" alt="" border="" /> </td>
<td height="60" align="center" class="alt2">&nbsp;</td>

<td height="60" align="center" class="alt1">
<div>
**YOUR ADSENSE CODE HERE**
</div>
</td>

<td height="60" align="center" class="alt2 smallfont">Sponsored Link</td>

<td height="60" align="center" class="alt1"></td>
<td height="60" align="center" class="alt2"></td>
<if condition="$show['inlinemod']"><td height="60" align="center" class="alt1"></td>
</if>

</tr>
</if>


Change this line to set usergroup permission
<if condition="is_member_of($bbuserinfo, 1,2)">

AWI
18 Dec 2005, 20:53
Screenshot:

http://www.dntycoon.com/images/capture.jpg

ugmphelon
18 Dec 2005, 22:47
installed

Neutral Singh
19 Dec 2005, 05:29
Thanks for this!! How if i would like to have this as the first result in the search results? Thanks in advance.

Neutral Singh
19 Dec 2005, 05:55
Edit: Nevemind did that myself. Thanks for a nice addon.

Cebby
19 Dec 2005, 21:19
If I want everyone to get the ad at the end of the search results, do I need the user group permission line at all?

AWI
19 Dec 2005, 23:07
If I want everyone to get the ad at the end of the search results, do I need the user group permission line at all?


No just get rid of the code
<if condition="is_member_of($bbuserinfo, 1,2)">
</if>

Cebby
20 Dec 2005, 03:53
No just get rid of the code
<if condition="is_member_of($bbuserinfo, 1,2)">
</if>

Thanks!! *Installed*

murrtex
19 Jan 2006, 01:38
nice,and you should add this;(bold)

<td height="60" align="center" class="alt1"></td>
<td height="60" align="center" class="alt2"></td>
<td height="60" align="center" class="alt1"></td>
<if condition="$show['inlinemod']"><td height="60" align="center" class="alt1"></td>
</if>

MentaL
19 Jan 2006, 03:35
Fanstatic INSTALLED (http://forum.ragezone.com)

Kwak
19 Jan 2006, 05:44
Thanks for the mod.

Installing but I have no idea why the template page 'hands' (Loading...) when I add the content and try to save.

Kwak
20 Jan 2006, 19:58
Fixed the problem. Great template hack. Installing but I have no idea why the template page 'hands' (Loading...) when I add the content and try to save.

lazytown
29 Jan 2006, 10:23
Will this actually pull up proper adsense ads relavent to the search results? I thought adsense needed fairly static content to gather information for ads.

-vissa

Black_Widow
03 Feb 2006, 02:17
Mhm are you sure that this hack don't violate Adsense policy?
I'm fear to be banned for this.
Users could become confused and click on adsense links thinking they are regular forum results. Of course this would probably be unuseful click for the publisher.

dinodonk
03 Jun 2006, 03:54
installed...
but your hack use wrong template when showing search result as post.
could you please fix it?

yoyoyoyo
18 Sep 2007, 17:49
I don't see any ad in the last search result - just a blank box with no ad and the "sponsored links" text next to it.

in template search_results I looked for:


<if condition="$show['ajax_js']">
<script type="text/javascript" src="clientscript/vbulletin_ajax_threadslist.js"></script>
<script type="text/javascript">
<!--
vB_AJAX_Threadlist_Init('threadslist');
//-->
</script>
</if>

</if>This is the code I added after that code:

<if condition="is_member_of($bbuserinfo, 1,2)">
<tr>
<td height="60" class="alt1">
<img src="$stylevar[imgdir_statusicon]/image.gif" alt="" border="" /> </td>
<td height="60" align="center" class="alt2">&nbsp;</td>

<td height="60" align="center" class="alt1">
<div>
<script type="text/javascript"><!--
google_ad_client = "pub-3279101748510677";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
//2007-09-18: http://mysite.com/, http://mysite.com/forum/
google_ad_channel = "9873387342+5679035227";
google_color_border = "CCCCCC";
google_color_bg = "CCCCCC";
google_color_link = "000000";
google_color_text = "333333";
google_color_url = "666666";
google_ui_features = "rc:6";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</td>

<td height="60" align="center" class="alt2 smallfont">Sponsored Link</td>

<td height="60" align="center" class="alt1"></td>
<td height="60" align="center" class="alt2"></td>
<td height="60" align="center" class="alt1"></td>
<if condition="$show['inlinemod']"><td height="60" align="center" class="alt1"></td>
</if>

</tr>
</if>any idea why the ads aren't showing? I am using 3.6.8, but that shouldn't rally make a difference in this mod I don't think

fishmaster
06 Oct 2007, 16:23
Did you ever get this debugged, what was the root cause for it not displaying Adsense?

One of the Posters feared it violated Google Adsense rules, do you think it does, or does not?