Forum Moderators: martinibuster

Message Too Old, No Replies

Changing adsense ads on multiple pages

         

localsportsfan

4:41 am on Aug 13, 2005 (gmt 0)

10+ Year Member



I operate a sports news website. I would like to place the adsense ads on my pages that contain sports news articles. However, I don't want to have to place the adsense code on every single newly created page. I usually have 5-10 new articles each day (so 5-10 new pages) and they remain on my site for a year or more.

Ideally, I would like to have a framed page where my logo, adsense ad and navigation bar are on the top frame and the news article is on the bottom frame. This way if I decide to remove the adsense code or change it, I could just do it once (by changing the top frame) and all of the pages with articles would be changed. However, this won't work since the adsense code has to be on the same frame as the main content.

A template would also work except that if I wanted to change the adsense code or delete it, the changes would not take effect on all the existing pages.

I know there must be some way to do this. I am using Frontpage 2000 to create and manage the website. Any suggestions.

John Carpenter

12:37 pm on Aug 13, 2005 (gmt 0)

10+ Year Member



A template would also work except that if I wanted to change the adsense code or delete it, the changes would not take effect on all the existing pages.

Why is that? We're using templates for that -- they're ideal solution. You could also use dynamically generated pages + server side includes (php, perl, etc.).

sunnydiv

1:08 pm on Aug 13, 2005 (gmt 0)

10+ Year Member



yeh man forget frames, use php, its so easy.

swick

7:17 pm on Aug 13, 2005 (gmt 0)

10+ Year Member



use php includes:

add this line to your template where you want your adsense code: <? include("google-ad.htm");?>

put the google-ad.htm file in your directory with your adsense code.

Then add this to your .htaccess file (in the same directory):

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

Now your google ads will be pulled and displayed dynamically.

abbeyvet

7:23 pm on Aug 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That last one will NOT work if you are using FrontPage to manage the site - that is to say if you have FP extensions installed and are using them.

However you can use FrontPage includes to acheive the same thing.

localsportsfan

8:09 pm on Aug 13, 2005 (gmt 0)

10+ Year Member



John Carpenter, are you using Frontpage 2000 or 2003. I was just doing some googling, and it appears that 2003 has dynamic templates, which will make changing to existing pages if you change the template. I think 2000 only has static templates, which don't change existing pages. Maybe its time to upgrade.

gordele

1:12 pm on Aug 14, 2005 (gmt 0)

10+ Year Member



I was looking for this information!
I have a 1000 page website and I did all the google adsense code manually! OMG I wish I knew about this before I feel like I wasted 2 months alredy! man!

John Carpenter

4:47 pm on Aug 14, 2005 (gmt 0)

10+ Year Member



John Carpenter, are you using Frontpage 2000 or 2003.

No, I'm using Dreamweaver 2004. I don't know anything about FP. (I hope it doesn't produce html documents as bad as M$ Word does.)

SincerelySandy

7:29 pm on Aug 14, 2005 (gmt 0)

10+ Year Member



You may also want to look into using a search & replace tool. May save you a lot of time if it suits your needs.

salongaopm1

8:57 pm on Aug 14, 2005 (gmt 0)



hi!
just a newbie question for swick. how can i exactly do what you've just suggested. i'm using fp 2002 but only using it like a notepad to create/edit html. can you possibly give a step by step instructions?
thanks in advance.

dzcap

9:10 pm on Aug 14, 2005 (gmt 0)

10+ Year Member



How exactly do you do this?

Content for widgets.
<?
include("adsensewidgets1.php");
?>

Something like that? Do you position where the ad show up with CSS?