Welcome to Geeklog, Anonymous Tuesday, July 16 2024 @ 08:41 am EDT

Geeklog Forums

Weather Plugin -- broken images on 7 day forcast page


i0scan

Anonymous
confused
I have had my newly installed and tweeked geeklog site up for about 3 weeks now and everything has run without a hitch until now. I having trouble with the "weather plugin". It was running normally but now it is not downloading the 7 day forcast pictures. (just the small ones for "partly cloudy", etc) All that appears in their place is a broken link image icon. I have changed the METAR, flushed the cache, ran connectivity and speed tests and everything functions correctly (and fast). Has any one had this problem or heard of this problem? What can I do to fix it or how can I determine why this isn't functioning correctly? Thanks in advance for all of the help / advice any of you can offer.

Regards,
i0scan
 Quote

pfaustino

Anonymous
I was having this problem too but I fixed it, well sorta.

OK, OK this is such a bad workaround that I wouldn't call it a hack.

This is not meant to be a permanent fix but it will do for now until someone posts the correct code changes.

I viewed the properties of the missing images and found that they resided on

/images/HW3php/images/fcicons/

So I just created that folder and COPIED, not moved, the images from under /weather/images/* into this new folder.



Embarassed Embarassed Embarassed
 Quote

i0scan

Anonymous
Thank you! I haven't had the time to fix it until today. I actually just found the same "hack" and wanted to follow up with a new post and you have already posted it for me! Thanks!
 Quote

Status: offline

ChrisF

Forum User
Junior
Registered: 10/07/04
Posts: 17
Looks like the following code is getting executed:

Text Formatted Code

If ($_GW_replace_title_images)
{
  $html = replace_titleimages($html);
} ELSE {
  $html = str_replace( 'src="/weather/images/fcicons/','src="' . $_GW_sw_iconpath.'/', $html );
}
return $html;

 



The path being used for my missing icons on the "Forecast at a glance" is "/ifps/text/images" which doesn't exist on my site.

I'm going to try to quick fix from above, I just can't see where the /ifps/... is getting loaded.
 Quote

Status: offline

ChrisF

Forum User
Junior
Registered: 10/07/04
Posts: 17
There are also some jpg's not included that it's looking for.

nsn30.jpg.

I just installed it yesterday, and all the icons were ok, even the ones that had the 30 in the corner.
 Quote

Status: offline

ChrisF

Forum User
Junior
Registered: 10/07/04
Posts: 17
Looking at this a little more, there's a variable getting populated with my site and then the /ifps/text/images

It shouldn't be using my site, it should be www.crh.noaa.gov/ifps/text/images.

I'm just not sure what to change in order to keep the www.crh.noaa.gov from being overwritten.

There are references to www.srh.noaa.gov as well, but I think that's an alias for www.crh.noaa.gov. If you go to srh, and look up your zip code, it flips it to crh.

Gonna keep looking to see where to change this code.
 Quote

jamgill

Anonymous
Wow ... pulling icons from the noaa.gov site every time? YUCK!

Not only is that slow and undependable, it's bad net-citizenship. That's even worse if you're a US taxpayer, who is ultimately footing the bill for the NOAA.

Please post if you figure out where the 'ifps' is coming from. Very frustrating indeed.
 Quote

jamgill

Anonymous
Simple fix is to dump the existing weather plugin and download the newer version from the http://squatty.com, remove the version you've got, and use the updated version.

http://www.squatty.com/filemgmt/singlefile.php?lid=214

because
weather_1.0_1.3.8.tar.gz (which you can download from the geeklog site)
is NOT equal to
weather_2.0_1.3.8.tar.gz (which you can download from the squatty site)

For WHY you can't downlad the updated version, see the squatty article about why he started the squatty site in the first place. Note that the author is no longer updating his work for geeklog stuff, including themes and plugins.

That means that someone should pick up development of this plugin and include a way to download the thumbnails from the NOAA website once as part of the install process (at least include a 'wget --mirror' command in the install notes if not some kind of long-lived cache for those thumbs on the local system).

Also, I had one spot of trouble installing this plugin when I used phpMyAdmin to install the forecast.sql file. I believe the 7.7MB file size is too big for my php upload configuration. The notes in the readme text file (not included in the readme.php) reminded me of the correct mysql commands to do it on the command line. The stations.sql installed via phpMyAdmin with no problem.
 Quote

Status: offline

abrosam

Forum User
Newbie
Registered: 03/22/05
Posts: 3
Quote by ChrisF: Looks like the following code is getting executed:

Text Formatted Code

If ($_GW_replace_title_images)
{
  $html = replace_titleimages($html);
} ELSE {
  $html = str_replace( 'src="/weather/images/fcicons/','src="' . $_GW_sw_iconpath.'/', $html );
}
return $html;








 



The path being used for my missing icons on the "Forecast at a glance" is "/ifps/text/images" which doesn't exist on my site.

I'm going to try to quick fix from above, I just can't see where the /ifps/... is getting loaded.


I have fixed this for my site -- I added this line (at line 90) to my weather/index.php:
Text Formatted Code

$html = str_replace( 'src="/ifps/text/images/','src="' . $_GW_sw_iconpath.'/', $html );







 


This produces the following code:
Text Formatted Code

If ($_GW_replace_title_images)
{
  $html = replace_titleimages($html);
  $html = str_replace( 'src="/ifps/text/images/','src="' . $_GW_sw_iconpath.'/', $html );
} ELSE {
  $html = str_replace( 'src="/weather/images/fcicons/','src="' . $_GW_sw_iconpath.'/', $html );
}
return $html;
}







 


For those who want to know -- what this file does is go to the NWS website for the metar you want and grabs the resulting html -- it then parses through it, cleaning up the code a bit. The original html page has images located at "/ifps/text/images", so that is where that is coming from. My line simply takes that path and replaces it with the icon path for your server, stored by the $_GW_sw_iconpath variable. Not bad for someone who's never used php before, eh?

I was also missing the following icons:

rasn30.jpg
nsn30.jpg
 Quote

David Nelson

Anonymous
The final solution on this appears to be upgrading to version 2.0 found on www.squatty.com.

For me, I was limited to 2mb sql files to run against my database so I had to split the forecast.sql into several parts.

One last fix I had to correct was the location of the watch and warnings icon. $WWA_IMAGE_SM = "http://www.nws.noaa.gov/wwamap/png/us.png in config.php
 Quote

All times are EDT. The time is now 08:41 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content