Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

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
  #12  
Old 07-25-2006, 12:20 PM
Thomas P's Avatar
Thomas P Thomas P is offline
 
Join Date: Oct 2001
Location: Munich, DE
Posts: 365
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, that is pretty neat

One question, I use:
Code:
<if condition="THIS_SCRIPT == 'showthread'AND ($post[postid] == $GLOBALS['qrlastpostid'])">
and noticed that if someone is logged in the adcode only shows up at the end of a thread on the last page.
If viewed as a guest, the adcode shows up on every page at the end.

Any hints why it is this way and how to change it for loggend in users, too?

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

Second: Is there any way to show that adcode only if there is more than one post in a thread?

/update: Got it, just changed the conditional to

Code:
<if condition="THIS_SCRIPT == 'showthread' AND ($post[postid] == $GLOBALS['qrlastpostid']) AND ($post['postcount'] > 1)">
which works great.

So just the one question is still open, see a.m.: https://vborg.vbsupport.ru/showpost....4&postcount=11

Thanks,
-Tom
Reply With Quote
  #14  
Old 07-25-2006, 02:00 PM
question? question? is offline
 
Join Date: Oct 2004
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Thomas P
Second: Is there any way to show that adcode only if there is more than one post in a thread?

/update: Got it, just changed the conditional to

Code:
<if condition="THIS_SCRIPT == 'showthread' AND ($post[postid] == $GLOBALS['qrlastpostid']) AND ($post['postcount'] > 1)">
which works great.

So just the one question is still open, see a.m.: https://vborg.vbsupport.ru/showpost....4&postcount=11

Thanks,
-Tom
Thanks for that I will add it to thet update.

I signed up to your forum, and it shows at the end of every page. Not just at the end of threads. As guest it worked the same as well
Reply With Quote
  #15  
Old 07-25-2006, 04:12 PM
Kaleem's Avatar
Kaleem Kaleem is offline
 
Join Date: May 2006
Location: New Jersey
Posts: 324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ritenow u have this in array array(2,3,32) so it means in forums 2,3,32 ads will not show rite ?

after saving got this

Parse error: syntax error, unexpected T_VARIABLE in /home/.******/****/friendskorner.com/forum/includes/adminfunctions_template.php(3537) : eval()'d code on line 249
Reply With Quote
  #16  
Old 07-25-2006, 06:57 PM
Thomas P's Avatar
Thomas P Thomas P is offline
 
Join Date: Oct 2001
Location: Munich, DE
Posts: 365
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by question?
I signed up to your forum, and it shows at the end of every page. Not just at the end of threads. As guest it worked the same as well
Thanks for taking the time to test this :up:

This is very confusing. The adcode shows up when using a test user account (normal member).
But using my account it only shows up at the very end of a thread??

What is different on my account?
Reply With Quote
  #17  
Old 07-25-2006, 08:10 PM
icemanic icemanic is offline
 
Join Date: Jun 2006
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how do you show this to only certain usergroups as well ? i want to only show for guests and for regular registered members, but not for a certain usergroup
Reply With Quote
  #18  
Old 07-25-2006, 08:55 PM
question? question? is offline
 
Join Date: Oct 2004
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Thomas P
Thanks for taking the time to test this :up:

This is very confusing. The adcode shows up when using a test user account (normal member).
But using my account it only shows up at the very end of a thread??

What is different on my account?
Hmm, i'm not sure why. It may be a version difference or somthing. you shouldn't worry tho, it's getting to the other people in your forum.

Quote:
Originally Posted by icemanic
how do you show this to only certain usergroups as well ? i want to only show for guests and for regular registered members, but not for a certain usergroup
AND (!$show[member])

Quote:
Originally Posted by LightInClouds
ritenow u have this in array array(2,3,32) so it means in forums 2,3,32 ads will not show rite ?

after saving got this

Parse error: syntax error, unexpected T_VARIABLE in /home/.******/****/friendskorner.com/forum/includes/adminfunctions_template.php(3537) : eval()'d code on line 249
If you see, that's not the file for the addon thing. And yes, you are right, forums 2,3,32 will not show the ads.
Reply With Quote
  #19  
Old 07-25-2006, 09:23 PM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Unless I am mistaken, this modification would violate Googles TOS.
Reply With Quote
  #20  
Old 07-25-2006, 09:32 PM
question? question? is offline
 
Join Date: Oct 2004
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Rich
Unless I am mistaken, this modification would violate Googles TOS.
How would it violate google's TOS?
Reply With Quote
  #21  
Old 07-26-2006, 01:10 AM
FocusTom FocusTom is offline
 
Join Date: Jul 2006
Location: England
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I do not see how this modification could possibly violate the policies set by Google's TOS. This mod does not go over the amount of ad units which are allowed as per their guidelines.

The only constraint is that the site must have content, which evidently it will as it is a forum. Please explain why you think it would violate the policies.
Reply With Quote
Reply


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 09:31 PM.


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.05093 seconds
  • Memory Usage 2,324KB
  • 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
  • (8)bbcode_code
  • (6)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
  • (3)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