phpweather-devel Mailing List for PHP Weather (Page 8)
Brought to you by:
iridium
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(4) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(2) |
Feb
(52) |
Mar
(79) |
Apr
(9) |
May
(28) |
Jun
(17) |
Jul
(25) |
Aug
(48) |
Sep
(18) |
Oct
(6) |
Nov
|
Dec
(8) |
2003 |
Jan
(26) |
Feb
(10) |
Mar
(2) |
Apr
(21) |
May
(23) |
Jun
(15) |
Jul
(15) |
Aug
(8) |
Sep
(16) |
Oct
(3) |
Nov
(4) |
Dec
|
2004 |
Jan
(35) |
Feb
(35) |
Mar
(9) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(3) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(4) |
Feb
(6) |
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
2006 |
Jan
|
Feb
(5) |
Mar
(7) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Mike M. <mi...@dm...> - 2003-07-24 03:28:44
|
I am getting the following error in make_config.php: Fatal error: Call to a member function on a non-object in . . . . /weather/config/make_config.php on line 339 Any suggestions? |
From: Martin G. <gim...@gi...> - 2003-07-22 20:53:46
|
Geoff <ge...@sh...> writes: > It always tells me that data isn't available, no matter what station > I select (using the test.php file)...and if I look at the phpWeather > homepage (http://phpweather.sourceforge.net/index.php) , it does the > same thing.....is there a problem with the METAR files? No, not at my own site http://gimpster.com/. The SourceForge site doesn't work because of the firewall at SF: one cannot connect to the outside world from within SF. Try making a PHP file with just <?php include('http://cnn.com/'); ?> and see if the page loads with the text from CNN (the images will probably not work because all the relative paths will point to your server). If it doens't work, then the so-called fopen wrappers isn't engaged in your installation of PHP. You can try with the alternative fsockopen() function call in PhpWeather. Just set the fetch_method property to 'fsockopen' in the Configuration builder. This should take care of things if the file() function is blocked but fsockopen() isn't. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. |
From: Geoff <ge...@sh...> - 2003-07-22 18:51:39
|
It always tells me that data isn't available, no matter what station I select (using the test.php file)...and if I look at the phpWeather homepage (http://phpweather.sourceforge.net/index.php) , it does the same thing.....is there a problem with the METAR files? |
From: SourceForge.net <no...@so...> - 2003-07-22 18:17:24
|
Feature Requests item #775781, was opened at 2003-07-22 14:17 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377955&aid=775781&group_id=23245 Category: Databases Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jonathan Dewey (lifetap) Assigned to: Nobody/Anonymous (nobody) Summary: Long term historical data - sql Initial Comment: I was wondering about adding in long term storage of fetched METAR data. I think it could be useful to be able to pull up data from previous dates for comparison and/or be able to do trending. There are many possible ways to do it, but I was thinking to have a selectable feature that enables a seperate module. For example I want to enable trending for ICAO KRDU. Using sql this would create a table Trend-KRDU or such, (would be same for flat file thou larger and slower). The module would run on an hourly cron as to not miss any data, and would insert metar, timestamp, etc, into both the currently used cache table and the ICAO trend table. It might be easier to put the decoded metar info into the trend table, that would make searching a little easier. From there record highs and lows, strongest winds, you name it, would be available with basic searches. Just a thought, I have been trending my local weather using metar.pl and mrtg, but I can' look for a specific day, etc. This looks to be a great program so far, keep up the great work. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377955&aid=775781&group_id=23245 |
From: Christian D. <chr...@da...> - 2003-07-20 11:03:36
|
Hi, I'm looking forward to see the new version, please let me know when it is live:-) BTW: would be great to see links to live working PHP weathers out there, let me chip in with a link for a start, maybe someone else would like to send a link to the list? Anyway, here is the link for a Faroese portal where I work not many days ago: http://vitin.fo/?P=weather Regards, Chris Chr...@da... http://dalsgaard.info -----Original Message----- From: php...@li... [mailto:php...@li...] On Behalf Of php...@li... Sent: 19. juli 2003 04.21 To: php...@li... Subject: PHPWeather-devel digest, Vol 1 #179 - 1 msg Send PHPWeather-devel mailing list submissions to php...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/phpweather-devel or, via email, send a message with subject or body 'help' to php...@li... You can reach the person managing the list at php...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of PHPWeather-devel digest..." Today's Topics: 1. It's pretty quiet in here... (Martin Geisler) --__--__-- Message: 1 To: php...@li... Subject: It's pretty quiet in here... From: Martin Geisler <gim...@gi...> Date: Fri, 18 Jul 2003 23:35:51 +0200 Hi everybody! It's getting awfully quiet here --- let's see if it's because the list has stopped working, or if it's just because everybody is enjoying the summer. More on topic: I hope to have a new release of PhpWeather ready some time soon: there's an Italian translation, new (much better-looking) icons and XML output in the works. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. --__--__-- _______________________________________________ PHPWeather-devel mailing list PHP...@li... https://lists.sourceforge.net/lists/listinfo/phpweather-devel End of PHPWeather-devel Digest |
From: Martin G. <gim...@gi...> - 2003-07-18 21:36:14
|
Hi everybody! It's getting awfully quiet here --- let's see if it's because the list has stopped working, or if it's just because everybody is enjoying the summer. More on topic: I hope to have a new release of PhpWeather ready some time soon: there's an Italian translation, new (much better-looking) icons and XML output in the works. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. |
From: Mike K. <mkr...@hs...> - 2003-06-25 20:51:15
|
Hello Folks, I just joined the project. I sent Martin an email the other day telling him that I had extended PHPWeather to output XML. It was fairly quick and easy. I just duplicated pw_text and modified the pretty_prints to be wellformed XML, seperated a few out, and added the XML type header. Now the obstacle is, implementing this in a way that everyone feels is correct and maintainable - if desired. Martin sent me some suggestions already. If anyone has thoughts (querystring param, defaults-dist var, etc...) let me know. Right now I have changed the line in pw_text_en.php to include pw_xml.php(file I created) instead of pw_text.php. An example of the output can be found here: http://www.mikekrisher.com/phpweather/phpweather-2.1.2/index_xml.php?icao=KL UK&language=en In case your wondering, I built this real quick so I could use the data in a Flash movie. -- Mike Krisher http://www.mikekrisher.com mailto:mi...@mi... |
From: Martin G. <gim...@gi...> - 2003-06-22 12:53:39
|
Aqa...@ao... writes: > Apparently all the files appear to be there, and the permissions > appear to be in place as well, Hmm, that's strange then. > I know the host utilizes php 4, and my site is ready to use any php > program, I also have a db, which I dont understand to use one, so > maybe I am supposed to use a db? No, there's no need to play with using a database before PhpWeather works. > I have access to ftp site, but i have a db username and > password..but I dont know how to use a db. So I presume I have to > ftp to my db? if so how do I do that? and what files do I put in > their? No, no, you access a database using a query language, most probably SQL. The interfacing is done by PhpWeather, you can take a look at the db/pw_db_mysql.php file to see some SQL statements such as $this->query('DROP TABLE IF EXISTS ' . $this->properties['db_metars']); which cleans the database if necessary before creating a new table for hte data with $this->query('CREATE TABLE ' . $this->properties['db_metars'] . '( icao char(4) NOT NULL, metar varchar(255) NOT NULL, timestamp timestamp(14), PRIMARY KEY (icao), UNIQUE icao (icao))'); and so on. There's much information about SQL on the web, see http://www.w3schools.com/sql/default.asp for a tutorial. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. |
From: Martin G. <gim...@gi...> - 2003-06-22 12:23:21
|
Aqa...@ao... writes: > Thank you martin, i will try and check what the file states., and i > will report back any faults or findings.. Okay. > you know it would be a great idea, to be able get phpweather boxed > and immediately ready to use, for novices like us, so we can just > pop the program onto our webpages, and if there are any updates we > can just get the relevant file and reload it over the original.. But PhpWeather is ready to use straight out of the zipfile/tarball. At least it's supposed to be :-) And when a new version arrives you just unpack it over your old installation. This will preserve any defaults.php file you might have made with your own defaults (such as your default station, your database password etc.) -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. |
From: <Aqa...@ao...> - 2003-06-22 11:44:40
|
Apparently all the files appear to be there, and the permissions appear to be in place as well, i know the host utilizes php 4, and my site is ready to use any php program, i also have a db, which i dont understand to use one, so maybe i am supposed to use a db? i have access to ftp site, but i have a db username and password..but i dont know how to use a db. So i presume i have to ftp to my db? if so how do i do that? and what files do i put in their? |
From: <Aqa...@ao...> - 2003-06-22 11:28:53
|
Thank you martin, i will try and check what the file states., and i will report back any faults or findings..you know it would be a great idea, to be able get phpweather boxed and immediately ready to use, for novices like us, so we can just pop the program onto our webpages, and if there are any updates we can just get the relevant file and reload it over the original..i tyhink this as been said a couple times before. |
From: Martin G. <gim...@gi...> - 2003-06-21 19:26:25
|
Aqa...@ao... writes: > Warning: Unable to access > /users/iwebland.com/weather/wwx/weather/db/files/stations.db in /users/iwebland.com/weather/wwx/weather/db/pw_db_null.php on line > 113 [...] > Fatal error: Call to undefined function: fsockopen() in > /users/iwebland.com/weather/wwx/weather/data_retrieval.php on line 149 > > so again, please tell what can i do about this? The errors tells us that several key files are missing --- did you upload the entire phpweather directory to your server? You should try and navigave to <phpweather base directory>/db/files and see if the stations.db file is there. If the file is there, then perhaps there's a problem with the permissions on the files. The files must be readable by PHP (which means that the webserver must be able to read them). You can see the permissions with a 'ls -l' command in your FTP program, you should see something like this ncftp ...weather-2.1.0/db/files > ls -l -rw-r--r-- 1 gimpster nobody 415 jan 2 15:57 AE.php -rw-r--r-- 1 gimpster nobody 343 jan 2 15:58 AF.php -rw-r--r-- 1 gimpster nobody 208 jan 2 15:58 AG.php [...] -rw-r--r-- 1 gimpster nobody 213 jan 2 15:59 SO.php -rw-r--r-- 1 gimpster nobody 151 jan 2 15:58 SR.php -rw-r--r-- 1 gimpster nobody 656768 jan 2 15:59 stations.db [...] Tell us what you see and we'll try and find a solution. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. |
From: <Aqa...@ao...> - 2003-06-20 23:03:40
|
I am sorry this is what it said..the ending of the code..was a bit strange until i noticed hotfreebies..which is another pop up banner from the host..lol here is the full details including metar info Test page You can use this page to test a specific METAR report. Enter the report below, select a language and see how PHP Weather handles the report: Metar: KAGS 200553Z 09003KT 5SM BR CLR 23/22 A2985 RMK AO2 SLP105 T02330222 10289 20233 55002 000 Language: British/American Warning: Unable to access /users/iwebland.com/weather/wwx/weather/db/files/stations.db in /users/iwebland.com/weather/wwx/weather/db/pw_db_null.php on line 113 Warning: fopen("/users/iwebland.com/weather/wwx/weather/db/files/stations.db","r") - No such file or directory in /users/iwebland.com/weather/wwx/weather/db/pw_db_null.php on line 113 Warning: stat failed for /users/iwebland.com/weather/wwx/weather/db/files/stations.db (errno=2 - No such file or directory) in /users/iwebland.com/weather/wwx/weather/db/pw_db_null.php on line 114 Warning: Supplied argument is not a valid File-Handle resource in /users/iwebland.com/weather/wwx/weather/db/pw_db_null.php on line 139 Fatal error: Call to undefined function: fsockopen() in /users/iwebland.com/weather/wwx/weather/data_retrieval.php on line 149 so again, please tell what can i do about this? i dont understand this. it is the same if i change the test page to index.php i get warnings fsockopen ...and this seems to be a major problem there. and then it will say cannot get metar from nws.noaa.gov..what can i do about this? your urgent reply would be most appreciated, thank you again. |
From: <Aqa...@ao...> - 2003-06-20 22:01:41
|
If you come to my home page, i am just submitting the php script to the test= =20 page, in its own window...you'll see what i mean...please go to <A HREF=3D"w= ww.weather.iwebland.com"> www.weather.iwebland.com</A> and look for weather test link...this is what h= appened when i put a=20 metar into the box. Warning: Unable to access=20 /users/iwebland.com/weather/wwx/weather/db/files/stations.db in /users/iwebl= and.com/weather/wwx/weather/db/pw_db_null.php on line=20 113 Warning:=20 fopen("/users/iwebland.com/weather/wwx/weather/db/files/stations.db","r") -=20= No such file or directory in=20 /users/iwebland.com/weather/wwx/weather/db/pw_db_null.php on line 113 Warning: stat failed for=20 /users/iwebland.com/weather/wwx/weather/db/files/stations.db (errno=3D2 - No= such file or directory) in=20 /users/iwebland.com/weather/wwx/weather/db/pw_db_null.php on line 114 Warning: Supplied argument is not a valid File-Handle resource in=20 /users/iwebland.com/weather/wwx/weather/db/pw_db_null.php on line 139 Fatal error: Call to undefined function: fsockopen() in=20 /users/iwebland.com/weather/wwx/weather/data_retrieval.php on line 149 win155 =3D window.WYwx('','cons723'); win155.blur();self.focus();var url=20= =3D=20 "http://" + self.location.host;var file =3D "/locmntl/hotfreebies.html";if=20 (win155.document.URL.indexOf(url) =3D=3D -1)=A0=A0=A0=20 {=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=20 win155.location.href =3D url + file;=A0=A0=A0=A0=A0=A0 } now what does all this mean?? I am very curious as to why this occured? i have uploaded all the files as one main file to my webserver which support= s=20 php 4. the same thing happens with the index.php page, very similiar errors. Could some one please explain what the problem is?? i am new to php and am a= t=20 a loss here. Please tell me what i am supposed to? Thank you. |
From: Nick B <nic...@ya...> - 2003-06-15 14:21:26
|
>>interesting that the UK have different METAR coding rules than >>everyone else. You'd have expected ICAO to have standardised it >>all. Though I guess getting everyone to agree on something might be >>a tad optimistic ;) >> >> I just checked the on-line FMH-1, the US version but as it is 1995 it may well have been updated. I've also got some information on Canadian reporting, but thats in the office. Will check in a few days time. >Yes, this doesn't make things any easier for projects like this >one... Thanks (to both of you) for pointing this out. > > > Thanks Martin, if anyone wants to check, EGNM is still without dewpoint. I've also got my own perl script that decodes metars at http://www.nowindows.net/cms/wxstuff.php (Must tidy it up and release it for public consumption sometime.) Nick. |
From: Martin G. <gim...@gi...> - 2003-06-14 23:41:56
|
Tom McDonald <to...@un...> writes: > Ahhhh I see. So it's a bug with PHPWeather's handling of the METAR feed. Oh no, a bug?! :-) I believe I've fixed this now with this very simple fix around line 447 in phpweather.php: - } elseif (ereg('^(M?[0-9]{2})/(M?[0-9]{2})?$', $part, $regs)) { + } elseif (ereg('^(M?[0-9]{2})/(M?[0-9]{2}|//)?$', $part, $regs)) { ... - if (!empty($regs[2])) { + if (!empty($regs[2]) && $regs[2] != '//') { It simply makes the 'xx///'-case the same as the 'xx/'-case that PhpWeather already handles. > Interesting that the UK have different METAR coding rules than > everyone else. You'd have expected ICAO to have standardised it > all. Though I guess getting everyone to agree on something might be > a tad optimistic ;) Yes, this doesn't make things any easier for projects like this one... Thanks (to both of you) for pointing this out. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. |
From: Tom M. <to...@un...> - 2003-06-14 20:54:19
|
Ahhhh I see. So it's a bug with PHPWeather's handling of the METAR feed. Interesting that the UK have different METAR coding rules than everyone else. You'd have expected ICAO to have standardised it all. Though I guess getting everyone to agree on something might be a tad optimistic ;) Thanks for the reply, anyway. Tom > From: Nick B <nic...@ya...> > Date: Sat, 14 Jun 2003 16:48:49 +0100 > To: php...@li... > Subject: Re: Problem when there's no dew-point > > Tom McDonald wrote: > >> I assume that Leeds Bradford Airport are returning their metar reports in >> the wrong format, and should just be returning "18/" if they are not >> including dew point rather than "18///". >> >> >> > Thats the correct format Tom. The UK METAR coding rules say that if dew > point is not available the it should be replaced by a double ellipsis > "//". I must have a word with my friends in ATC Engineering there and > ask them to fix it ;-) > > > To quote from UK AIP GEN 3.5.10: > ----snip---- > 9 Air Temperature/Dewpoint > 9.1 These are given in Degrees Celsius, M indicates a negative value . > Examples 10/03, 01/M01. > > If the dew point is missing, the temperature would be reported as > 10/// > ----unsnip---- > > If anyone would like access to the UK AIP you can register for free at > http://www.ais.org.uk/ . Publications are available in PDF format. > > Regards, > Nick B. > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: eBay > Great deals on office technology -- on eBay now! Click here: > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > _______________________________________________ > PHPWeather-devel mailing list > PHP...@li... > https://lists.sourceforge.net/lists/listinfo/phpweather-devel |
From: Nick B <nic...@ya...> - 2003-06-14 15:41:57
|
Tom McDonald wrote: >I assume that Leeds Bradford Airport are returning their metar reports in >the wrong format, and should just be returning "18/" if they are not >including dew point rather than "18///". > > > Thats the correct format Tom. The UK METAR coding rules say that if dew point is not available the it should be replaced by a double ellipsis "//". I must have a word with my friends in ATC Engineering there and ask them to fix it ;-) To quote from UK AIP GEN 3.5.10: ----snip---- 9 Air Temperature/Dewpoint 9.1 These are given in Degrees Celsius, M indicates a negative value . Examples 10/03, 01/M01. If the dew point is missing, the temperature would be reported as 10/// ----unsnip---- If anyone would like access to the UK AIP you can register for free at http://www.ais.org.uk/ . Publications are available in PDF format. Regards, Nick B. |
From: Tom M. <to...@un...> - 2003-06-14 12:43:07
|
Hello PHPWeather doesn't seem to like Leeds Bradford Airport's (EGNM) metar reports at the moment. Since about 14:00 GMT on Friday they stopped including the dew point temperature on the metars. Eg. 2003/06/14 11:50 EGNM 141150Z 12005KT 040V210 9999 FEW038 SCT080 18/// Q1023 The "18///" bit. The 18 represents the temperature, but there should be another figure in place of the last two "//". PHPWeather doesn't like this. I can understand it not returning a value for dew point, but it doesn't return a value for the temperature either. It just ignores all temperature readings. I assume that Leeds Bradford Airport are returning their metar reports in the wrong format, and should just be returning "18/" if they are not including dew point rather than "18///". Any ideas? Tom |
From: Alessandro S. <al...@re...> - 2003-06-05 21:33:09
|
hello, I am italian. May english is very bad. i have phpweather. today at time 17:50, phpweather=20 not process $data=3Dprocess_metar("$station") return null string why? but another problem this program non function <? //////////////////////// stazioni formato file bitline = /////////////////// $file =3D = @file('http://weather.noaa.gov/pub/data/observations/metar/stations/LIML.= TXT'); if (is_array($file)) { $metar =3D trim(implode(' ', $file)); } //print "----------------------------------------------------"; print $metar; //print "----------------------------------------------------"; print "<br><br>"; thank's |
From: Eric C. <er...@n6...> - 2003-06-02 00:33:03
|
Hola, gutten tag, hello peeps, I tweaked the results to look more like = http://www.stpatrickhighschool.org/weather/ Example: http://www.aaadiscountstorage.com/testing/test1.php I know it isn't perfect and still has a few tiny bugs, but hey, I was = lucky to get this :-) If ya'll want I can clean-up the code a little and post it for d/l. = BUT, this script in it's present state is LIMITED !! I don't know = enough about PHP to extend it anymore (but i'm sure some of you can). So, what do ya think? P.S. Can anyone help me straighten out my icons? I had a moon showing = at 2:00p PST ....... :-\ Eric |
From: Gyulai Miha'l. <gy...@fb...> - 2003-05-28 18:03:41
|
David Kjellquist =EDrta, 2003-05-25, 11:05-kor kelt level=E9ben, ami 25 sorb=F3l =E1llt: > Opening index.php in the 2.1.2 directory with Mozilla only gets me a > web page with most of the script shown as text!! You have to install and run some kind of webserver program=20 (like Apache), and of course PHP! The webserver needs to have PHP-support. =20 I don't know RedHat well, so I cannot suggest what you have to select when you install the webserver and PHP, but you need them both. When you wish to try the 'phpweather' program, the webserver should be running. If the webserver already running, you can view it with Mozilla with the URL 'localhost'.=20 (the webserver usually needs an 'index.html' file to work properly) --=20 Gyulai Mih=E1ly http://gyulai.freeyellow.com/ http://counter.li.org/ Minden Linux felhaszn=E1l=F3 sz=E1m=EDt! =20 Ne csak egyszer=FBen higgy a csod=E1kban; t=E1maszkodj r=E1juk. |
From: David K. <da...@kj...> - 2003-05-25 15:05:19
|
Need a little help to solve probably a dumb error. I have been running phpweather 2.0 on a RH 7.3 server very successfully for months. Upgraded server h/w and created a fresh install of RH 9.0. Downloaded ver 2.1.2 into my server web directory Now the strange behavior Opening index.php in the 2.1.2 directory with Mozilla only gets me a web page with most of the script shown as text!! Thanks for any help |
From: Martin G. <gim...@gi...> - 2003-05-12 22:38:29
|
Dan Martin <da...@da...> writes: > I have figured out after struggling a bit how to pull most of the > information in 2.1.2, but I am still having difficulties pulling > "Clouds" and "Weather." I know that the information is in an array, > but I am unclear on how to bring it out of the array. > > I also cannot seem to pull wind direction (SW, NW, W), but I can > pull the compass degree (135, 90, 110). > > > Here is the code: > > > $weather = new phpweather(); > $icons = new pw_images($weather); > $location = $weather->get_location(); > $image = $icons->get_sky_image(); > $data = $weather->decode_metar(); > $temp = $data[temperature]; > $windvar = $data[wind]; <-----This Doesn't Work > $cloudvar = $data[clouds]; <-----This Doesn't Work > $time = date("m/d/y g:i a",($data[time])); > $weathervar = $data[weather]; First of all, please remember to use strings when you index into an array. Like this: $var = $some_array['some index']. The other way is deprecated... To see the structure of the array do this: echo "<pre>\n"; print_r($data); echo "</pre>\n"; Then you'll see that $data['wind'] is yet another array that contains up to eight entries depending on the weather. You'll always find these entries: $data['wind']['deg']; // Wind direction in degrees $data['wind']['knots']; // Wind speed, knots. $data['wind']['miles_per_hour']; // Wind speed, miles per hour. $data['wind']['meters_per_second']; // Wind speed, m/s. If there are gusts, then you'll find these entries as well: $data['wind']['gust_knots'] $data['wind']['gust_meters_per_second'] $data['wind']['gust_miles_per_hour'] Finally, the wind might be varying between two directions: $data['wind']['var_beg'] $data['wind']['var_end'] As for the $data['clouds'] entry, then this is an array of arrays. The first entry is the first cloud-layer, the second entry is the layer above etc. So $data['clouds'][0]['condition'] could be FEW if there were few clouds in the first layer. The altitude of this layer is $data['clouds'][0]['metar'] or $data['clouds'][0]['ft']. The second layer (if there is such a layer) is stored at $data['clouds'][1]. You'll notice that the data in $data is language-neutral. You'll have to provide your own strings for N, NW, W etc when you parse the data. The best way would probably be to make a new method in pw_text.php and then reuse the strings and other methods that are already present there. If you come up with a good extenstion of pw_text.php, then please send it to the list so that it can become part of the distribution. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. Join Freenet: http://gimpster.com/downloads/freenet/ |
From: Pedro L. <li...@le...> - 2003-05-12 17:12:51
|
Hey Dan, On Mon, May 12, 2003 at 09:54:00AM -0700, Dan Martin wrote: > I have figured out after struggling a bit how to pull most of the > information in 2.1.2, but I am still having difficulties pulling > "Clouds" and "Weather." I know that the information is in an array, but > I am unclear on how to bring it out of the array. I had a problem where the METAR info that is pulled from the site and imported into the database went stale and wouldn't refresh. Anyone have the same issue? Maybe I didn't configure it right, but I do remember setting a timeout or expiration time. > > I also cannot seem to pull wind direction (SW, NW, W), but I can pull > the compass degree (135, 90, 110). I had this same issue when I was playing with 2.1.2. What I actually printed all the values in the array and see what info I could sort out and pull, but I couldn't find wind info. I'm going to play with 2.1.2 now and see what I can do with it. -Pedro > > > Here is the code: > > > $weather = new phpweather(); > $icons = new pw_images($weather); > $location = $weather->get_location(); > $image = $icons->get_sky_image(); > $data = $weather->decode_metar(); > $temp = $data[temperature]; > $windvar = $data[wind]; <-----This Doesn't Work > $cloudvar = $data[clouds]; <-----This Doesn't Work > $time = date("m/d/y g:i a",($data[time])); > $weathervar = $data[weather]; > > > echo "\n"; > echo "<div align='center'> > Portland, Oregon<br /> > <img src=\"$image\" height='45' width='75' border='0' alt='Current Sky' />"; > > > echo "<br />$weathervar[condition]<br /> > > </div>"; > > echo "<b>Temperature:</b> $temp[temp_f]°F<br />"; > echo "<b>Humidity:</b> $data[rel_humidity]%<br />"; > echo "<b>Wind:</b> $windvar[miles_per_hour]mph<br /> > <div align='center'>$time</div> > "; > > Thank you, > Dan Martin > > > > ------------------------------------------------------- > Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara > The only event dedicated to issues related to Linux enterprise solutions > www.enterpriselinuxforum.com > > _______________________________________________ > PHPWeather-devel mailing list > PHP...@li... > https://lists.sourceforge.net/lists/listinfo/phpweather-devel |