TinyPortal

Development => Block Codes => Topic started by: MetalHellsangel on March 17, 2006, 04:43:06 AM

Title: Weather Block
Post by: MetalHellsangel on March 17, 2006, 04:43:06 AM
Users enter their zip code and get a short weather report

Download & Support Here (http://www.blockcodes.com)
Title: Re: Weather Block
Post by: Mitch on March 17, 2006, 04:53:24 AM
Too wide for my liking but none the less a good script.
Title: Re: Weather Block
Post by: MetalHellsangel on March 17, 2006, 04:54:56 AM
You can add some php to resize it, feel free to edit it to suit your needs.
Title: Re: Weather Block
Post by: TwinsX2Dad on March 17, 2006, 04:55:43 AM
Or just resize the script:

Displays a weather block where the user can input a zipcode and see the weather in that area

echo "<form id=\"weather\" name=\"weather\" method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\">
  <label>Zip Code
  <input name=\"zip\" type=\"text\" size=\"5\"/>
  </label>
  <input type=\"submit\" name=\"Submit\" value=\"Submit\" />
  <label></label>
</form>";

$zipcode = $_POST['zip'];

echo  "<a href=\"http://www.weatherusa.net/forecasts/?pands=$zipcode\"><img src=\"http://www.weatherusa.net/forecasts/?forecast=hourly&alt=hwicc&config=png&pands=$zipcode&hwvdisplay=\" width=\"150\" height=\"100\" border=\"0\" title=\"weatherUSA.net\"></a>";
Title: Re: Weather Block
Post by: MetalHellsangel on March 17, 2006, 04:57:06 AM
True you can change the height and width
Title: Re: Weather Block
Post by: TwinsX2Dad on March 17, 2006, 05:13:12 AM
I did notice their graphic is too wide. You could resize via html or you could edit & rehost the graphic or, a simpler block would be to create a javascript/html block and insert the following:

<form target="weather" action=http://www.wunderground.com/cgi-bin/findweather/getForecast ><font color=#000000><p align="center"><font size="1">Find your Weather<br>Enter City, State, Zip, or Country</font></font><br><font color=#000000><input type=text name=query size=10><input type=submit value="Forecast"></font></form>

Title: Re: Weather Block
Post by: MetalHellsangel on March 17, 2006, 05:15:13 AM
well here's where the graphic is if your interested in putting it on your site, but I'm not sure how it would work because it's a live graphic

http://www.weatherusa.net/wxonyoursite/
Title: Re: Weather Block
Post by: TwinsX2Dad on March 17, 2006, 05:16:47 AM
Right again - I just went looking at that.
Title: Re: Weather Block
Post by: MetalHellsangel on March 17, 2006, 05:19:17 AM
I have 200 wide side blocks, I suppost that why it looks differently on your site.
Title: Re: Weather Block
Post by: TwinsX2Dad on March 17, 2006, 05:30:10 AM
Unfortunately, I have too many people still running around with their resolutions set at 640X480 - nice wide columns are out of the question.

640X480 computer users whine a lot.   ;D
Title: Re: Weather Block
Post by: MetalHellsangel on March 17, 2006, 05:31:06 AM
lol  :D
Title: Re: Weather Block
Post by: alan s on March 17, 2006, 01:10:37 PM
im afraid i cant use this block.........i live in cork in ireland and we dont have zip codes , would have been a nice feature though
Title: Re: Weather Block
Post by: MetalHellsangel on March 17, 2006, 01:23:12 PM
you can change the script to say city name and just enter the city name it will work just as well.
Title: Re: Weather Block
Post by: alan s on March 17, 2006, 01:39:05 PM
Thanks, It works
Title: Re: Weather Block
Post by: MetalHellsangel on March 17, 2006, 01:39:31 PM
Your Quite Welcome :D