PDA

View Full Version : Location Based Weather Template Mod


joeydood
09-30-2003, 07:30 PM
guys, this is my very first attempt at a sort-of serious modification...

i run a motorcycle web site, www.rocketmadness.com. it's important for the riders to know the local weather conditions and the members range from all over Louisiana and the south.

so i devised a template hack to pull the member's location field and insert it into the form's value field for submission to weather.yahoo.com. you could easily substitute it for any weather site's form...

installation is a snap!

acp | templates | modify
locate postbit templates
locate postbit

scroll down to where you see the 'Posts: $post[posts]< br>
add the following before the < td>:

<form method=get action="http://search.weather.yahoo.com/search/weather2" name=form1 target="_new">
<INPUT TYPE="hidden" NAME="p" VALUE="$post[field2]" size=21>&nbsp;<font size="1" face="Verdana"><input type=submit
value="My Weather"></form>

now, on each post, every member has a button that says 'My Weather' that takes them to their local weather conditions and forcast!

YOU COULD DO THIS WITH ANY FORM!!! add a user field to their profiles for favorite sports team and submit it for the latest sports scores and events!

joeydood
09-30-2003, 07:32 PM
p.s., if someone else has done this before, my apologies... i needed this badly and well i searched the site with no luck. i CONSIDERED ip-based weather but well u know the headaches in that!

MindTrix
10-07-2003, 06:45 AM
Errrrrrrrrrmmmmmm ok :p I installed it but all you've really done is make a button appear linking to yahoo weather :s Isnt really a template mod is it, its just a link?? Thanks for sharin tho

joeydood
10-07-2003, 11:44 AM
yes, correct. that's all it does.

it passes the user's field2 (a user's 'location' in my db) to the yahoo weather via the yahoo weather form.

not sure exactly what kind of mod it is, i'm new to your classifications.

n-joy!

MindTrix
10-07-2003, 11:47 AM
Ummmmm ok didnt for me, I got my location as Uk and when clicking the link it mearly takes me to the front page of yahoo weather

joeydood
10-07-2003, 12:16 PM
you have to be a bit more specific than just 'uk'. that's like me putting usa in my location.

if you want LOCAL weather put in your LOCATION, not your entire COUNTRY.

for instance, just 'london' works fine. there's only one london. however there are are many different areas for which the weather is reported in the UK.

good luck!

MindTrix
10-07-2003, 12:25 PM
Ahh i gotcha, yeah works fine. Couple of things tho :p more like requests


1.Couldnt you somehow have it so that either
a) The weather is shown in a users post bit, like if its cloudy a lil cloud appears, or somet simple like this?
b) Instead of going to the ugly yahoo page a java page loads up with the info ur lookin for?

Also cud it be set so that MY WEATHER doesnt show on everybodys post bit, it only appears to THAT user under their postbit? Like errm My Weather button would only show for me underneath my posts, I wudnt see it in anyone elses ya no?

joeydood
10-07-2003, 12:47 PM
MAN! those are great ideas!!! i like the thought of just using the little icon on your page or post for your local weather conditions...

actually, i've kind of changed the mod a bit... on my site now, there's just one icon on the top of each page, 'Your Weather'. that way you don't have to look for your posts, etc. to find YOUR icon.

technically, i guess i could write my own page that the 'Your Weather' icon points to... pass the location to this custom page and it would instantly grab the weather in a pre-formatted layout.

i'll have to give this some thought!

but you know, the only problem with retrieving the icon from a weather site back to your vB site is that some ding-dongs put things like location: the playboy mansion; location: a warm moist hole... (no kidding on that!) so then i'm not sure about what icon would be returned by the weather site...

but you've given me some things to consider! location based weather has been a long-time holy grail to me as, like i said in a previous post... we ride sportbikes and weather conditions are very important to us.

i tried to find IP based weather hacks, etc. sheesh let the members put their location in their ucp and BAM!!! of course this isn't really a hack but heck my members love it!

MindTrix
10-07-2003, 12:53 PM
Hmmm well how about havin a tiny link under each postbit sayin somet like "View your local weather" and then when clicked it takes them to a custom VB page displayin the info. And also in the USER CP next too PRIVATE MESSAGES put LOCAL WEATHER just for the sake of it :p.

As for them enterin stupid locations i know wut ya mean, i own a rap board so go figure lol. But they shud just get what i got, when i had UK. You just get the weather home page.

Wud b nice just havin like a Sun picture in postbit if its sunny for u, Or Rain if its rainy etc :p

joeydood
10-07-2003, 12:55 PM
sounds kewl man i think that shall be the next step!

and omg i can just imagine what they put in a RAP board. and i thought SPORT BIKE RIDERS were crazy!!!

MindTrix
10-07-2003, 12:57 PM
Lmfao the things we all put up with Siggghhh :p also if ur ne good with php mayb u cud answer my OH SO simple question thats been living in the help me finish section ;)