Author Topic: google adsense question  (Read 10450 times)

0 Members and 1 Guest are viewing this topic.

Offline knsin0

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
google adsense question
« on: September 23, 2006, 11:07:40 AM »
hi all,
I would like to add adsense codes in the "new images" of the home.html by this way:

Row1:
3 new images
adsense codes

Row2:
another 3 new images
adsense codes

how can i do this?  :?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: google adsense question
« Reply #1 on: September 23, 2006, 06:44:37 PM »
you can try insert it under this line (actualy there two instances of that line):
Code: [Select]
$new_images .= "</tr>\n";i.e. something like this:
Code: [Select]
$new_images .= "<tr class=\"imagerow".$row_bg_number."\"><td colspan=\"".$config['image_cells']."\">your adsense code here</td></tr>\n";P.S. if you  adsense code has quotes, make sure you add a slash infront of each of them, like so: \"
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline knsin0

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Re: google adsense question
« Reply #2 on: September 23, 2006, 08:46:32 PM »
i suposse you mean in index.php, i have this:
Code: [Select]
if ($count == $config['image_cells']) {
      $new_images .= "</tr>\n";
      $count = 0;
    }
  } // end while

my adsense code is this one:
Code: [Select]
<script type="text/javascript"><!--
google_ad_client = "pub-0000000000000000";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "1C273A";
google_color_bg = "1C273A";
google_color_link = "FFA500";
google_color_text = "FFA500";
google_color_url = "FFA500";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

if i paste it directly after "$new_images .= "</tr>\n";" i get an error,

if i replace "$new_images .= "</tr>\n";" with "$new_images .= "<tr class=\"imagerow".$row_bg_number."\"><td colspan=\"".$config['image_cells']."\">your adsense code here</td></tr>\n";" i get this error:
Code: [Select]
Parse error: parse error, unexpected T_STRING in C:\AppServ\www\4image\index.php on line 137

how can i do it correctly? sorry but im "useless" about php  :(

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: google adsense question
« Reply #3 on: September 23, 2006, 09:10:13 PM »
1) I've never said anything about replacing anything...
2) as I said if you have quotes in your adsense code, they must be escaped by a backslash. You have lots of the quotes in your adsence so...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline knsin0

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Re: google adsense question
« Reply #4 on: September 23, 2006, 09:46:28 PM »
thanks V@no, now it works, didnt understand de "slash" tip  :D, i added it in all the quotes i have found in the adsense code and works  :D

 i want to add another row with 3 more new images and the adsense code for showing 6 new images in the index, how can i do this?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: google adsense question
« Reply #5 on: September 23, 2006, 09:48:25 PM »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline knsin0

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Re: google adsense question
« Reply #6 on: September 24, 2006, 12:10:36 AM »
that works, but the adsense ads only appear in the first row, how to implement it in the second row too? thanks for your patiente... :roll:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: google adsense question
« Reply #7 on: September 24, 2006, 01:12:22 AM »
you can try insert it under this line (actualy there two instances of that line)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline son_gokou

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: google adsense question
« Reply #8 on: September 25, 2006, 12:28:10 AM »
I'm interested in this topic too, and like dude knsin0  I'm useless about php.

Backslash is  \" ?

In the example of knsin0 adsense code what are the quotes of the code?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: google adsense question
« Reply #9 on: September 25, 2006, 12:31:47 AM »
this is a quote: "
this is a backslash: \
this is an escaped quote: \"
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline son_gokou

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: google adsense question
« Reply #10 on: September 25, 2006, 12:34:47 AM »
This is what I call a clear awnser :)

Thanks for one more help you gave me