Page 4 of 4
Re: Saratoga Templates with PHP 7
Posted: Tue 27 Feb 2018 5:09 pm
by ConligWX
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] #
Re: Saratoga Templates with PHP 7
Posted: Tue 27 Feb 2018 5:30 pm
by ConligWX
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
Re: Saratoga Templates with PHP 7
Posted: Tue 27 Feb 2018 10:24 pm
by saratogaWX
Yes, that is correct.
What script is that in?
Don't know about whos-online -- that was a Mike Challis creation.
Re: Saratoga Templates with PHP 7
Posted: Tue 27 Feb 2018 10:36 pm
by ConligWX
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.
Re: Saratoga Templates with PHP 7
Posted: Wed 28 Feb 2018 8:41 pm
by BCJKiwi
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?)
Re: Saratoga Templates with PHP 7
Posted: Wed 28 Feb 2018 11:04 pm
by ConligWX
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.
https://cumulus.hosiene.co.uk/viewtopic.p ... 30#p129307
Code: Select all
while (list($key, $val) = each($Stations)) {
to:
Code: Select all
foreach($Stations as $key => $val) {
Re: Saratoga Templates with PHP 7
Posted: Wed 28 Feb 2018 11:12 pm
by saratogaWX
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.
Re: Saratoga Templates with PHP 7
Posted: Thu 01 Mar 2018 12:26 am
by BCJKiwi
Thanks,
sorry I missed the earlier reference