Re: Gimpster.com: Home > PHP > PHP Weather > Support
Brought to you by:
iridium
|
From: Martin G. <gim...@gi...> - 2002-02-21 07:56:58
|
Carsten Klapp <car...@ma...> writes:
> Hi,
>
> PhpWeather is really cool!
>
> I started writing a PhpWeather plugin for PhpWiki, so it can call
> PHPWeather. I have a suggestion which might make PhpWeather easier
> to include in other web sites.
Cool! I've been looking a little at the WikiWikiWeb concept and I like
it - the idea that everyone is able to correct and improve the pages
by editing them is great.
> In order to arbitrarily embed the output from PhpWeather at a
> specific location on the page, it would be helpful if the entire
> weather code could be wrapped up in a single function, so the user
> would only have to worry about 1 include. The function would also
> return the result as a string rather than using print to try to do
> the output itself.
Yes - you're right. It's kind of wrong that the report is output
instead of being returned as a string.
> Such a function could be called something like this:
>
> <?php
> // my great php application
> $icao = "CYYZ";
> $language = 'en';
> $format = 'metar';
> $name = "Toronto Pearson Int\'l Airport / Ontario, Canada";
>
> require_once('phpweather.inc');
> $weather = PHPWeather($icao, $format, $language, $name);
>
> //...
>
> ?>
The above approach looks good...
> The whole phpweather.inc probably could be rewritten using classes
> too, but I haven't had time to delve inside the code yet, PhpWiki
> keeps me busy.
I've already rewritten PHP Weather with classes - see the code in CVS
here:
http://sourceforge.net/cvs/?group_id=23245
--
Martin Geisler My GnuPG Key: 0xF7F6B57B
See my homepage at http://www.gimpster.com/ for:
PHP Weather => Shows the current weather on your webpage.
PHP Shell => A telnet-connection (almost :-) in a PHP page.
|