Page 2 of 3

Re: Cumulus realtime.txt file reader

Posted: Mon 10 Jan 2011 8:47 pm
by phtvs
Made another usefull script for using with the view-realtime.php script.

This script shows a table with all the strings that are used by the view-realtime.php script

Unpack the .rar with winrar and put the realtime-helper.php script in the same directory as the view-realtime.php file.

Point your browser to:

http://www.linktoyoursite/realtime-helper.php

Have fun with it!

Re: Cumulus realtime.txt file reader

Posted: Mon 10 Jan 2011 9:22 pm
by nitrx
almost
<td width="119" height="39" align="center"><? echo $forecastnumber; ?>;</td>
and

<td width="119" height="39" align="center"><? echo $wdir; </td> should be <td width="119" height="39" align="center"><? echo $wdir; ?></td> without the bold-marked semicolumn ;)

edit makrup duesnt work on the forum :roll: http://www.apeldoorn.tk/weer/realtime-helper.php

Re: Cumulus realtime.txt file reader

Posted: Mon 10 Jan 2011 9:45 pm
by daj
Shriek!!!! :o :o :o

Please do not use the PHP short open tag, especially if you are sharing PHP. Not all PHP installations will have this enabled by default.

CORRECT

Code: Select all

<?php .....
NOT

Code: Select all

<?
There are also some errors in the HTML, the first quite serious...

Code: Select all

<body <body bgcolor="#F9F9F9">
Need to remove the duplicate "<body "

And right at the end of the code you open a <center> tag but do not close it. Not as serious but some browsers will have a problem with it

Re: Cumulus realtime.txt file reader

Posted: Tue 11 Jan 2011 12:13 am
by phtvs
oeps...

I didnt see that...

Maby I was to quick with posting the file.

I correct the errors first tomorrow morning and post te good version.

Thanks for helping!

Re: Cumulus realtime.txt file reader

Posted: Tue 11 Jan 2011 9:33 am
by phtvs
got all the errors out of the script now.

Updated my first post with the new version!

Re: Cumulus realtime.txt file reader

Posted: Tue 11 Jan 2011 9:41 am
by phtvs
daj wrote:Shriek!!!! :o :o :o

Please do not use the PHP short open tag, especially if you are sharing PHP. Not all PHP installations will have this enabled by default.

CORRECT

Code: Select all

<?php .....
NOT

Code: Select all

<?
There are also some errors in the HTML, the first quite serious...

Code: Select all

<body <body bgcolor="#F9F9F9">
Need to remove the duplicate "<body "

And right at the end of the code you open a <center> tag but do not close it. Not as serious but some browsers will have a problem with it

Thanks for reporting my miss typo's!!

Corrected them and update my first post with the new script!

Theo

Re: Cumulus realtime.txt file reader

Posted: Tue 11 Jan 2011 9:46 am
by daj
Great -- well done so far with your scripts. Learning is so much fun (well I think so anyway)

Re: Cumulus realtime.txt file reader

Posted: Tue 11 Jan 2011 11:11 am
by phtvs
daj wrote:Great -- well done so far with your scripts. Learning is so much fun (well I think so anyway)
Indeed, learning php is fun to do!
especially when you get compliments of scripting gurus like you 8-)

Re: Cumulus realtime.txt file reader

Posted: Tue 11 Jan 2011 12:29 pm
by gemini06720
Theo, I looked at the original 'view-realtime.php' (and also at the latest release) and both files are very good for a PHP 'débutant' :) ) .

Using some of the code I was already using for my Web pages, I modified the original 'view-realtime.php' to include additional tags and a few additional functions. Some of the new code comes from the Weather Display/PHP/AJAX Website scripts/template (designed by Ken True) that I have been using for the past 4-5 years on my main weather pages.

The attached modified 'view-realtime-ray.php' is compatible with your 'view-realtime.php' and with 'realtime-helper.php' (you should rename that file to 'view-realtime-helper.php' so both files are next to each others on a directory listing ;) ).

I have also modified 'view-realtime-ray.php' to make it compatible with the format of the variables use in my Web pages (also the format of the variables used in my 'webtags' files): [link removed]

Re: Cumulus realtime.txt file reader

Posted: Tue 11 Jan 2011 2:14 pm
by phtvs
To show what nice things you can do with the view-realtime.php script I have made a webpage.

DEMO: http://www.weerstation-lemmer.nl/cumulu ... onsole.php

This is a weatherconsole with "live"updates. Page refreshes every 15 seconds. (Could be more or less if you want)

Re: Cumulus realtime.txt file reader

Posted: Tue 11 Jan 2011 2:21 pm
by phtvs
gemini06720 wrote:Theo, I looked at the original 'view-realtime.php' (and also at the latest release) and both files are very good for a PHP 'débutant' :) ) .

Using some of the code I was already using for my Web pages, I modified the original 'view-realtime.php' to include additional tags and a few additional functions. Some of the new code comes from the Weather Display/PHP/AJAX Website scripts/template (designed by Ken True) that I have been using for the past 4-5 years on my main weather pages.

The attached modified 'view-realtime-ray.php' is compatible with your 'view-realtime.php' and with 'realtime-helper.php' (you should rename that file to 'view-realtime-helper.php' so both files are next to each others on a directory listing ;) ).

I have also modified 'view-realtime-ray.php' to make it compatible with the format of the variables use in my Web pages (also the format of the variables used in my 'webtags' files): view-realtime-ray_2.php

Wauw!!! Looks fantastic! :clap:
I will have to take better a look at the script later today, maybe I can use it for the webpages I want to make.

Renaming the files is a good idea.

Im working on a few scripts for displaying the data from realtime.txt. One of them is almost ready.

PHP scripting is easyer for me then typing English ;-)

Theo

Re: Cumulus realtime.txt file reader

Posted: Tue 11 Jan 2011 2:31 pm
by gemini06720
phtvs wrote:To show what nice things you can do with the view-realtime.php script I have made a webpage.
Nice work Theo... ;)
phtvs wrote:This is a weatherconsole with "live"updates. Page refreshes every 15 seconds. (Could be more or less if you want)
Ah! You disappoint me, you use the <META HTTP-EQUIV="Refresh" CONTENT="15"> tag to refresh your page ... and I thought you would have use some JavaScript... :D

Now you have to learn how to use more often an external CSS (cascading style sheet) file to put all that CSS/style coding... :twisted:
phtvs wrote:Im working on a few scripts for displaying the date from realtime.txt. One of them is almost ready.
If you look near the end of the 'view-realtime-ray.php' file you should find 2 functions (fixup_date and fixup_time) that should help you with the time/date display... :geek:
phtvs wrote:PHP scripting is easyer then typing English
Once one gets 'really' involved with PHP, one find PHP quite interesting and quite challenging... :lol:

Re: Cumulus realtime.txt file reader

Posted: Tue 11 Jan 2011 2:44 pm
by daj
gemini06720 wrote:.... Ah! You disappoint me, you use the <META HTTP-EQUIV="Refresh" CONTENT="15"> tag to refresh your page ... and I thought you would have use some JavaScript... :D

Now you have to learn how to use more often an external CSS (cascading style sheet) file to put all that CSS/style coding... :twisted:
Baby steps Ray and one thing at a time. Let's not bombard Theo with everything at once.

Re: Cumulus realtime.txt file reader

Posted: Tue 11 Jan 2011 2:52 pm
by phtvs
daj wrote:
gemini06720 wrote:.... Ah! You disappoint me, you use the <META HTTP-EQUIV="Refresh" CONTENT="15"> tag to refresh your page ... and I thought you would have use some JavaScript... :D

Now you have to learn how to use more often an external CSS (cascading style sheet) file to put all that CSS/style coding... :twisted:
Baby steps Ray and one thing at a time. Let's not bombard Theo with everything at once.
:lol: :lol:

Have made a few changes to the webpage.

The forecast icon (right top of the screen) is now updated when $forecastnumber is changing and the image for daylight/nighttime is changing when the $isdaylight is changing in realtime.txt 8-)

Re: Cumulus realtime.txt file reader

Posted: Tue 11 Jan 2011 6:23 pm
by phtvs
gemini06720 wrote:Now you have to learn how to use more often an external CSS (cascading style sheet) file to put all that CSS/style coding... :twisted:
Hi Ray,

I have changed the script a bit and also make use of an external CSS style sheet. I think the script is better organized this way.
Thanks for putting me on the right path!

http://www.weerstation-lemmer.nl/cumulu ... onsole.php

Next: I going to make the page refresh with javascript.... 8-)



Theo