View Single Post
  #10 (permalink)  
Old 05-21-2005, 10:48 PM
Dauthus Dauthus is offline
Junior Member
 
Join Date: Apr 2003
Posts: 60
I hope this doesn't go against the rules since the credits have been added on his site.

I don't know about adding the google ads "inside" the text block, but you can add it to the right side after the "Most Read Story" text. Here's how:

While I was playing around with the Google Adsense on my site, I found a way to have the Adsense Ads included inside the "Related Links" box instead of outside it with tables. If you aren't sure what exactly I am talking about, go here:

http://www.bootleghollow.com/article-99--0-0.html

Here is the code I used, and where to place it.

-----[ OPEN ] -----

Code:
modules/News/article.php
-----[ FIND ] -----

Code:
themesidebox($boxtitle, $boxstuff);
-----[ ON A NEW LINE ABOVE ADD ] -----

Code:
$boxstuff .= "
<center><s cript type=\"text/javasc ript\"><!--\n";
$boxstuff .= "google_ad_client = \"YourAdsenseClientID\";\n";
$boxstuff .= "google_ad_width = 120;\n";
$boxstuff .= "google_ad_height = 600;\n";
$boxstuff .= "google_ad_format = \"120x600_as\";\n";
$boxstuff .= "google_ad_channel =\"\";\n";
$boxstuff .= "google_color_border = \"669966\";\n";
$boxstuff .= "google_color_bg = \"99CC99\";\n";
$boxstuff .= "google_color_link = \"000000\";\n";
$boxstuff .= "google_color_url = \"00008B\";\n";
$boxstuff .= "google_color_text = \"336633\";\n";
$boxstuff .= "//--></s cript>\n";
$boxstuff .= "<s cript type=\"text/javas cript\"\n";
$boxstuff .= "src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">\n";
$boxstuff .= "</s cript></center>
\n";
Here's the way it looks in my article.php

Code:
$row9 = $db->sql_fetchrow($db->sql_query("select sid, title from ".$prefix."_stories where topic='$topic' $querylang order by counter desc limit 0,1"));
$topstory = intval($row9['sid']);
$ttitle = stripslashes(check_html($row9['title'], "nohtml"));

$boxstuff .= "<a href=\"modules.php?name=$module_name&file=article&sid=$topstory\">$ttitle</a></font></center>
\n";

$boxstuff .= "
<center><s cript type=\"text/javas cript\"><!--\n";
$boxstuff .= "google_ad_client = \"YourAdsenseClientID\";\n";
$boxstuff .= "google_ad_width = 120;\n";
$boxstuff .= "google_ad_height = 600;\n";
$boxstuff .= "google_ad_format = \"120x600_as\";\n";
$boxstuff .= "google_ad_channel =\"\";\n";
$boxstuff .= "google_color_border = \"000000\";\n";
$boxstuff .= "google_color_bg = \"848484\";\n";
$boxstuff .= "google_color_link = \"000000\";\n";
$boxstuff .= "google_color_url = \"FF0000\";\n";
$boxstuff .= "google_color_text = \"FFFFFF\";\n";
$boxstuff .= "//--></s cript>\n";
$boxstuff .= "<s cript type=\"text/javascript\"\n";
$boxstuff .= "src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">\n";
$boxstuff .= "</s cript></center>
\n";

themesidebox($boxtitle, $boxstuff);
Remove the space between the "s" and "c" in the words "script." You will also have to change the colors to fit your site. I just liked the idea of having it look like part of the block instead of having it as a new table.
__________________
http://www.bootleghollow.com/images/sig1.gif
Vivere disce, cogita mori
Molon Labe!
Reply With Quote