| Author |
Message |
luchtzak
Support Mod


Joined: Mar 19, 2003
Posts: 308
|
Posted:
Tue Sep 20, 2005 5:29 am |
  |
|
    |
 |
ishtar
Sergeant


Joined: Jun 19, 2005
Posts: 96
Location: Suriname
|
Posted:
Thu Sep 22, 2005 9:24 am |
  |
|
    |
 |
luchtzak
Support Mod


Joined: Mar 19, 2003
Posts: 308
|
Posted:
Fri Sep 23, 2005 1:56 am |
  |
I just checked the sourcecode of your website but no sign of Google Adsense code.... You should re-upload your changed file and try again. |
_________________ Luchtzak Aviation - Snookerforum Belgium |
|
    |
 |
frankie_32
Nuke Cadet


Joined: Jul 27, 2004
Posts: 1
|
Posted:
Thu Sep 29, 2005 1:03 pm |
  |
I am running several themes as well, the way I coded my side block
was like this:
| Code: |
<?php
if (eregi("block-googleads.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$ThemeSel = get_theme();
include("themes/$ThemeSel/adsense.js");
$content .= "<center><script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">";
$content .= "</script></center>";
?>
|
Then in each html/themes/named_theme I added a file 'adsense.js'
with your sites adsense code to match theme colors eg:
| Code: |
<script type="text/javascript">
<!--
google_ad_client = "pub-aaaaaaaaaaaaaaaa";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_type = "text_image";
google_color_border = "f6f6eb";
google_color_bg = "d8d8c4";
google_color_link = "000000";
google_color_url = "666666";
google_color_text = "333333";
// -->
</script>
|
This way you don't have escape any of the adsense code.
Hope this can help someone.
| dilligaf wrote: |
I'm adding just a little update to this code.
If you are like me and have different themes for your site, especially themes that vary in colour, and your Adsense banner looks OK in one theme but crap in the others, I have come up with a solution!!
By simply using the bgcolor of the theme it will now change the colour of your Adsense banner.
Another thing you can do is to make a new file in your root-folder called googleads.php with this in it:
then in the module you like behind:
include("header.php");
add
include("googleads.php"); |
Just add two new lines to your code and change two other lines (plus all the php echo's)
| Code: |
<?php
global $bgcolor3, $bgcolor1;
$bgcolour3 = substr(strrchr($bgcolor3,"#"),1);
$bgcolour1 = substr(strrchr($bgcolor1,'#'),1);
echo "<center><script type=\"text/javascript\"><!--\n"
."google_ad_client = \"pub-your_adsense_number\";\n"
."google_ad_width = 468;\n"
."google_ad_height = 60;\n"
."google_ad_format = \"468x60_as\";\n"
."google_ad_type = \"text_image\";\n"
."google_color_border = \"$bgcolour3\";\n"
."google_color_bg = \"$bgcolour1\";\n"
."google_color_link = \"336699\";\n"
."google_color_url = \"000000\";\n"
."google_color_text = \"000000\";\n"
."//--></script>\n"
."<script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">\n"
."</script></center>";
?> |
Obviously width, height, format, type and channel are left up to your own preferences as the code above has mine.
Now I hear you say "Why don't you just add $bgcolor1 instead of changing it?"
Well Adsense colours do not like the '#' in front of them so we have to strip them out.
Now one could go a step further and replace the link, url and text colours to if they want to but this was enough for my liking.
Now when anyone changes the theme, the Adsense banner will match.
And remember the '<?" and '?>' at the top and bottom. Since we are using php variables this code now has to be written in php.
Anyhow let me know if you like/dislike.[/quote] |
|
|
    |
 |
luchtzak
Support Mod


Joined: Mar 19, 2003
Posts: 308
|
Posted:
Fri Sep 30, 2005 12:58 am |
  |
|
    |
 |
Hadriel
Nuke Cadet


Joined: Dec 31, 2004
Posts: 2
|
Posted:
Tue Oct 11, 2005 9:09 pm |
  |
Has anyone figured out how to make a block with 2 of the sqaures side by side?
Some blogs have it when you read their articles, just was curious if anyone has done that yet.
Thanks |
|
|
   |
 |
Patro
Corporal


Joined: May 26, 2005
Posts: 69
Location: Singapore
|
Posted:
Thu Nov 03, 2005 4:21 am |
  |
I'm having a hard time just figuring out how to get ads on my site.
The instructions in the first post aren't clear to me at all.
After reading other posts, what I have done is downloaded a txt file called "block-googleads120by600". It looks like this:
<?php
if (eregi("block-googleads120by600.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
?>
<script language="JavaScript">
<!--
google_ad_client = 'pub-NUMBER HERE';
google_alternate_ad_url = "http://www.nukebling.com/google/120600.php";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = '120X600_as';
google_ad_channel ="";
google_page_url = document.location;
google_color_border = "660000";
google_color_bg = "7D2626";
google_color_link = "FFFFFF";
google_color_url = "DAA520";
google_color_text = "BDB76B";
// -->
</script>
Then I uploaded this file to my 'includes' folder. So far is this correct? What do I do next? I only have one theme.
Thanks. |
_________________ Everybody has their own agenda. |
|
   |
 |
webshark
Sergeant


Joined: Apr 21, 2005
Posts: 106
|
Posted:
Thu Nov 03, 2005 6:48 am |
  |
just save it as block-googleads120by600.php in your blocks folder
make the adjustments your pub icolours etc.
upload it to your host
than login your admin panel / blocks and chose it from drop down box and activate your block |
_________________
 |
|
    |
 |
Evaders99
Site Admin


Joined: Aug 17, 2003
Posts: 12373
|
Posted:
Thu Nov 03, 2005 2:32 pm |
  |
|
     |
 |
Patro
Corporal


Joined: May 26, 2005
Posts: 69
Location: Singapore
|
Posted:
Wed Nov 09, 2005 3:11 am |
  |
Evaders, can you paste the block I need to use here? And tell me where to upload it...thanks. |
_________________ Everybody has their own agenda. |
|
   |
 |
jasvanth
Nuke Soldier


Joined: Jan 27, 2006
Posts: 14
|
Posted:
Sat Jun 10, 2006 5:14 pm |
  |
any chance you guys can do something like thjis forclicksor. btw how do i add it in the footer through phpmyadmin, im lost here |
|
|
   |
 |
|
|