Author Topic: wxsim forecast script missing icon (SOLVED)  (Read 910 times)

0 Members and 1 Guest are viewing this topic.

Offline Mchd17

  • Senior Member
  • **
  • Posts: 99
wxsim forecast script missing icon (SOLVED)
« on: November 13, 2018, 09:58:42 PM »
running the wxsim forecast script, seems i am missing a Sleet/Sleet icon. When I open image, this is the image url ...../forecast/images/23.jpg

All other images working, atleast since I have installed script a few days ago. http://www.towandawx.com/weather/wxsimforecast.php

Must be a define image somewhere that isn't right, thoughts?
« Last Edit: November 15, 2018, 09:48:43 PM by Mchd17 »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxsim forecast script missing icon
« Reply #1 on: November 14, 2018, 12:15:20 AM »
Very odd.. I didn't use a '23.jpg' anywhere in the ./forecast/images set of icons.

The plaintext-parser-data.txt has only two entries for detecting sleet:

cond|rain and sleet|raip|nraip|Rain Sleet|
and
cond|sleet|ip|ip|Sleet|

and the only icons that would be used are raip.jpg,nraip.jpg, or ip.jpg

I don't see the problem happening on your site at this time.. is this still an issue?
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Mchd17

  • Senior Member
  • **
  • Posts: 99
Re: wxsim forecast script missing icon
« Reply #2 on: November 14, 2018, 06:21:49 AM »
Not an issue since forecast changed. If it occurs again, I will post here and stop updating the forecast so you can see it.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxsim forecast script missing icon
« Reply #3 on: November 14, 2018, 11:39:17 AM »
If it occurs again, please post the plaintext.txt from WXSIM that is causing the missing icon to display.  Your plaintext-parser.php script is up-to-date already.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Mchd17

  • Senior Member
  • **
  • Posts: 99
Re: wxsim forecast script missing icon
« Reply #4 on: November 14, 2018, 11:54:42 AM »
Will do, thanks

Offline Mchd17

  • Senior Member
  • **
  • Posts: 99
Re: wxsim forecast script missing icon
« Reply #5 on: November 15, 2018, 09:32:36 AM »
Happened again this morning. I attached the plaintext.txt from wxsim. I am on my cell, otherwise I would copy and paste. Thanks

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxsim forecast script missing icon
« Reply #6 on: November 15, 2018, 10:51:54 AM »
I just tried the plaintext.txt with the current version of plaintext-parser.php and don't see any errors ??

Your plaintext-parser-data.txt has use ip.jpg for sleet.  I see the script does have the image link as http://www.towandawx.com/weather/forecast/images/23.jpg (which doesn't exist) when it should be http://www.towandawx.com/weather/forecast/images/ip.jpg (which exists).

In your Settings.php, you have a full-path specification to your plaintext.txt file .. is that the one you'd attached (since it's not visible from the usual document tree)?

« Last Edit: November 15, 2018, 11:01:21 AM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Mchd17

  • Senior Member
  • **
  • Posts: 99
Re: wxsim forecast script missing icon
« Reply #7 on: November 15, 2018, 01:13:19 PM »
Doing all this from my smartphone, so bare with me. I grabbed a notepad++ and looking at my settings.php. what line number is that reference to the plaintext.txt? Let me double check before I say "yes".

Offline Mchd17

  • Senior Member
  • **
  • Posts: 99
Re: wxsim forecast script missing icon
« Reply #8 on: November 15, 2018, 01:16:59 PM »
I know that's the only plaintext.txt that I am uploading, so yes that's the one I attached

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxsim forecast script missing icon
« Reply #9 on: November 15, 2018, 02:15:07 PM »
I can't reproduce the error on either of my test sites using the current plaintext-parser.php and your plaintext.txt :(

Can you post the code for wxsimforecast.php from your site?  I notice that http://www.towandawx.com/weather/plaintext-parser.php does post the correct icons (albeit with images set to /forecast/images/ instead of ./forecast/images/), so I'm suspecting that a different script is being used by the wxsimforecast.php page resulting in the strange 23.jpg icon.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: wxsim forecast script missing icon
« Reply #10 on: November 15, 2018, 03:49:17 PM »
@ken

Maybe  it is in the words "Little or no snow or ice (on ground)" later on that selects SLEET =>  wd icon 23
Code: [Select]
<!-- WXSIMtext[4]='Dense overcast. A slight chance of a mix of rain, snow, and sleet in the morning, then a chance of a mix of snow and rain in the afternoon.
High 38&deg;. Wind east-southeast around 2 mph in the morning, becoming northeast around 7 mph, gusting to 15 mph, in the afternoon.
Chance of precipitation 50 percent.
Precipitation (liquid equivalent) mostly around a tenth of an inch. Little or no snow or ice (on ground) accumulation expected.' -->
<!-- check 'tornado' -->
<!-- check 'thunder' -->
<!-- check 'ice' -->
<!-- ice / Sleet selected -->
some script is using this "old" translation table:
Code: [Select]
$Condstring = '
#
cond|tornado|32|32|Severe storm|
cond|thunder|31|17|Thunder storm|
cond|ice|23|23|Sleet|
cond|snow|25|16|Snow|
cond|freezing rain|23|23|FrzgRn|
cond|freezing drizzle|23|23|FrzgRn|
Wim
« Last Edit: November 15, 2018, 04:13:13 PM by wvdkuil »

Offline Mchd17

  • Senior Member
  • **
  • Posts: 99
Re: wxsim forecast script missing icon
« Reply #11 on: November 15, 2018, 05:58:10 PM »
Here ya go, wsximforecast.php from dir of my Saratoga template site

Code: [Select]
<?php
############################################################################
# A Project of TNET Services, Inc. and Saratoga-Weather.org (Canada/World-ML template set)
############################################################################
#
#   Project:    Sample Included Website Design
#   Module:     sample.php
#   Purpose:    Sample Page
#   Authors:    Kevin W. Reed <kreed@tnet.com>
#               TNET Services, Inc.
#
Copyright: (c) 1992-2007 Copyright TNET Services, Inc.
############################################################################
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
############################################################################
# This document uses Tab 4 Settings
############################################################################
require_once("Settings.php");
require_once(
"common.php");
############################################################################
$TITLE langtransstr($SITE['organ']) . " - " .langtransstr('WXSIM Forecast');
$showGizmo true;  // set to false to exclude the gizmo
include("top.php");
############################################################################
?>

</head>
<body>
<?php
############################################################################
include("header.php");
############################################################################
include("menubar.php");
############################################################################
?>


<div id="main-copy">
 
         <?php 
 if($SITE['WXSIM']) {
   $doInclude    = true// handle ec-forecast and WXSIM include also
   $showIconsMax 8;
   include_once($SITE['WXSIMscript']);
 } else {
   print "<p>".langtransstr('WXSIM Forecast is not available').".</p>\n";
 } ?>

</div><!-- end main-copy -->

<?php
############################################################################
include("footer.php");
############################################################################
# End of Page
############################################################################
?>

« Last Edit: November 15, 2018, 06:20:47 PM by Mchd17 »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxsim forecast script missing icon
« Reply #12 on: November 15, 2018, 07:07:04 PM »
Thanks for that, in Settings.php you have
Code: [Select]
$SITE['WXSIMscript']     = 'plaintext-parser.php'; // script for decoding plaintext.txt into icons
so the plaintext-parser.php at http://www.towandawx.com/weather/plaintext-parser.php is what is loaded.

Your script has
Code: [Select]
$plaintextFile = '/home/mckinn14/public_html/template/plugins/wxSim/WXSim/plaintext.txt';       // location of the WXSIM plaintext.txt
and since that's not in the /weather/ document tree, I can't check it.
The script also does
Code: [Select]
$config = file("./plaintext-parser-data.txt");  //
to load the plaintext-parser-data.txt file (http://www.towandawx.com/weather/plaintext-parser-data.txt) and NOWHERE in there is a spec for 23.jpg as a 'sleet' icon. 

Still baffled as to why it is doing this on your site (but can't be reproduced).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Mchd17

  • Senior Member
  • **
  • Posts: 99
Re: wxsim forecast script missing icon
« Reply #13 on: November 15, 2018, 07:48:12 PM »
ok, i have uploaded a plaintext.txt into my weather dir, changed my script to this

Code: [Select]
/home/mckinn14/public_html/towandawx/weather/plaintext.txt
still no sleet image
« Last Edit: November 15, 2018, 07:51:57 PM by Mchd17 »

Offline Mchd17

  • Senior Member
  • **
  • Posts: 99
Re: wxsim forecast script missing icon
« Reply #14 on: November 15, 2018, 08:13:51 PM »
Only other script on site is the Davis Live View consoles, feeding from meteobridge. The script I found here on these forums. And it's a fairly fresh template install.

Just a thought.....how about if I save ip.jpg as 23.jpg and upload to /forecast/images

That's an easy way out. And if there are updates, it'll happen again. I am thinking out loud  :lol:

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxsim forecast script missing icon
« Reply #15 on: November 15, 2018, 09:19:57 PM »
In plaintext-parser.php, I'd suggest you change
Code: [Select]
$iconDir ='/forecast/images/';           // directory for carterlake icons
$iconType = '.jpg';        // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/
$WXSIMstation = "McKinneyFarm";   // name of your weather station
$plaintextFile = '/home/mckinn14/public_html/towandawx/weather/plaintext.txt';       // location of the WXSIM plaintext.txt
to
Code: [Select]
$iconDir ='./forecast/images/';           // directory for carterlake icons
$iconType = '.jpg';        // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/
$WXSIMstation = "McKinneyFarm";   // name of your weather station
$plaintextFile = './plaintext.txt';       // location of the WXSIM plaintext.txt

Then running http://www.towandawx.com/weather/plaintext-parser.php should show either the correct icon, or not-and we'll have a way to debug that.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Mchd17

  • Senior Member
  • **
  • Posts: 99
Re: wxsim forecast script missing icon
« Reply #16 on: November 15, 2018, 09:26:23 PM »
done.....still no icon, grrrrrrrr

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxsim forecast script missing icon
« Reply #17 on: November 15, 2018, 09:37:35 PM »
Ok.. I think I found the source of the interference with plaintext-parser.php and the template.
Both get-metar-conditions-inc.php and plaintext-parser.php use a $Conditions array to store stuff, and they have different stuff.. d'oh.

The debug output shows the 'ice' match in the get-metar-conditions-inc.php but not in the plaintext-parser.php.  So the 23.jpg is coming from the interfering $Conditions definition.  Only happens within the template, and not 'standalone'.

Try changing plaintext-parser.php
Code: [Select]
reset($config);
// $Status .= "<!-- config: \n" . print_r($config,true) . " -->\n";
to
Code: [Select]
reset($config);
$Conditions = array(); // ensure initialization
// $Status .= "<!-- config: \n" . print_r($config,true) . " -->\n";
« Last Edit: November 15, 2018, 09:39:18 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Mchd17

  • Senior Member
  • **
  • Posts: 99
Re: wxsim forecast script missing icon
« Reply #18 on: November 15, 2018, 09:45:50 PM »
woohoo!!! That worked!  =D&gt; =D&gt;

Thanks Ken, donation headed your way, for your template and your help.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxsim forecast script missing icon
« Reply #19 on: November 15, 2018, 09:48:40 PM »
Wow, that was a tough one to find.. I've not changed the plaintext-parser.php code since 30-Dec-2013 so that's the first time this omission on my part has surfaced.  Thanks for sticking with the diagnostics, and you're very welcome.

I'll be distributing a change to plaintext-parser.php with this fix.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP