cloudy

Author Topic: Carterlake/AJAX/PHP templates available  (Read 222939 times)

0 Members and 2 Guests are viewing this topic.

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Carterlake/AJAX/PHP templates available
« Reply #480 on: March 15, 2008, 04:06:46 AM »
What do you think of this?
http://www.carmosaic.com/weather/monthly-stats.php

Try out the toggle 24 Hour Chart daily image feature (the image links are at the bottom of each daily table)

I have modified and repackaged AvgExtract.php that was developed by Kevin Reed into include-wxhistory.php
I am sending two files (wxhistory.php and include-wxhistory.php) to Ken to be used as a plugin for use in
the Weather Display/PHP/AJAX Website Template Set

Features / Changes:
Modified for style compatibility with my css theme switcher and to be used
inside of a wxhistory.php page in a Weather Display/PHP/AJAX Website Template set

Added if is_file check and toggle image feature for 24 hour chart images
also added other minor formatting changes

This script will make a list and display the Weather Display Daily / Monthly Report files from a
directory on your web server.

It looks for and compiles a list of all the Weather Display Daily / Monthly Report files:
It also checks to be sure the files are really there, if one is missing, it will be skipped
October2007.htm
November2007.htm
December2007.htm

Note: make sure your Weather Display program is set to upload the Avg/Extremes files and time stamped daily graphs!
« Last Edit: March 15, 2008, 04:14:05 AM by MCHALLIS »

Offline jwwd

  • Posts: 3,561
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: Carterlake/AJAX/PHP templates available
« Reply #481 on: March 15, 2008, 05:55:34 AM »
Hi McHallis

This is a really great addition to Kevins avgextract.php script.

Do you have a suggestion to how I can incorporate it to my excisting report page. I have tried uploading the include-get-month-files.php and changed the needed settings - but I cant get it to work.

I think it might be because I already have modified my form page.

Here is my running report page:

www.buskelundtoften.dk/vejret/english/rapporter.php

Today I have a link to my daily grahs and the open in a new window.

Best regard,

Henrik

Offline munrobaggins

  • Posts: 1,973
  • 38 mls NE Inverness UK
Re: Carterlake/AJAX/PHP templates available
« Reply #482 on: March 15, 2008, 08:58:25 AM »
Hi Ken and Mike,

Before I go rushing into setting up the WD Live side of things using the template wxlive etc., are there ramifications to this....whilst thinking about it last night I came to the conclusion that for my setup it would almost certainly not work because of domain name implications.  ie.  The config file (with registration serial number linked to the domain name) sits on my .co.uk website and the new template site is using a .NET domain.  Is this logic correct, or is this a methodoly of incorporating an externally produced page into the excellent template format and still having format, styles etc.. I'm confused. :?

Additionally, prior to the main templates being released I used the WU underground "History" .php system to produce a webpage on my .net site.  With my limited understanding of programming (I have to be spoon-fed) I have ended up with the page being internally linked and working but without the format and style of the pukka templates.  I am loathe to change things once they are working OK, but could the "WU History" page become part of the new template system?


Best regards,

Offline Tim Hanko

  • Posts: 1,108
  • Grand Rapids, Michigan, USA
    • Walker, MI Weather
Re: Carterlake/AJAX/PHP templates available
« Reply #483 on: March 15, 2008, 10:26:03 AM »
Mike,

Excellent. I'm very interested.

Offline Tim Hanko

  • Posts: 1,108
  • Grand Rapids, Michigan, USA
    • Walker, MI Weather
Re: Carterlake/AJAX/PHP templates available
« Reply #484 on: March 15, 2008, 10:47:40 AM »
Ken,

Remember the note about double images?

www.thanko.info/two-wind-roses.png

Offline Bigbaywx

  • Posts: 132
  • Big Bay, Michigan
    • Big Bay, Michigan Local Weather
Re: Carterlake/AJAX/PHP templates available
« Reply #485 on: March 15, 2008, 10:55:47 AM »
Mike,

That's great!!  It beats the heck out of the stock HTML varient that WD provides.  Right now I just call up the reports into a seperate html page and it doesn't look nearly as nice (http://www.bigbaywx.com/weekrep.htm) not to mention that it's not in the template format either.  Thank you very much for your work on the templates as it certainly imports more of a professional look to them.

Offline jmcmurry

  • Jim McMurry
  • Posts: 2,336
  • Mauston, WI, USA
    • Juneau County Weather
Re: Carterlake/AJAX/PHP templates available
« Reply #486 on: March 15, 2008, 11:21:00 AM »
Bigbaywx,

You don't have the .css file being loaded in the <head> portion of that file.  In fact, there's nothing there.

- Jim

 Home of NSLog NexStorm Lightning Data Manager

Offline Bigbaywx

  • Posts: 132
  • Big Bay, Michigan
    • Big Bay, Michigan Local Weather
Re: Carterlake/AJAX/PHP templates available
« Reply #487 on: March 15, 2008, 12:39:52 PM »
Jim,

 I'm aware of that....it's just the stock WD html page at this point.  I have not tried to call it within a new blank template page.

Doug

Offline jmcmurry

  • Jim McMurry
  • Posts: 2,336
  • Mauston, WI, USA
    • Juneau County Weather
Re: Carterlake/AJAX/PHP templates available
« Reply #488 on: March 15, 2008, 01:47:45 PM »
Doug,

I'm sorry, I misread the content of your post.  Too early in the morning and prior to coffee.  :D

- Jim

 Home of NSLog NexStorm Lightning Data Manager

Offline jwwd

  • Posts: 3,561
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: Carterlake/AJAX/PHP templates available
« Reply #489 on: March 15, 2008, 01:53:34 PM »
What do you think of this?
http://www.carmosaic.com/weather/monthly-stats.php

Try out the toggle 24 Hour Chart daily image feature (the image links are at the bottom of each daily table)

Hi again

I think I have just realized that its the toggle thing that I misses in the script - all the rest is working fine.

Is that some kind of javascript? If yes - should I then change this in Kevins avgextract.php script?:

Code: [Select]
                // Check for Day String
                if ( strpos ($value,"Ekstremer for dag :") !== false ) {
                   
                    // Must already have been processing a day so close table

                    if ( $DAY != 0 ) {
                        echo "</table>\n";
                        echo '  <a target="_blank" href="' . $website . $yearnum . $monthnum . $DAY . '.gif">
                        Klik her for 24 timers graf for denne dag</a><br/>' . "\n";
                    }
                    preg_match("/Ekstremer for dag :(\d{1,2})\</",$value,$found);
                    $DAY = $found[1];
                    echo "<h3>Gennemsnit &amp; rekorder for dag " . intval($DAY) .
                        "</h3><table class='tbl'>";
                }
               
                // Check for Month Recap
               
                if ( strpos ($value, "Ekstremer for måned ") !== false ) {
                    echo "</table>\n";
                    echo '  <a target="_blank" href="' . $website . $yearnum . $monthnum . $DAY . '.gif">
                        Klik her for 24 timers graf for denne dag</a><br/> <br/>' . "\n";
                    echo "<h3>Gennemsnit &amp; rekorder for " . $month . " up to day " .
                        intval($DAY) . "</h3><table class='tbl'>";
                }

Thanks

Best regards,

Henrik

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Carterlake/AJAX/PHP templates available
« Reply #490 on: March 15, 2008, 02:34:03 PM »
Hi again

I think I have just realized that its the toggle thing that I misses in the script - all the rest is working fine.

Is that some kind of javascript? If yes - should I then change this in Kevins avgextract.php script?:

Code: [Select]
                // Check for Day String
                if ( strpos ($value,"Ekstremer for dag :") !== false ) {                   
                    // Must already have been processing a day so close table

                    if ( $DAY != 0 ) {
                        echo "</table>\n";
                        echo '  <a target="_blank" href="' . $website . $yearnum . $monthnum . $DAY . '.gif">
                        Klik her for 24 timers graf for denne dag</a><br/>' . "\n";
                    }
                    preg_match("/Ekstremer for dag :(\d{1,2})\</",$value,$found);
                    $DAY = $found[1];
                    echo "<h3>Gennemsnit &amp; rekorder for dag " . intval($DAY) .
                        "</h3><table class='tbl'>";
                }
               
                // Check for Month Recap
               
                if ( strpos ($value, "Ekstremer for måned ") !== false ) {
                    echo "</table>\n";
                    echo '  <a target="_blank" href="' . $website . $yearnum . $monthnum . $DAY . '.gif">
                        Klik her for 24 timers graf for denne dag</a><br/> <br/>' . "\n";
                    echo "<h3>Gennemsnit &amp; rekorder for " . $month . " up to day " .
                        intval($DAY) . "</h3><table class='tbl'>";
                }

Thanks

Best regards,

Henrik

Henrik,

Your form might not work with this version because this version uses the form name "date" for the url get date input, your form is using the form name "report" for the url get date input.

This version of AvgExtract.php I have developed into include-wxhistory.php
It is only designed to be used as a plugin for use in
the Weather Display/PHP/AJAX Website Template Set because it has css style changes inside include-wxhistory.php.
include-wxhistory.php should not be used outside of the Weather Display/PHP/AJAX Website Template Set or it will not work right.

To answer your question ...
The toggle is javascript and it is a new feature I just put in got this version of include-wxhistory.php, it required changes inside of the code section you posted and it requires some code in the html head section like this:

Code: [Select]
<!-- mchallis begin added for toggle 24 Hour Daily Chart images -->
<script type="text/javascript" language="JavaScript">
function toggleDisplay(imgID) {
   if(document.getElementById(imgID).style.display == "none" ) {
            document.getElementById(imgID).style.display = "";
   } else {
            document.getElementById(imgID).style.display = "none";
   }
}
</script>
<!-- mchallis end added for toggle 24 Hour Daily Chart images -->

</head>

To keep on topic in this thread... any more questions about AvgExtract.php outside of the Weather Display/PHP/AJAX Website Template Set I am happy to answer here:
http://www.weather-watch.com/smf/index.php/topic,28547.0.html

« Last Edit: March 15, 2008, 02:39:36 PM by MCHALLIS »

Offline daveq

  • Posts: 3,098
  • Hollywood, MD
    • Hollywood - St. Mary's County, Maryland
Re: Carterlake/AJAX/PHP templates available
« Reply #491 on: March 15, 2008, 02:49:34 PM »
I'm trying to create a page that displays the WD screen shot.  I'd like the wd image at the bottom of this page to fit this page without overlapping the sides of the template.  I've tried changing the size differnt ways but I'm sure what I've done isn't correct.

--Dave   

Offline saratogaWX

  • Posts: 4,672
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: Carterlake/AJAX/PHP templates available
« Reply #492 on: March 15, 2008, 02:52:37 PM »
Hi Ken and Mike,

Before I go rushing into setting up the WD Live side of things using the template wxlive etc., are there ramifications to this....whilst thinking about it last night I came to the conclusion that for my setup it would almost certainly not work because of domain name implications.  ie.  The config file (with registration serial number linked to the domain name) sits on my .co.uk website and the new template site is using a .NET domain.  Is this logic correct, or is this a methodoly of incorporating an externally produced page into the excellent template format and still having format, styles etc.. I'm confused. :?

Additionally, prior to the main templates being released I used the WU underground "History" .php system to produce a webpage on my .net site.  With my limited understanding of programming (I have to be spoon-fed) I have ended up with the page being internally linked and working but without the format and style of the pukka templates.  I am loathe to change things once they are working OK, but could the "WU History" page become part of the new template system?


Best regards,


Since the license for WDL is to another domain, I think the only way to include it in the template site is to create a new page on the template site, and use an <iframe> to 'embed' the WDL within the page on the new site.  The <iframe> will load the WDL from the licensed domain and present it using the template .. the drawback is that none of the styling of the template will be applied to the display of WDL (because the <iframe> acts like a different browser window and uses the CSS of the source domain).

For the WU-history, yes, it can be used with the new PHP template system .. just start with a new blank page from the template and add the required CSS include just before the </head> in the page, then include the WU-history.php in the page.

Hope this helps...
Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline saratogaWX

  • Posts: 4,672
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: Carterlake/AJAX/PHP templates available
« Reply #493 on: March 15, 2008, 02:57:01 PM »
I'm trying to create a page that displays the WD screen shot.  I'd like the wd image at the bottom of this page to fit this page without overlapping the sides of the template.  I've tried changing the size differnt ways but I'm sure what I've done isn't correct.

--Dave   

Dave,
The screen image at 984x585 won't fit in the 'narrow' style template .. the maximum size you can use there is about 620px wide.  It will fit in the 'wide' style template though.

You could incorporate logic in the screen image <img> tag to detect when the current style is narrow and force the image to display a 1/2 width and height.

Hope this helps...
Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline saratogaWX

  • Posts: 4,672
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: Carterlake/AJAX/PHP templates available
« Reply #494 on: March 15, 2008, 03:08:18 PM »
Ken,

Remember the note about double images?

www.thanko.info/two-wind-roses.png
Ok Tim, that's very strange  8O

It appears that the AJAX update (which is supposed to replace the PHP-generated <img>) put it next to the image, instead of replacing it.

What browser/version are you using when you saw the effect?

Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates