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

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">";
$result8 = $db->sql_query("select name, url from ".$prefix."_related where tid='$topic'");
while ($row8 = $db->sql_fetchrow($result8)) {
    $name = filter($row8['name'], "nohtml");
    $url = filter($row8['url'], "nohtml");
    $boxstuff .= "<strong><big>&middot;</big></strong>&nbsp;<a href="$url" target="new">$name</a><br>";
}

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>nnn";
 

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.

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.