Author Topic: nws-alerts error  (Read 110 times)

0 Members and 1 Guest are viewing this topic.

Offline rrrick8

  • Senior Contributor
  • ****
  • Posts: 179
    • Vermilion weather
nws-alerts error
« on: October 13, 2020, 01:03:07 PM »
Just updated my server to php 7.3.23
I am getting a new error now every time it runs on cron job. It completes the script but sends me the following error...
Code: [Select]
[13-Oct-2020 16:42:06 UTC] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /home/path/public_html/nwsiconalerts.php on line 6The nwsiconalerts.php is as follows...
Code: [Select]
<?php
include_once("nws-alerts-config.php"); // include the config file
include($cacheFileDir.$iconFileName); // include the big icon file
// construct icons
$bigIcos '';
$biCount count($bigIcos);
foreach(
$bigIcons as $bigI) {
$bigIcos .= '<td class="atd" colspan="'.$biCount.'">'.$bigI."</td>\n";
}
?>

<table class="atable">
<tr>
<?php echo $bigIcos?>
</tr>
</table>

Running latest version of nws-alerts script. Any help would be appreciated, thanks.
http://vermilionweather.com/
Rick
« Last Edit: October 13, 2020, 01:41:44 PM by rrrick8 »
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8009
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: nws-alerts error
« Reply #1 on: October 13, 2020, 01:53:09 PM »
I think there's a typo in the line
Code: [Select]
$biCount = count($bigIcos); that should be
Code: [Select]
$biCount = count($bigIcons);
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline rrrick8

  • Senior Contributor
  • ****
  • Posts: 179
    • Vermilion weather
Re: nws-alerts error
« Reply #2 on: October 13, 2020, 02:40:15 PM »
Thanks Ken. Changing just the one you recommended did the trick.
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

 

anything