Author Topic: New Saratoga AJAX/PHP template plugin for WeatherCat now available  (Read 110120 times)

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 156
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
With Stu's release of WeatherCat V0.95, Build 152, the AJAX/PHP template set plugin is now available

http://saratoga-weather.org/wxtemplates/install.php to download the WCT-plugin (and Base if you need it).

Users of the V3 template set with (shudder) another software package should also run the updates tool for their Base to get the 5 files changed there for WeatherCat support.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6490
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Thanks Ken!! (Re: New Saratoga AJAX/PHP template plugin)
« Reply #1 on: March 25, 2012, 03:28:04 AM »
Hi Ken and WeatherCat fans!

Still trying to dig myself out of my own programming miseries, but definitely want to wish you a big thank you for all this work!!

Greatly appreciated!!  [tup]

Cheers, Edouard  [cheers1]

HairyMcLeary

  • Strong Breeze
  • ***
  • Posts: 164
    • DW5912
    • INORTHOT6
  • Station Details: LaCrosse WS2355, iMac 2.66 Ghz Core 2 Duo, 8 GB RAM, Mountain Lion
Re: New Saratoga AJAX/PHP template plugin for WeatherCat now available
« Reply #2 on: March 25, 2012, 03:36:47 AM »
Wow! Awesome, thank-you very much.

I still have a little tweaking to do

www.oamaruweather.net.nz

Tony

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Re: New Saratoga AJAX/PHP template plugin for WeatherCat now available
« Reply #3 on: March 25, 2012, 10:32:50 AM »
Nice work Ken!

Is it OK to link to the template set plugin in the documentation and on our site?

(I'm guessing yes, but I have to ask  :) )

Many thanks,
Stu.

HairyMcLeary

  • Strong Breeze
  • ***
  • Posts: 164
    • DW5912
    • INORTHOT6
  • Station Details: LaCrosse WS2355, iMac 2.66 Ghz Core 2 Duo, 8 GB RAM, Mountain Lion
Re: New Saratoga AJAX/PHP template plugin for WeatherCat now available
« Reply #4 on: March 25, 2012, 02:38:22 PM »
I'm not sure where is the best place to post. Here or over on the WX Forum?

All went smooth enough, just 2 minor niggles:

When not using a METAR an image placeholder is left in the dashboard
Yesterdays temps have 2 decimal places, today's only have one.


saratogaWX

  • Strong Breeze
  • ***
  • Posts: 156
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Re: New Saratoga AJAX/PHP template plugin for WeatherCat now available
« Reply #5 on: March 25, 2012, 03:57:56 PM »
Nice work Ken!

Is it OK to link to the template set plugin in the documentation and on our site?

(I'm guessing yes, but I have to ask  :) )

Many thanks,
Stu.

Yes, I'd be honored to have the links from your site  ;D

Thanks!

I'm not sure where is the best place to post. Here or over on the WX Forum?

All went smooth enough, just 2 minor niggles:

When not using a METAR an image placeholder is left in the dashboard
Yesterdays temps have 2 decimal places, today's only have one.



I'll have to look at using the built-in conditions string to set the icon in lieu of a METAR.

The temps should have only 1 decimal place AFAIK...

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 156
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Re: New Saratoga AJAX/PHP template plugin for WeatherCat now available
« Reply #6 on: March 25, 2012, 08:47:40 PM »
I'm not sure where is the best place to post. Here or over on the WX Forum?

All went smooth enough, just 2 minor niggles:

When not using a METAR an image placeholder is left in the dashboard
Yesterdays temps have 2 decimal places, today's only have one.

Did an update to WCT-defs.php (V1.01 - 25-Mar-2012) to use the CC$ text for current conditions (and pick an icon based on that) if no METAR is specified (i.e. the $SITE['conditionsMETAR'] line in Settings-weather.php is commented out).

Use the updates page to get the update (25-Mar-2012).

Thanks for the suggestion .. WeatherCat is one of the few weather software programs to provide this independently.. glad I could use the CC$ field for folks far-away from a METAR station.  :)

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

HairyMcLeary

  • Strong Breeze
  • ***
  • Posts: 164
    • DW5912
    • INORTHOT6
  • Station Details: LaCrosse WS2355, iMac 2.66 Ghz Core 2 Duo, 8 GB RAM, Mountain Lion
Re: New Saratoga AJAX/PHP template plugin for WeatherCat now available
« Reply #7 on: March 25, 2012, 10:05:07 PM »
Thanks for the quick work, the update works fine. My site is now showing the my CC$ tag as a current condition icon.  [woohoo]

Tony

Administrator

  • Administrator
  • Strong Breeze
  • *****
  • Posts: 108
Re: New Saratoga AJAX/PHP template plugin for WeatherCat now available
« Reply #8 on: April 14, 2012, 12:19:38 PM »
Thank you Ken, I've made this topic a sticky.


nowait

  • Strong Breeze
  • ***
  • Posts: 133
  • Station Details: Davis Vantage Pro 2 Wireless (Heated) on a Snow Leopard Mac Mini
Re: New Saratoga AJAX/PHP template plugin for WeatherCat now available
« Reply #9 on: July 09, 2012, 02:43:04 AM »
I been working steadily to migrate from my html pages to the php pages from the Saratoga templates.

One thing I have not been able to figure out is how to have the title of each page contain the current temperature and time of last update like I have on my html site (http://nowaitweather.com).

I had several of my daily users check out the new php pages and each noted that they really missed the title having this information in it.  It is important to them because - if you minimize your browser window, you can still see the current conditions without bringing the full page up again.  Its like having a mini outdoor thermometer on your task bar.  I'd like to do the same using the php pages from the Saratoga templates.  Any ideas on how to do this?

nowait

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 156
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Re: New Saratoga AJAX/PHP template plugin for WeatherCat now available
« Reply #10 on: July 09, 2012, 05:58:08 PM »
It's possible to do that :)

Edit your top.php to change
Code: [Select]
if( isset ($TITLE) ) {
echo "    <title>" . $TITLE . "</title>\n";
} else {
echo "    <title>" . langtransstr($SITE['organ']) . "</title>\n";
}
to
Code: [Select]
$dispTUOM = '&deg;'.strtoupper(preg_replace('|[^CF]+|i','',$uomtemp));
if( isset ($TITLE) ) {
echo "    <title>$temperature$dispTUOM -" . $TITLE . "</title>\n";
} else {
echo "    <title>$temperature$dispTUOM -" . langtransstr($SITE['organ']) . "</title>\n";
}

and the current temperature will appear as the first thing in the title of each page on the site.

Best regards,
Ken

BTW.. that's the beauty of a modular site design with common code chunks used on each page.. change in one place and it's changed everywhere on the website :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

nowait

  • Strong Breeze
  • ***
  • Posts: 133
  • Station Details: Davis Vantage Pro 2 Wireless (Heated) on a Snow Leopard Mac Mini
Re: New Saratoga AJAX/PHP template plugin for WeatherCat now available
« Reply #11 on: July 10, 2012, 02:15:34 AM »
Thats Awesome!  Exactly what I wanted.

Love the templates.  Thanks for all the help.

nowait

nowait

  • Strong Breeze
  • ***
  • Posts: 133
  • Station Details: Davis Vantage Pro 2 Wireless (Heated) on a Snow Leopard Mac Mini
Re: New Saratoga AJAX/PHP template plugin for WeatherCat now available
« Reply #12 on: August 18, 2012, 02:35:12 AM »
I'd like to add a few more WX Records to my site but I can't seem to find them in the list when I do a Dump on my site:
http://www.nowaitweather.com/WCTtags.php?sce=dump

I'm looking for wx records for Lowest windchill of all time,  highest Heatindex of all time, and a few wxrecent table entries yesterday's values.

Is there a way for me to add these values to the tags so I can use them in my web pages?

Thanks

Nowait

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 156
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Re: New Saratoga AJAX/PHP template plugin for WeatherCat now available
« Reply #13 on: August 18, 2012, 04:41:45 AM »
Yes, there is an easy way to add those tags.

With the distribution WCT-plugin.zip came two files:

WeatherCat-webtags.txt
gen-WCTtags.php

You can add tags to the WeatherCat-webtags.txt using an ASCII text editor and this format with one tag per line:

wvar<tab><WeatherCat tag><tab><optional comment>

<tab> is the Tab character which is used as a field delimiter in the Weather-Cat-webtags.txt file.

You can add something like
Code: [Select]
wvar STAT$WINDCHILL:MIN:ALLTIME$ Lowest wind chill alltime
wvar STAT$WINDCHILL:MIN:ALLTIME:TIME$ Time of lowest wind chill alltime
and repeat for the other variables you'd like to add. 

Save and upload the WeatherCat-webtags.txt to your website.
Then view gen-WCTtags.php?comments=y on your website to generate a WCTtags template file.  Save the file over your current WCTtags template.

Then you can refer to the values as

$WX['STAT:WINDCHILL:MIN:ALLTIME']  and
$WX['STAT:WINDCHILL:MIN:ALLTIME:TIME']

in your PHP code.

Hope this helps...

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

nowait

  • Strong Breeze
  • ***
  • Posts: 133
  • Station Details: Davis Vantage Pro 2 Wireless (Heated) on a Snow Leopard Mac Mini
Re: New Saratoga AJAX/PHP template plugin for WeatherCat now available
« Reply #14 on: August 21, 2012, 02:12:05 AM »
Are there some additional includes that aren't in the newsamplepage.php?
I can't seem to print out any of the new variables or the existing ones?

I also tried adding the additional variables using the station records page?. and get nothing but the $STRECORDS contents?

I'm missing something (probably something basic) :)