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 in the News module

We are going to add an AdSense JavaScript code in a phpNuke module. For that purpose you will need to enter your CPanel -> File Manager utility and navigate to your PHP-Nuke folder -> modules -> News directory. Edit the article.php file. To insert the code you will have to:

Look for the following code:

$boxtitle = ""._RELATED."";
$boxstuff = "<font class=\"content\">";
$sql = "select name, url from ".$prefix."_related where tid=$topic";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$name = $row[name];
$url = $row[url];
$boxstuff .= "<strong><big>·</big></strong> <a href=\"$url\"
target=\"new\">$name</a><br>\n";
}

And above it copy and paste the following code:

echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\"
bgcolor=\"#FFFFFF\"
width=\"160\"><tr><td>\n"
."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"160\">\n"
."</table>\n"
."<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\"
bgcolor=\"#FFFFFF\"
width=\"100%\">\n"
."<tr><td align=\"center\">\n"
."<font class=\"title\" size=\"1\"><b>Related Websites</b></font>\n"
."</td></tr>\n"
."<tr>\n"
."<td bgcolor=\"#FFFFFF\"><font size=\"1\">";
?>
<center>
<script type="text/javascript"><!--
google_ad_client = "your client-number";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_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>
<?php
echo "</td>\n"
."</tr>\n"
."</table></td></tr></table>\n"
."<br>\n\n\n";
 

This, although it seems a bit complicated, is very easy to achieve. To do so, just click ctrl+f when the code is fully loaded and search for

$boxtitle = ""._RELATED."";

and above that line copy and paste the code:

PHPNuke and Google AdSense

Save the file and your AdSense box will appear in the News sections.

ImportantPlease, do not forget to change your actual Google Adsense code in the above example.



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