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 control panel -> FileManager utility and navigate to the PHP-Nuke folder, modules and then news directory. Click on article.php script file and from the options at the right select edit file. This will open a new window with the actual code inside. 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: 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 above 
Save the file and your AdSense box will appear in the News sections. IMPORTANT: Please, do not forget to change your actual Google Adsense code in the above example. |