Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Saratoga Templates with PHP 7

Discussion of Ken True's web site templates

Moderator: saratogaWX

User avatar
Toxic17
Posts: 780
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Deb 9.4 Stretch
Location: Bangor, NI
Contact:

Re: Saratoga Templates with PHP 7

Postby Toxic17 » Tue Feb 27, 2018 5:09 pm

saratogaWX wrote:Thanks for finding this.. I'll do an update (and look for more instances in my code).


No problem glad I could be of use.

not many in your templates but I have a few to do elsewhere.

Code: Select all

[/htdocs/weather] # grep -r ' each(' *.php
buoy-data.php:    while (list($key, $val) = each($Buoys)) { //write each hotspot
image-space-aurora.php:         while (list($numl, $line) = each($lines)) {
image-space-aurora-s.php:         while (list($numl, $line) = each($lines)) {
image-space-eit-284.php:         while (list($numl, $line) = each($lines)) {
image-space-eit-304.php:         while (list($numl, $line) = each($lines)) {
image-space-sat-env.php:         while (list($numl, $line) = each($lines)) {
image-space-solar-ap.php:         while (list($numl, $line) = each($lines)) {
image-space-solar-corona.php:         while (list($numl, $line) = each($lines)) {
image-space-solar-cycle.php:         while (list($numl, $line) = each($lines)) {
image-space-solar-disk.php:         while (list($numl, $line) = each($lines)) {
image-space-solar-number.php:         while (list($numl, $line) = each($lines)) {
image-space-solar-radio.php:         while (list($numl, $line) = each($lines)) {
image-space-solar-wind.php:         while (list($numl, $line) = each($lines)) {
image-space-xray.php:         while (list($numl, $line) = each($lines)) {
include-whos-online-header.php:      while (list($key, $value) = each($string)) {
mesonet-map-genhtml-inc.php:// while (list($key, $val) = each($Stations)) {
mesonet-map-genhtml-inc.php://while (list($key, $val) = each($Stations)) {
wo-worldmap.php:         while (list($numl, $line) = each($lines)) {
[/htdocs/weather] #
Regards Simon

https://www.conligwx.org
https://www.conligwx.org/pws/
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

User avatar
Toxic17
Posts: 780
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Deb 9.4 Stretch
Location: Bangor, NI
Contact:

Re: Saratoga Templates with PHP 7

Postby Toxic17 » Tue Feb 27, 2018 5:30 pm

I take it

Code: Select all

while (list($numl, $line) = each($lines)) {

should be:

Code: Select all

foreach($lines as $numl => $line) {


Can you confirm?

I also noticed I lost the map image on "Who's online" though I dont know if this is yet related to php 7.2.x
Regards Simon

https://www.conligwx.org
https://www.conligwx.org/pws/
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

User avatar
saratogaWX
Posts: 889
Joined: Wed May 06, 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows XP SP3
Location: Saratoga, CA, USA
Contact:

Re: Saratoga Templates with PHP 7

Postby saratogaWX » Tue Feb 27, 2018 10:24 pm

Yes, that is correct.

What script is that in?

Don't know about whos-online -- that was a Mike Challis creation.

User avatar
Toxic17
Posts: 780
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Deb 9.4 Stretch
Location: Bangor, NI
Contact:

Re: Saratoga Templates with PHP 7

Postby Toxic17 » Tue Feb 27, 2018 10:36 pm

saratogaWX wrote:Yes, that is correct.

What script is that in?

Don't know about whos-online -- that was a Mike Challis creation.


yep Who's Online was from Mike, he has discontinues support for that script a while back. the script works but images are not shown now, cant say I remember when it stopped working tbh.

the while (list($numl, $line) = each($lines)) { ??

was in the another Mike Challis script some image handler script, though this is not used anyway. the other finding I had was the buoy data.

Code: Select all

buoy-data.php:    while (list($key, $val) = each($Buoys)) { //write each hotspot


which is yours I think.
Regards Simon

https://www.conligwx.org
https://www.conligwx.org/pws/
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

BCJKiwi
Posts: 856
Joined: Mon Jul 09, 2012 8:40 pm
Weather Station: Davis VP2 Cabled with Solar
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Saratoga Templates with PHP 7

Postby BCJKiwi » Wed Feb 28, 2018 8:41 pm

There seem to be a couple of instances in
mesonet-map-genhtml-inc.php
Line 208: while (list($key, $val) = each($Stations)) {
Line 241: while (list($key, $val) = each($Stations)) {

Not sure how to change these (if required?)

User avatar
Toxic17
Posts: 780
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Deb 9.4 Stretch
Location: Bangor, NI
Contact:

Re: Saratoga Templates with PHP 7

Postby Toxic17 » Wed Feb 28, 2018 11:04 pm

BCJKiwi wrote:There seem to be a couple of instances in
mesonet-map-genhtml-inc.php
Line 208: while (list($key, $val) = each($Stations)) {
Line 241: while (list($key, $val) = each($Stations)) {

Not sure how to change these (if required?)


I posted that one earlier. viewtopic.php?f=25&t=15957&start=30#p129307

Code: Select all

while (list($key, $val) = each($Stations)) {


to:

Code: Select all

foreach($Stations as $key => $val) {
Regards Simon

https://www.conligwx.org
https://www.conligwx.org/pws/
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

User avatar
saratogaWX
Posts: 889
Joined: Wed May 06, 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows XP SP3
Location: Saratoga, CA, USA
Contact:

Re: Saratoga Templates with PHP 7

Postby saratogaWX » Wed Feb 28, 2018 11:12 pm

You can change both as

Code: Select all

 foreach ($Stations as $key =>$val) {
as Simon said.

I'll be updating the mesonet-map set of scripts when I can work out the (pernicious) problem with Google's V3.32 API. Debugging it is a real pain and a slow slog.

BCJKiwi
Posts: 856
Joined: Mon Jul 09, 2012 8:40 pm
Weather Station: Davis VP2 Cabled with Solar
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Saratoga Templates with PHP 7

Postby BCJKiwi » Thu Mar 01, 2018 12:26 am

Thanks,
sorry I missed the earlier reference


Return to “Saratoga Templates”

Who is online

Users browsing this forum: No registered users and 1 guest