vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Make your adsense look like a post! With Referals, forum exclusion and more! (https://vborg.vbsupport.ru/showthread.php?t=122010)

question? 07-23-2006 10:00 PM

Make your adsense look like a post! With Referals, forum exclusion and more!
 
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])">

question? 07-24-2006 08:38 PM

Please make sure you change your adsense ID where it tells you to!

Please note: I reccomend you put it at the end. In some cases, the quick reply after the adsense code may not work.

unitedpunjab 07-24-2006 11:12 PM

installed..working great

question? 07-25-2006 09:08 AM

Hey,

Thanks for the install. If you want, i can give you those random picture blocks. They increase your page CTR by 30-40% i've been told.

unitedpunjab 07-25-2006 09:55 AM

yes please,that would be great

question? 07-25-2006 10:11 AM

Hey,

I've added them. I've only added the .gifs as those were transparent. You can add more. And remember to edit the random.php.

unitedpunjab 07-25-2006 10:19 AM

where is random.php

unitedpunjab 07-25-2006 10:20 AM

got it,but what to add in the above code ?

question? 07-25-2006 10:32 AM

just use somthing like
<table align="left"><tr><td align="left"><img src="path/to/random.php"></td><td align="left">ADSENSECODE HERE</td></tr></table>

Snake 07-25-2006 11:26 AM

Thank you, works great! :)

Thomas P 07-25-2006 12:20 PM

Thanks, that is pretty neat :cool:

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

Thomas P 07-25-2006 01:29 PM

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

question? 07-25-2006 02:00 PM

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 :)

Kaleem 07-25-2006 04:12 PM

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

Thomas P 07-25-2006 06:57 PM

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?? :confused:

What is different on my account?

icemanic 07-25-2006 08:10 PM

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

question? 07-25-2006 08:55 PM

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?? :confused:

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.

Rich 07-25-2006 09:23 PM

Unless I am mistaken, this modification would violate Googles TOS.

question? 07-25-2006 09:32 PM

Quote:

Originally Posted by Rich
Unless I am mistaken, this modification would violate Googles TOS.

How would it violate google's TOS?

FocusTom 07-26-2006 01:10 AM

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.

icemanic 07-26-2006 02:06 AM

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

icemanic 07-26-2006 02:41 AM

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?

question? 07-26-2006 06:21 AM

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.

icemanic 07-26-2006 06:29 AM

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

question? 07-26-2006 06:32 AM

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.

GrendelKhan{TSU 07-26-2006 07:40 AM

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.

Dumi 07-26-2006 08:11 AM

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

Thomas P 07-26-2006 08:51 AM

@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

question? 07-28-2006 11:34 AM

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?

ldma 07-31-2006 03:46 AM

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?

question? 07-31-2006 12:45 PM

It should already do that.

ryans 08-02-2006 06:01 PM

how can we have it show as the 2nd post on all pages?

dacho 08-02-2006 07:58 PM

question? you can help me please ?
it's not working for me

if you can geav me the code to do a copy
i work with postbit

after 4 post
in all the forums

ldma 08-10-2006 02:49 AM

Does this code work on 3.6? Before I go charging into things......

tweakmonkey 08-24-2006 11:19 AM

Great mod, quick to install and works flawlessly.

question? 10-01-2006 05:53 PM

Quote:

Originally Posted by ldma
Does this code work on 3.6? Before I go charging into things......

I'll check now. I'm going to try it.

gunitman247 10-03-2006 05:52 PM

Hi awesome hack. it is showing up after the last post on every page. is there a way i can make it after the first post?

newmomsforum 10-05-2006 09:58 AM

Quote:

Originally Posted by gunitman247
Hi awesome hack. it is showing up after the last post on every page. is there a way i can make it after the first post?

In the instructions mate:

Quote:

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.

gunitman247 10-09-2006 01:42 PM

Quote:

Originally Posted by newmomsforum
In the instructions mate:

Ya dont i feel like a blub i saw it after awhile. anywho is there any way i can make this work with YPN?

gunitman247 10-12-2006 01:24 AM

anywho will this work with YPN?


All times are GMT. The time now is 05:20 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01575 seconds
  • Memory Usage 1,848KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_code_printable
  • (2)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete