Carterlake/AJAX/PHP templates available

Hi Tim,

Yes, the site-wide tags go in top.php.
If you want extra tags on an individual page, then just put them above the

</head>
<body>

on the individual page.

I’m not sure what you mean by ‘$keywords’ … I don’t remember putting anything like that in the template set.

Best regards,
Ken

Thanks again Ken,

I’ll leave the thermometer the way it is because I’ll copy everything over to the main directory pretty soon. Just wanted to update all the new scripts with the info from the old ones before I overwrite them. Additionally… the windrose and the current conditions graphic seem to be rewriting themselves every few seconds. Anyway to turn that off until the page itself updates?? It gets to be a little distracting. http://www.bigbaywx.com/test/wxindex.php

I’ve updated the distributions with an updated thermometer.php and Settings.php that adds a new

$SITE['clientrawfile']	= './clientraw.txt';  // relative FILE location of clientraw.txt

in the sitewide config area. The new thermometer.php script will use this (if available) to locate clientraw.txt.

I’ve also updated the installation page to show which scripts use cache files (indicated by a C in the USA, Canada, World columns), and added hotlinks to the scripts pages themselves for easy reference.

I’ve noticed in Firefox, that after a while viewing the dashboard, the condition image and thermometer redraw with each update. I’ve found that clearing the browser disk cache fixes it (until the cache fills again).

Best regards,
Ken

Ken,

All my old site pages have a meta tag for keywords. I was using keywords as follows:

This line was in a common header - header.inc:

<meta name="keywords" content="<?php echo $keywords;?>" />

And the $keywords variable was set as here:

$keywords = "adventure books, mountain climbing, mountaineering, escapes, kayaking, rafting";
include ('header.inc');

Since you have the meta tags in each file this is no longer necessary. I can just add the keywords meta tag to each page.

Maybe something to consider for version 2 of the templates would be to move the document declaration, etc. to the common header file. This would reduce code duplication even more. Like my old header here:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

	<meta http-equiv="Content-Language" content="en-us" />
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<meta name="keywords" content="<?php echo $keywords;?>" />
	<meta name="description" content="Walker, Michigan Weather, Book Recommendations and Photography" />
	<meta http-equiv="Cache-Control" content="no-cache" />
	<meta http-equiv="Pragma" content="no-cache" />
	<title><?php echo $page_title;?></title>
	
	<link rel="alternate" type="application/rss+xml" title="Walker, MI Weather [RSS]" href="http://www.thanko.info/rssfeed_CurrentObs.php" />
	<link rel="stylesheet" type="text/css" href="my_style.css" />
	<link rel="stylesheet" media="all" type="text/css" href="menus.css" />

<!--[if lte IE 6]>
<style type="text/css">
.menu ul ul {left:-1px; margin-left:-1px;}
.menu ul ul ul.left {margin-left:1px;}
</style>
<![endif]-->

</head>
<body>
	
<?php

include ('menus.txt');
echo '<hr /><h3>' . $page_title . '</h3>';

?>

But maybe there is a reason you did not do this of which I am not aware. :slight_smile:

Maybe something to consider for version 2 of the templates would be to move the document declaration, etc. to the common header file. This would reduce code duplication even more.

But… It is often useful to use separate and distinct keywords on each page tailored to the content of that page (same with the title). This helps with search engine optimization.

Tony

ThorntonWeather,

This is quite easily accomplished and is what I am doing now.

Create a header file with the keywords meta tag like so:

In each individual file set $keywords=“keyword, keyword, etc”;

Just make sure the variable is set before you include the header file.

I guess the reason was I just hadn’t thought of using individual keywords per page #-o

My site uses the same for keywords on all pages… so the keywords is in top.php.

You can modify top.php to change

    <meta name="description" content="Personal weather station." />

to be

<?php if (isset($DESCRIPTION)) { ?>
    <meta name="description" content="<?php echo $DESCRIPTION; ?>" />
<?php } else { ?>
    <meta name="description" content="Walker, Michigan Weather, Book Recommendations and Photography" />
<?php } 
   if (isset($KEYWORDS)) { ?>
    <meta name="keywords" content="<?php echo $KEYWORDS; ?>" />
<?php } else { ?>
   <meta name="keywords" content="adventure books, mountain climbing, mountaineering, escapes, kayaking, rafting" />
<?php } ?>

Then change in each wx… page

############################################################################
$TITLE= $SITE['organ'] . " - Sample Blank Page";

to be

############################################################################
$TITLE= $SITE['organ'] . " - Sample Blank Page";
$KEYWORDS = 'adventure books, mountain climbing, mountaineering, escapes, kayaking, rafting';
$DESCRIPTION = 'Walker, Michigan Weather, Book Recommendations and Photography';

and that would do it I think. If the sample page didn’t have the $DESCRIPTION and/or $KEYWORDS, the default set would be used based on the PHP logic in top.php

Hows that work for you?
Best regards,
Ken

I think I got the scripting information copied over from the old format o.k. I transfered all of the new files to the main directory and aside from the marquee still being screwed up it doesn’t look too bad. However the graphics for the astronomy page are fudged. Everything is in the same directory and the old page shows the appropriate icons http://www.bigbaywx.com/wx7.html However the new page does not. http://www.bigbaywx.com/wxastronomy.php

For some reason the new is set up to look in the ajax images directory instead of the home directory. Is there an easy fix for this??

Is there an easy fix for this??

I would just upload the new ajax-images to your web page. if you look on your new home page it needs the same directory for your moon icon on the dashboard.

Regards,

Jack

Forget that…I figured it out. I should look first a little more before I ask. I didn’t realize that this package had a bunch of new images in the included ajax images directory. So I still have to upload them to the website. mea culpa…

BigBay,

It looks like your astonomy page is having the issue I had last night. Ken has a fix for it, you need to change the get_localdate function code to this…

<?php
function get_localdate ( $indate) {
  global $SITE;

// Change '02:33 UTC 4 September 2007' to
//        '3-Sep-2007 nn:nnpm' 
  $timeFormat = 'D, d-M h:ia T';  // Fri, 31-Mar-2006 14:03 TZone
  $timeFormat = 'h:ia T D, d-M-Y ';  // Fri, 31-Mar-2006 14:03 TZone
  if(isset($SITE['timeFormat'])) { $timeFormat = $SITE['timeFormat']; }
  
  $utcstr = substr($indate,10) . " " . substr($indate,0,9); // move formats
  $utc = strtotime($utcstr);
  $lclstr = date($timeFormat,$utc);
  return ($lclstr);
}

?>

Look back in this forum you’ll see my discussion with Ken. Your new pages are looking good so far, nice job!

Regards,

Jack

Thanks for helping Jack! =D> You’re right in both answers (as usual :smiley: )

I’m keeping the distribution .zip files for each flavor (USA, Canada, World) updated with fixes as they are implemented.

Best regards,
Ken

I’ve done the above change to the astronomy page, but it shows I am coming up to the spring equinox here in the southern hemisphere :?

Is it just a case of swapping the winter/summer and fall/spring titles and labels?

EDIT - forget the above, I worked it out - changed the ‘get local date’ things around :lol:

Cool!

You may also want the Southern Hemisphere Moon phase images too.
http://saratoga-weather.org/template/moon-southern.zip … just unpack into your /ajax-images directory and your moon should appear as you see it … sorry about the Northern Hemisphere slant on the World template :slight_smile:

I’d added the note about the Southern Hemisphere moon images in the install guide. I’ll put in some code to auto-swap the wxastronomy.php Seasons based on a negative value for $SITE[‘latitude’]. Would you mind emailing your wxastronomy.php page so I can be sure I’m swapping them correctly?

Best regards,
Ken

Hey Ken,

Thanks for all your hard work… I downloaded the package(s) and installed them for my Dad’s Canadian site but appear to have 2 issues…

First, the Radar images aren’t getting copied down and nothing appears on the main page or radar page…

Second, the main page doesn’t appear to be reloading the data in the 5 minute intervals as it indicates.

http://weather.rtphosting.net/London/wxindex.php

Any thoughts?

PS: I did chmod the radar folder to 777

thanks,

Paul

Wow. You’re gone for a while and look what happens.

(Ken, start calling it the Saratoga template… it’s completely different now. Good job! 8) )

Ken, these are looking great and I’ll be working on them in a couple of weeks when I get off this 6a-6p shift. Just wondering about the docs. Is there a zip of just the docs? I’d like to be able to download and print them out rather than flipping back and forth between editor and web pages.

–Dave

I couldn’t get the marquee to do what I wanted to with the Marquee command so found a way to do it with javascript. Wish I could get one using an external text file. I did see a few scripts that would use an external file but they wanted to do all kinds of other weird crap that wouldn’t work.

Other than that I think it will just be a matter of working up all the new pages using the new format and it will be ready to switch over. Thanks again Ken and the others that have helped for all your hard work. http://www.bigbaywx.com/wxindex.php

Okay - fixed the update issue… removed the leading / in the clientraw.txt path in ajaxWDwx.js… Radar is still broke though.

Hi Paul,
It seems that the ec-radar.php program can’t write in your /radar/ directory


Try using the ec-radar-cachetest.php on your site and adjusting permissions on the /radar/ directory until the cache test confirms it can create/write/read-back a file there.

Your testtags.php weather variables seem to be current

$time = “4:55 PM”; // current time
$date = “03/01/08”; // current date

The overall page won’t automatically reload since the default template set has the

<meta http-equiv="Refresh" content="300" />

not included in the top.php – you can add that if you’d like all the pages to refresh every 5 minutes.

Hope this helps…
Best regards,
Ken