Re: Help with putting it on webpage.
Brought to you by:
iridium
From: Martin G. <gim...@gi...> - 2003-02-21 23:08:25
|
Staci <sco...@wi...> writes: (Please direct your answers to the list and not to me personally.) > On Fri, 21 Feb 2003, Martin Geisler wrote: >> >> We could then make the wrapper function accept arguments that >> control whether or not the drop-down box should be rendered... but >> then we're adding complexity again :-) > > How about a workaround? > > Could you just let us choose the default, move my city to the top of > the dropdown list so it's the one that's there before a person > chooses one? That's already fairly easy to do with the methods presented today... And that's the key issue here: PhpWeather already gives you the pieces to build this kind of thing, it's just assumed that the user knows how to piece them together. > regarding adding complexity...it's up to you. I can't write it > myself, of course, so how much work you're willing to put into it is > up to you. (if you're going to say "none" tell me now and I'll start > looking for another tool. :P ) Well, it's not surposed to be that difficult - look at this code: <?php require('/some/path/to/phpweather/phpweather.php'); require(PHPWEATHER_BASE_DIR . 'pw_utilities.php'); require(PHPWEATHER_BASE_DIR . '/output/pw_text_en.php'); require(PHPWEATHER_BASE_DIR . '/output/pw_images.php'); $weather = new phpweather(); $text = new pw_text_en($weather); $icons = new pw_images($weather); $location = $weather->get_location(); $report = $text->print_pretty(); $sky = $icons->get_sky_image(); $wind = $icons->get_winddir_image(); $temp = $icons->get_temp_image(); ?> This gives you all available information in five variables, it's then up to you to put them into suitable HTML codes. -- 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. |