Clan Adverts

PHP Web Host - Quality Web Hosting For All PHP Applications

 

How To Add A Google Adsense In Your Header

Description: This tutorial will show you how to add a Google Adsense in your header.
Version: 1.0
Added on: 30 May 2006
Author: Admin
Difficulty Level: Intermediate
Views: 302
Detailed Profile

Files to edit :
themes/YOURTHEME/theme.php
themes/YOURTHEME/header.html[*if available]

Steps : Open themes/YOURTHEME/theme.php

find the themeheader function similar to the example below.

Code:
function themeheader()
{ global $user, $banners, $sitename, $slogan, $cookie, $prefix, $dbi;


Within this function is where we will put our google in a variable [$google_ads].

Code:
$google_ads ='<script type="text/javascript"><!-- google_ad_client = "pub-0000000000000";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
google_ad_type = "text";
google_color_border = "D7D7D7";
google_color_bg = "D7D7D7";
google_color_link = "FFFFFF";
google_color_url = "FFFFFF";
google_color_text = "000000";
//--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>';


The last part is to now add the variable [$google_ads] in the header.html where you want the ads to be displayed. (Note: If you do not see a header.html then the codes for the header is within that same themeheader function.). Open themes/YOURTHEME/header.html and add the variable anywhere you want the google ads to be shown. I added mine at the top of the codes like this.

Code:
<center>$google_ads</center>


That's it!! Save both files and you should now see your google ads in the header of your phpnuke portal.