| Author |
Message |
luchtzak
Support Mod


Joined: Mar 19, 2003
Posts: 308
|
Posted:
Thu Jun 03, 2004 12:45 am |
  |
|
    |
 |
luchtzak
Support Mod


Joined: Mar 19, 2003
Posts: 308
|
Posted:
Thu Jun 03, 2004 12:47 am |
  |
| GiZiM wrote: |
| Do i need to manually change the header.php file? |
Another thing you can do is to make a new file in your root-folder called googleads.php with this in it:
| Code: |
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-xxxx";
google_alternate_ad_url = "http://www.luchtzak.be/banners.php";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "336699";
google_color_url = "000000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center> |
then in the module you like behind:
include("header.php");
add
include("googleads.php"); |
_________________ Luchtzak Aviation - Snookerforum Belgium |
|
    |
 |
Imago
Captain


Joined: Jan 17, 2003
Posts: 629
Location: Europe
|
Posted:
Thu Jun 03, 2004 2:51 am |
  |
| Quote: |
| Do i need to manually change the header.php file? |
You don't need to. Add the code either to header.html or to theme.php
before the <tr> for the $public_msg
and you will get what you'll see if you visit the www.vdsp.net |
|
|
    |
 |
GiZiM
Corporal


Joined: May 21, 2004
Posts: 52
|
Posted:
Thu Jun 03, 2004 7:30 am |
  |
| Imago wrote: |
| Quote: |
| Do i need to manually change the header.php file? |
You don't need to. Add the code either to header.html or to theme.php
before the <tr> for the $public_msg
and you will get what you'll see if you visit the www.vdsp.net |
ah ok so i add the code above ah ok thanks |
|
|
   |
 |
stinger123
Nuke Cadet


Joined: Jun 12, 2004
Posts: 1
|
Posted:
Sat Jun 12, 2004 11:09 am |
  |
Hi
Being a new phpnuke user and only being able to edit simple phpnuke documents (still learning)
Ive just started a review website - and noticed alot of sites have Google AdSense on them. I signed up and recieved my confirmation email. I have created the block & its now showing on my site - but i have a few questions/probs:
1 when editing the settings of my adsense (colour/size etc) i chose a 120x600 banner and chose to have text ads only (i wanted text ads only basically because i have enough images on my website) - i also chose to have 4 text ads showing in the block - but for some reason after creating the block i have a 120x600 sized image - which is showing an ad which is nothing at all to do with the content of my site (think its showing an ad about ppl with disabilities) - will the image change after a period of time to ads which i saved in my setting (4 text ads?)
Why isnt it showing ads that go along with the content of my site? (will this also be changed after a period of time?) any help would be much apreciated. |
|
|
   |
 |
telli
Support Mod


Joined: Aug 21, 2003
Posts: 335
|
Posted:
Sat Jun 12, 2004 12:01 pm |
  |
|
   |
 |
scz
Nuke Soldier


Joined: Apr 07, 2004
Posts: 27
|
Posted:
Sat Jul 17, 2004 5:42 am |
  |
|
    |
 |
dilligaf
Nuke Soldier


Joined: Mar 31, 2004
Posts: 11
|
Posted:
Tue Jul 20, 2004 8:33 pm |
  |
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.
| luchtzak wrote: |
| GiZiM wrote: |
| Do i need to manually change the header.php file? |
Another thing you can do is to make a new file in your root-folder called googleads.php with this in it:
code removed
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. |
|
|
   |
 |
lost2
Sergeant


Joined: Nov 01, 2003
Posts: 136
Location: BANNED
|
Posted:
Fri Jul 23, 2004 10:01 pm |
  |
iono i never had a problem with it.. i either inserted the code directly in the database or i made a txt file with the code and then i placed a include("google_leader.txt"); line in the theme.php where i wanted it.. did it to the News module also..
what i wanted to know is if could be possible to throw in the google ads in rotation with the rest of the banners in the Banner Module
if anyone got any idea holla back on this one |
|
|
    |
 |
dilligaf
Nuke Soldier


Joined: Mar 31, 2004
Posts: 11
|
Posted:
Fri Jul 23, 2004 11:01 pm |
  |
As GiZiM stated, you must save the file as a php file not text so your file should be saved as google_leader.php and your include line should be include("google_leader.php"); |
|
|
   |
 |
lost2
Sergeant


Joined: Nov 01, 2003
Posts: 136
Location: BANNED
|
Posted:
Fri Jul 23, 2004 11:32 pm |
  |
why does it have to be php? it works fine as txt
thats not what i'm asking..
i would like to include google in rotation with the banner module ad clients
anyone know if this could be possible holla |
_________________ B4nN3d |
|
    |
 |
luchtzak
Support Mod


Joined: Mar 19, 2003
Posts: 308
|
Posted:
Sun Jul 25, 2004 2:07 pm |
  |
|
    |
 |
Dapunisher
Nuke Soldier


Joined: May 24, 2004
Posts: 11
|
Posted:
Mon Aug 23, 2004 6:46 pm |
  |
Thanks dilligaf for the code! It works AWESOME!!!!  |
_________________ FREE on-line certification study for CompTIA, Microsoft, Cisco & More! Practice Tests & Study Guides.
http://www.BestTests.com |
|
     |
 |
alinka
Sergeant


Joined: Jan 20, 2004
Posts: 80
|
Posted:
Mon Nov 29, 2004 5:02 am |
  |
I use phpbb forums. I have already created the googleads.php file and have been including it after include()headers as stated somewhere on these forums....
What I now want to learn how to do is how to include googleads into the actual text of each private message and each forum message. This would be similar to google's gmail - where you see targeted google adsense ads inside your emails based on the text of emails. Please help, anyone.
Thanks a bunch!! |
|
|
   |
 |
ldude69000
Nuke Soldier


Joined: May 31, 2005
Posts: 20
|
Posted:
Sat Sep 17, 2005 5:58 am |
  |
lol look at mine! www.airsoftstim.com ALL THE BLANC ads i've tried everythign!  |
_________________ [img]http://img261.echo.cx/my.php?image=leave4bc.png[/img] |
|
   |
 |
|
|