Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Make your adsense look like a post! With Referals, forum exclusion and more! Details »»
Make your adsense look like a post! With Referals, forum exclusion and more!
Version: 4, by question? question? is offline
Developer Last Online: Aug 2008 Show Printable Version Email this Page

Version: 3.5.5 Rating:
Released: 07-23-2006 Last Update: 07-24-2006 Installs: 34
Template Edits
 
No support by the author.

Hey,

This will let you show your add after x posts, put a referal box as a false avatar, and show a 336x280 banner.

Please note this has been made for my skin (legacy). You will have to alter this i think.


Add this at the end of your postbit template:
Code:
<!-- START ADSENSE REVENUE -->
<if condition="THIS_SCRIPT == 'showthread'AND ($post[postid] == $GLOBALS['qrlastpostid']) AND (!in_array($forum[forumid], array(2,3,32)))">

    $spacer_open

<table id="post$post[postid]" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center">
<tr valign="top">
    <td class="alt2" width="175">
            
            <div id="postmenu_$post[postid]">
                <if condition="$show['profile']">
                <a class="bigusername" href="#">Focused.ORG</a>
                <else />
                Focused.ORG
                </if>
                <br><br><script type="text/javascript"><!--
google_ad_client = "YOUR ADSENSE ID HERE!";
google_ad_width = 125;
google_ad_height = 125;
google_ad_format = "125x125_as_rimg";
google_cpa_choice = "CAAQ8OCIlAIaCP1TkEVpn_IYKITHrYMB";
google_ad_channel = "";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
            </div>
                
    </td>
    <if condition="$show['moderated']">
    <td class="alt2" id="">
    <else />
    <td class="alt1" id="">
    </if>
    
        <if condition="$show['messageicon'] OR $post['title']">
            <div class="smallfont">
                <if condition="$post['title']"><strong>Sponsored links</strong></if>
            </div>
            <hr size="1" style="color:$stylevar[tborder_bgcolor]" />
        </if>
        
        <!-- message -->
        <div id="post_message_$post[postid]">
<if condition="$show['spacer']">
</if>
    <div align="left">
<script type="text/javascript"><!--
google_ad_client = "YOUR ADSENSE ID GOES HERE!";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "D0DFE4";
google_color_bg = "E2ECEF";
google_color_link = "85868F";
google_color_text = "85868F";
google_color_url = "85868F";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

    </div>

<if condition="$show['spacer']">

</if>   

</div>
        <!-- / message -->
    
    </td>
</tr>
</table><br>
<!-- / post $post[postid] popup menu -->

<if condition="$show['spacer']">
    </div>
    $spacer_close
</if></if>
Let me explain how to use it:
<if condition="THIS_SCRIPT == 'showthread'AND ($post[postid] == $GLOBALS['qrlastpostid']) AND (!in_array($forum[forumid], array(2,3,32)))">

In the array() you put the forums where you don't want to show the ads.

Here (($post[postid] == $GLOBALS['qrlastpostid'])) you choose where to show it. Use $GLOBALS['qrlastpostid'] to show it at the end of all the posts, $GLOBALS['qrfirstpostid'] to show it after the first post, or you can use a number.

For the picture blocks use <img src="random.php"> to where ever random.php is. Please remember to update the settings for random.php.

I reccomend you use a table to put your ads in.

If you want to show the ads only where there is more than 1 post use:
Code:
AND ($post['postcount'] > 1)
Like this:
Code:
<if condition="THIS_SCRIPT == 'showthread'AND ($post[postid] == $GLOBALS['qrlastpostid']) AND (!in_array($forum[forumid], array(2,3,32))) AND ($post['postcount'] > 1)">
If you want it to show to guests only use:
Code:
AND (!$show[member])
So it will be like:
Code:
<if condition="THIS_SCRIPT == 'showthread'AND ($post[postid] == $GLOBALS['qrlastpostid']) AND (!in_array($forum[forumid], array(2,3,32))) AND ($post['postcount'] > 1) AND (!$show[member])">

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 07-26-2006, 02:06 AM
icemanic icemanic is offline
 
Join Date: Jun 2006
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if i stick a number like

<if condition="THIS_SCRIPT == 'showthread'AND ($post[postid] == 5) AND (!in_array($forum[forumid], array(2,3,32)))">

will it show the ads after every 5 posts?? if not, how do i make it do that? repetetive
Reply With Quote
  #23  
Old 07-26-2006, 02:41 AM
icemanic icemanic is offline
 
Join Date: Jun 2006
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i have lots of forum areas, is there a way to do this so i can only show it to one forum area without listing all the other forum ids in the array?
Reply With Quote
  #24  
Old 07-26-2006, 06:21 AM
question? question? is offline
 
Join Date: Oct 2004
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by icemanic
i have lots of forum areas, is there a way to do this so i can only show it to one forum area without listing all the other forum ids in the array?
Yeh.

Code:
<if condition="THIS_SCRIPT == 'showthread'AND ($post[postid] == 5) AND (in_array($forum[forumid] == forumid))">
Quote:
Originally Posted by icemanic
if i stick a number like

<if condition="THIS_SCRIPT == 'showthread'AND ($post[postid] == 5) AND (!in_array($forum[forumid], array(2,3,32)))">

will it show the ads after every 5 posts?? if not, how do i make it do that? repetetive
How many posts do you show per page? You would have to put it manually as an array like the forum id, without the !.

Remember google only allow 3 ads, so you might as well do it manually.
Reply With Quote
  #25  
Old 07-26-2006, 06:29 AM
icemanic icemanic is offline
 
Join Date: Jun 2006
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
AND ($post[postcount] % == 0
using this code will do what i want, show the ads after every 4 posts
, which should not be used for adsense , i might add because of TOS i believe
Reply With Quote
  #26  
Old 07-26-2006, 06:32 AM
question? question? is offline
 
Join Date: Oct 2004
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by icemanic
PHP Code:
AND ($post[postcount] % == 0
using this code will do what i want, show the ads after every 4 posts
, which should not be used for adsense , i might add because of TOS i believe
You can use it, as long as theres not more than 3 ads per page.
Reply With Quote
  #27  
Old 07-26-2006, 07:40 AM
GrendelKhan{TSU's Avatar
GrendelKhan{TSU GrendelKhan{TSU is offline
 
Join Date: Jun 2005
Location: Boston | Seoul, S. Korea
Posts: 1,311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by question?
How would it violate google's TOS?
actually it USED to (related to dynamically created pages). but Google has softened their policies...seems fine now:

Google Ad Placement
  • Up to three ad units may be displayed on each Web site page.
  • A maximum of two Google AdSense for search boxes may be placed on a page.
  • A single link unit may be placed on each Web site page, in addition to the ad units and search boxes specified above. Link units are considered to be 'Google ads' for purposes of these program policies.
  • A single referral button per product may be placed on a page up to a maximum of 4 buttons, in addition to the ad units, search boxes, and link units specified above. Referral buttons are considered to be ?Google ads? for purposes of these program policies.
  • No Google ad may be placed on any non-content-based pages.
  • No Google ad or Google search box may be displayed on any domain parking websites, pop-ups, pop-unders, or in any email.
  • No Google ad may be placed on pages published specifically for the purpose of showing ads, whether or not the page content is relevant.
  • Elements on a page must not obscure any portion of the ads, and the ad colors must be such that any ad elements, including text and URL, are visible.
  • Clicks on Google ads must not result in a new browser window being launched.
Reply With Quote
  #28  
Old 07-26-2006, 08:11 AM
Dumi Dumi is offline
 
Join Date: Jun 2006
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there anyway to have this code show like ever 3rd post or something like that. Awesome code, this has been the only adsense code ive gotten to work.

Nick
Reply With Quote
  #29  
Old 07-26-2006, 08:51 AM
Thomas P's Avatar
Thomas P Thomas P is offline
 
Join Date: Oct 2001
Location: Munich, DE
Posts: 365
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@Dumi: add this to the line beginning with <if condition="THIS_SCRIPT == 'showthread' :

AND ($post[postcount] % 3 == 0)

@question?:
I think I got it, all users who don't see the adcode have to delete their cookies once, after that the adcode shows up.

/edit: I guess I'm going for this option here: http://www.vbulletin.com/forum/showp...82&postcount=3
Reply With Quote
  #30  
Old 07-28-2006, 11:34 AM
question? question? is offline
 
Join Date: Oct 2004
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Thomas P
@Dumi: add this to the line beginning with <if condition="THIS_SCRIPT == 'showthread' :

AND ($post[postcount] % 3 == 0)

@question?:
I think I got it, all users who don't see the adcode have to delete their cookies once, after that the adcode shows up.

/edit: I guess I'm going for this option here: http://www.vbulletin.com/forum/showp...82&postcount=3
Why do all the users have to delete their cookies?
Reply With Quote
  #31  
Old 07-31-2006, 03:46 AM
ldma ldma is offline
 
Join Date: Jul 2006
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How can I get it to show ads after the first post on every page of my thread, not just the first page like at present?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:50 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05375 seconds
  • Memory Usage 2,321KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (2)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete