Sign Up For Web Hosting Now!
PHP-Nuke Services
No.1 CMS Host!
  • CMS-optimized servers
  • FREE CMS installation
  • FREE CMS templates
  • Free Domain name
  • Unlimited space
  • Unlimited traffic
  • Immediate activation
Buy web hosting
Sign up now Learn more
More About CMS

Compare best CMS Learn more about the most popular open source CMS tools

Facebook Twitter Plusone

PHP-Nuke and Google AdSense

Another approach is to add a Google AdSense banner on the 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

Previous Next
(c) Copyright 2004-2013 SiteGround. All rights reserved
SiteGround is not affiliated with or endorsed by the PHP-Nuke Project or its trademark owners.