Author Topic: Updating as time allows - update  (Read 832 times)

0 Members and 1 Guest are viewing this topic.

Offline youngros

  • Contributor
  • ***
  • Posts: 104
    • Sans Souci Weather
Updating as time allows - update
« on: November 25, 2022, 06:37:27 AM »
Just moving host from a cheap reseller, which was brilliant for using different php versions for different sites, back to normal shared hosting. Currently it is using php7.4, which all my Drupal and other database driven stuff uses. I've not tried them on 8.1 yet.
Weather site had been running 5.6 because of the World Weather topsites. I know someone had upgraded it to run on php7, but I am going to drop it. The script is so old as to be too much work for me and it's not used so much now. The bots have a tendency to love it!
I've pretty much upgraded my homepage which runs the alternative dashboard, to the latest version although I've not tried it on 7.4 yet.
Which other scripts need an upgrade? I have the Wildwood weather scripts and also a high/low script which was a Webster Weather/Hamilton Weather script.
I know I can switch the version and see what happens, but would rather know before hand and at least hide the page until it is sorted.
Thanks to all for keeping these scripts running.

An update. I tried out php7.4 to see how my homepage worked and all was good. Off all the other pages the only one that wasn't working was the High/Low/Averages page.
This fails at something that says fixup_time which I think relates to below.

Quote
function fixup_time ( $WDtime ) {
  global $timeOnlyFormat,$DebugMode;
  if ($WDtime == "00:00: AM") { return ''; }
  $t = split(':',$WDtime);
  if (preg_match('/pm/i',$WDtime)) { $t[0] = $t[0] + 12; }
  if ($t[0] > 23) {$t[0] = 12; }
  if (preg_match('/^12.*am/i',$WDtime)) { $t[0] = 0; }
  $t2 = join(':',$t); // put time back to gether;
  $t2 = preg_replace('/[^\d\:]/is','',$t2); // strip out the am/pm if any
  $r = date($timeOnlyFormat , strtotime($t2));
  if ($DebugMode) {
    $r = "<!-- fixup_time WDtime='$WDtime' t2='$t2' -->" . $r;
    $r = '<span style="color: green;">' . $r . '</span>';
  }
  return ($r);
}

I've switched back to 5.6 for the time being but will delete the pages if no solution to stop it filling up the error log.
« Last Edit: November 25, 2022, 11:13:54 AM by youngros »