Web Hosting Line
1.800.828.9231
phpNuke Hosting
phpNuke Tutorial
phpNuke Themes
phpNuke Modules and Blocks
phpNuke FAQ
About phpNuke
Host Package
Free Domain name
750 GB space
7500 GB Traffic/mo
99.9% Server Uptime
24/7 Top Customer Care
FREE Nuke Installation
Immediate activation
The Best Host Package
learn more sign up now
Display entire tutorial on one page. Print-friendly version.

PHP-Nuke and Google AdSense

Google AdSense on top of a PHP-Nuke module

Another approach is to add a Google AdSense banner on top of every module. You can include the AdSense Javascript code in a separate file, call it adsense.php, and then just include this file from your module, as we did for the News sections above.

Put the following code in includes/adsense.php:

<center>
<script type="text/javascript"><!--
google_ad_client = "your client-number";
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>
 

Once you have adsense.php in the includes directory, it becomes trivial to use its code in every module you choose. For every module where you would like to add the Google AdSense, look for the following code:

require_once("mainfile.php");

and place the following line after that:

require_once("includes/adsense.php");

as we did that in the more detailed example with the News articles:

PHPNuke Google AdSense



phpNuke Hosting
(c) Copyright 2005 SiteGround PHP Hosting Services. All rights reserved.
Previous