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)
-   -   BLS - Google Adsense Color for Multiple Styles (https://vborg.vbsupport.ru/showthread.php?t=112226)

Bolas 04-04-2006 10:00 PM

BLS - Google Adsense Color for Multiple Styles
 
Hi Ya!

What appens if you got lot of styles and you need to put a Google Adsense banner with specified color/background-color for each else?
You have to put the code in every style, with the opportune change of color in the code.

This product will save you from that!

live examples with different styles:
http://www.wellage.net/showthread.php?t=18948
http://www.wellage.net/showthread.ph...948&styleid=57
http://www.wellage.net/showthread.ph...948&styleid=54
http://www.wellage.net/showthread.ph...948&styleid=59
http://www.wellage.net/showthread.ph...948&styleid=17

1) Install the product
2) Use this code to put the banner (THIS IS ONLY AN EXAMPLE!!! YOU HAVE TO EDIT YOUR GOOGLE ADSENSE CODE WITH THE RIGHT DATA!!! USE ONLY THE GREEN LINES!!!)

Code:

<script type="text/javascript"><!--
google_ad_client = "pub-2120333334261222-EDIT-THIS";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="0691023760";

google_color_border = "$google_color_border";
google_color_bg = "$google_color_bg";
google_color_link = "$google_color_link";
google_color_url = "$google_color_url";
google_color_text = "$google_color_text";

//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

If you want to change color solutions, edit mine GoogleAdsenseColorProduct.xml and try using the following color variables. Then import it again overwriting the old version.

PHP Code:

   $stylevar["body_fgcolor"]
  
$stylevar["page_bgcolor"]
  
$stylevar["page_fgcolor"]
  
$stylevar["tborder_bgcolor"]
  
$stylevar["tborder_fgcolor"]
  
$stylevar["tcat_bgcolor"]
  
$stylevar["tcat_fgcolor"]
  
$stylevar["thead_bgcolor"]
  
$stylevar["thead_fgcolor"]
  
$stylevar["tfoot_bgcolor"]
  
$stylevar["tfoot_fgcolor"]
  
$stylevar["alt1_bgcolor"]
  
$stylevar["alt1_fgcolor"]
  
$stylevar["alt2_bgcolor"]
  
$stylevar["alt2_fgcolor"]
  
$stylevar["td.inlinemod_bgcolor"]
  
$stylevar["td.inlinemod_fgcolor"]
  
$stylevar["wysiwyg_bgcolor"]
  
$stylevar["wysiwyg_fgcolor"]
  
$stylevar["time_fgcolor"]
  
$stylevar["highlight_fgcolor"]
  
$stylevar["fjsel_bgcolor"]
  
$stylevar["fjsel_fgcolor"]
  
$stylevar["fjdpth0_bgcolor"]
  
$stylevar["fjdpth0_fgcolor"]
  
$stylevar["panel_bgcolor"]
  
$stylevar["panel_fgcolor"]
  
$stylevar["panelsurround_bgcolor"]
  
$stylevar["panelsurround_fgcolor"]
  
$stylevar["legend_fgcolor"]
  
$stylevar["vbmenu_control_bgcolor"]
  
$stylevar["vbmenu_control_fgcolor"]
  
$stylevar["vbmenu_popup_bgcolor"]
  
$stylevar["vbmenu_popup_fgcolor"]
  
$stylevar["vbmenu_option_bgcolor"]
  
$stylevar["vbmenu_option_fgcolor"]
  
$stylevar["vbmenu_hilite_bgcolor"]
  
$stylevar["vbmenu_hilite_fgcolor"]
  
$stylevar["outerdivwidth"]
  
$stylevar["divwidth"

IMPORTANT! READ THIS! USING THIS PLUGIN WILL BREAK ADSENSE TOS, so use it at your own risk. I will not assume any responsability about your use of this plugin.
The code generated is LIKE an original GOOGLE ADSENSE, but the TOS DENY ANY CHANGE on it using the google adsense control panel.
Quote:

Originally Posted by rrr
The adsense TOS says that you cannot modify the code they generate for you in any way.

You're right though, it will probably look and function the same and it would probably go unnoticed (unless something broke). But it is against the adsense TOS.

This was clarified a few times on another forum by a Google employee.


D|ver 04-05-2006 03:13 PM

great product :)
that is what i really need :D

joeychgo 04-05-2006 03:34 PM

Nice hack. One question, did you check with Adsense to make sure this doesnt break their TOS? They can get a little funny when people add to their code.

The Chief 04-05-2006 04:05 PM

screens or demo?

ConqSoft 04-05-2006 04:07 PM

I just use Style Replacement Variables for each color. Works very well, and is already built into vB.

SIINSI 04-05-2006 10:26 PM

I'd like to hear if this breaks TOS...

ConqSoft 04-05-2006 10:29 PM

How is it breaking the TOS? You are allowed to change the colors. When the page is processed, the code looks exactly like any other adsense code.


Here's what I use:
Code:

<script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXXXXXX";

google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="0719787053";
google_color_border = "{adsense_color_border}";
google_color_bg = "{adsense_color_bg}";
google_color_link = "{adsense_color_link}";
google_color_url = "{adsense_color_url}";
google_color_text = "{adsense_color_text}";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Then just create replacement variables on each style using the names above, and you're done.

Bolas 04-05-2006 11:01 PM

it's the same, using replacement or a plugin.
I decided to use plugin because this is my first one and it's only an exercise for me. Just an easy script to test how vbulletin plugins works.

Replacements are a cleaner way to do the same thing, I suggest to use ConqSoft, but...
...I don't want to create replacements for every style I have, so using my plugin you can recycle the color you used in other part of your layout (for every style)




TOS? Only if you modify the output code, but if you print your final output all is as Google designed! :)

Bolas 04-05-2006 11:07 PM

Quote:

Originally Posted by The Chief
screens or demo?

Read my first post: you can found links for the same thread in my forum with different styles. This is the live demo.

ConqSoft 04-05-2006 11:11 PM

If you have a main style, and all your other styles as children under that, you only have to set the replacement variables in the "main" style, then only change the ones you need to change for each child style.


All times are GMT. The time now is 12:16 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.01140 seconds
  • Memory Usage 1,755KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)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
  • (10)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