You are missing our premiere tool bar navigation system! Register and use it for FREE!

•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
· Home
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 289 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
How to show advertisements in PHP-Nuke blocks

20.7. How to show advertisements in PHP-Nuke blocks

Advertisements are a popular source of revenue for webmasters. It doesn't take long until the young webmaster feels attracted to the sirene call of affiliate programs, banners or context relevant advertising.

Advertisements are often created through the use of a Javascript function, called at the right place in the HTML code. We have already treated the subject of Javascript in PHP-Nuke blocks (see Section 20.5) and modules (see Section 21.9) and seen that Javascript does not pose any special problems with PHP-Nuke. However, due to the increasing popularity of Google's AdSense program, there has been an increasing demand for ready-to-use solutions in the PHP-Nuke field. The following code examples should be seen as representative examples of how such advertising functionality can be incorporated in PHP-Nuke blocks. You can use them as starting point for similar advertising solutions, as offered by today's modern search engines or affiliate programs.

Tip Ready-to-use Google AdSense Block

If you don't feel like writing your own Google AdSense block, just use a ready-made one! Go to and download a ready-to-use AdSense block.

Create a block called block-AdSense.php and add the following in the file:

if (eregi("block-AdSense.php",$PHP_SELF)) {
  Header("Location: index.php");
<script language="JavaScript">
google_ad_client = 'your client-number';
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = '468X60_as';
google_color_border = "E5E5E5";
google_color_bg = "E5E5E5";
google_color_link = "336699";
google_color_url = "000000";
google_color_text = "000000";
// -->
$content .= "<center><script language=\"JavaScript\"
$content .= "</script></center>";
Important Don't forget:

Add your Google client number in the script.

Activate the AdSense block in your administration panel (see Section 9.4) by clicking on the "Blocks" links and choosing it from the blocks list as a new block.

Help us make a better PHP-Nuke HOWTO!

Want to contribute to this HOWTO? Have a suggestion or a solution to a problem that was not treated here? Post your comments on my PHP-Nuke Forum!

Chris Karakas, Maintainer PHP-Nuke HOWTO

Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.131 Seconds - 137 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded ( ::