Forum Moderators: martinibuster

Message Too Old, No Replies

Dumb syntax question. Newb Alert!

google adsense syntax question

         

aff_dan

9:38 pm on Nov 18, 2004 (gmt 0)

10+ Year Member




I've been looking at this bit of code for so long I can't see for looking. Can some tell me what the correct syntax for this would be? I've highlighted the piece of code that I know is cauing the problem but I can't see for looking any more.

echo "<!-- google ads, generated by SW :: Google Ads (c) [marketingtops.com...] -->\r\n"
. "<table width=\"100%\"><tr><td align=\"center\"><br />"
. "<script language=\"javascript\">\r\n"
. "\r\n"
. "google_ad_client = \"" . $params->get('google_ad_client') . "\";\r\n"
. "google_alternate_ad_url = \"<a href='http://www.officialboard.co.uk/phpAds/adclick.php?n=aaee7455' target='_blank'><img src='http://www.officialboard.co.uk/phpAds/adview.php?what=zone:11&amp;n=aaee7455' border='0' alt='Speed Up The Web Today!'></a>;\" ."\r\n" <---
. "google_ad_width = " . $params->get('google_ad_width') . "; \r\n"
. "google_ad_height = " . $params->get('google_ad_height') . "; \r\n"
. "google_ad_format = \"" . $params->get('google_ad_format') . "\"; \r\n"
. "google_ad_channel = \"" . $params->get('google_ad_channel') . "\"; \r\n"
. ( $params->get('google_ad_in_frame')? "google_page_url = document.location; \r\n" : "")
. "google_ad_type = \"" . $params->get('google_ad_type') . "\"; \r\n"
. "google_color_border = \"" . $params->get('google_color_border') . "\"; \r\n"
. "google_color_bg = \"" . $params->get('google_color_bg') . "\"; \r\n"
. "google_color_link = \"" . $params->get('google_color_link') . "\"; \r\n"
. "google_color_url = \"" . $params->get('google_color_url') . "\"; \r\n"
. "google_color_text = \"" . $params->get('google_color_text') . "\"; \r\n"
. "//--> \r\n"
. "</script>\r\n"
. "<script language=\"javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></script>\r\n"
. "<!-- end of google ads -->\r\n"
. "</td></tr></table>";

Thanks

dan

JohnKelly

11:00 pm on Nov 18, 2004 (gmt 0)

10+ Year Member



Yikes! From the looks of it you're using PHP. Try this:

print <<<EOF

Regular Javascript/HTML code goes here (no escaping \'s needed)

EOF;

jurii

11:05 pm on Nov 18, 2004 (gmt 0)

10+ Year Member



Why, for what reason, are you doing this?
Isn't the code Google provides good enough for you?

...
php code
?>
"Google adsense code"
<?php
php code
...

Rodney

11:07 pm on Nov 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



actually, the way the original poster posted it, I think it might actual violate the "do not modify the adsense code" policy?

Hugene

11:38 pm on Nov 18, 2004 (gmt 0)

10+ Year Member



for php, the absolute only thing you have to change or add is:

replace all " with \"

thast it