PDA

View Full Version : Weather Module



Pages : [1] 2 3 4

cLord
05-25-2004, 07:49 AM
This will add a weather module to your CMPS...

(If your visitor isn't a member it tells them they must register to show the weather. If they are a member but haven't filled in the Zip Code field it tells the user they must edit their profile to add a zip code. If they have a zip code in their profile it will show a 5 day forecast of the weather in their area.)

1) In your Admincp - User Profile Fields - Select "Add New User Profile Field" - Choose single line text box - Create new field titled "Zip Code".

2) Still in your Admincp - User Profile Fields - Open "User Profile Field Manager" and look for the Zip Code field number - In this case it was field 5.

3) Stay in your Admincp - Styles & Templates - Style Manager - Add a new template called "adv_portal_weather".
Insert this code into the template:

<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><b>$vba_options[portal_blockbullet] Weather Conditions</b></span></td>
</tr>
<tr>
<td class="$getbgrow"><span class="smallfont">

<if condition="!$bbuserinfo['userid']">
<span class="smallfont">Registered members can see their local weather conditions here.<br /><br /><phrase 1="$vboptions[bburl]">$vbphrase[not_a_member_yet_register_now]</phrase></span>
<else />
<if condition="$bbuserinfo[field5] !=''">
<a href="http://www.weatherroom.com/forecast/$bbuserinfo[field5].html"><img src="http://www.weatherroom.com/weather?forecast=zone&hwvtc=black&hwvbg=E1E4F2&pands=$bbuserinfo[field5]&config=png&alt=hwivzone&daysonly=1" alt="Weather for $bbuserinfo[field5] provided by weatherroom.com." border="0"></a>
<else />
<A HREF="$vboptions[bburl]/profile.php?do=editprofile">Add Zip Code</A> to show weather conditions.
</if>
</if>
</span>
</td>
</tr>
</table>
<br/>Save the template!

IMPORTANT! Change all instances of $bbuserinfo[field5] to whatever your field number is. If it is number 10 change it to $bbuserinfo[field10]. If you forget this step it will not work!

4) Still in your Admincp - vBa CMPS - Add Module

- Module Title - Weather
- Module Identifier - Leave blank
- OR Template to Include - weather
- Activate and select the column you want it in.
- Save and you are done.

Based upon IndyWebDesign's (http://www.vbadvanced.com/forum/showthread.php?t=494) Weather Module.

Have fun,
cLord ;)

joeychgo
05-25-2004, 12:25 PM
Thank You!!!!!!!!!!!!!

Our Sponsors
 

Zedd
05-25-2004, 07:20 PM
just added this, nice and easy

Zedd
05-25-2004, 08:32 PM
does this only work for us sites?

Our Sponsors
 

cLord
05-25-2004, 09:48 PM
No, this works for non US sites also.

1) Go here: http://www.weatherroom.com/cgi-bin/weather.cgi?config=&forecast=pass&pass=tafINT
2) Select your country and city
3) Click "display Forecast/Conditions"
4) Top right you will see this "ICAO Used:" followed by a code - Place this code in your zip code field and you will see your local international forecast.

cLord ;)

Zedd
05-26-2004, 04:57 PM
ellent, thanx.

Acido
05-26-2004, 06:59 PM
Is possible give to users the posibility of CHOOSE weather conditions on their locations?

machino
05-30-2004, 06:45 PM
using this, thanks

Preech
05-31-2004, 01:19 AM
Thank you. Very much appreciated.

Skipsoutdoors
06-05-2004, 04:49 PM
Thanks for the effort to make this block.

Skip

mholtum
06-05-2004, 05:00 PM
I installed that. Then deleted it. It seemed to be working but would only display Seattle WA but when clicked when to the correct zipcode.

yl88
06-09-2004, 03:52 AM
COOL, i just installed!!!!!

Thanks You!!!

06-09-2004, 02:23 PM
Gosh this is awesome and I installed it but it slowed my page load time waaay down because it took a bit to pull the graphic from weatherroom.com :( WAHHHH!!!

Blackbeard
06-10-2004, 07:09 AM
Is weatherroom still working as iam getting zonecurrently unavailable, iam in scotland iam i doing something wrong

cLord
06-10-2004, 08:35 AM
Works as usual...

cLord ;)

poseidon
06-10-2004, 01:56 PM
thanks man

TheSauceMaster
06-12-2004, 03:31 PM
Very nice and easy to add , I was wondering is there a way to change the background color without redoing everything , so it would match your style colors?

Bailx
06-16-2004, 03:35 PM
this is very cool i just added it to one of my sites

58sniper
06-17-2004, 12:19 AM
Very nice and easy to add , I was wondering is there a way to change the background color without redoing everything , so it would match your style colors?

Change the highlighted part to your preferred color code:



<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><b>$vba_options[portal_blockbullet] Weather Conditions</b></span></td>
</tr>
<tr>
<td class="$getbgrow"><span class="smallfont">

<if condition="!$bbuserinfo['userid']">
<span class="smallfont">Registered members can see their local weather conditions here.<br /><br /><phrase 1="$vboptions[bburl]">$vbphrase[not_a_member_yet_register_now]</phrase></span>
<else />
<if condition="$bbuserinfo[field5] !=''">
<a href="http://www.weatherroom.com/forecast/$bbuserinfo[field5].html"><img src="http://www.weatherroom.com/weather?forecast=zone&hwvtc=black&hwvbg=E1E4F2&pands=$bbuserinfo[field5]&config=png&alt=hwivzone&daysonly=1" alt="Weather for $bbuserinfo[field5] provided by weatherroom.com." border="0"></a>
<else />
<A HREF="$vboptions[bburl]/profile.php?do=editprofile">Add Zip Code</A> to show weather conditions.
</if>
</if>
</span>
</td>
</tr>
</table>
<br/>

Bailx
06-18-2004, 05:48 PM
i have a question about the code above....

if say we don't use a solid color, and instead use images, is there a way to make the background transparent, so the background would show thru?

i was also thinking about hosting the different pictures locally so they would load faster, as well as being able to perhaps change them to slightly higher quality images....and the text is a little small on my 1600x1200 resolution for the temps.

small gripes really.... a really cool addition to the website :thumbsup:

58sniper
06-19-2004, 09:15 AM
Not that I'm aware of. I tried leaving the background property blank, and that didn't work. I believe those images are dynamically created upon request.

Bailx
06-19-2004, 12:28 PM
well it might take some work.... but i'm sure theres a way.... i'll post if i figure anything out....

RetroDreams
06-22-2004, 12:22 PM
Did this quit working on anyone else?

Removing and re-adding module made it "work" again.

Weird.

xfaethorx
06-26-2004, 04:14 PM
top work :) I spent about 5 hours writing one for vbportal which parsed data from the BBC. THIS is SO much EASIER! hahah...top work!

NuclioN
06-28-2004, 10:08 AM
It does'nt work here. The displayed date is feb 2003 and stays that way. (??)

cLord
06-28-2004, 10:22 AM
It does'nt work here. The displayed date is feb 2003 and stays that way. (??)
What is your zip code?

Eric Brooks
06-29-2004, 11:59 AM
I just installed. It shows the conditions for Blacksburg, VA, but when clicked it shows the correct conditions for 31794, which is Tifton, GA

Any ideas?

06-29-2004, 02:09 PM
I just installed. It shows the conditions for Blacksburg, VA, but when clicked it shows the correct conditions for 31794, which is Tifton, GA

Any ideas?

I had that issue, I missed changing some of the field values in the template.

Fiber
07-04-2004, 02:26 AM
Very nice mod, except I have one small issue not sure what it is?
The weather box is crunched up and does'nt span like others I have seen.
And suggestions for this fix?

You can see the green area which it is not filling in.

Fiber

58sniper
07-04-2004, 02:33 AM
That's because the block contains nothing but a dynamically created image. That image, according to my testing, is 150x320 pixels. If your block is much wider than that, you'll have 'white space' to deal with. Try setting the background of that particular block to match the background of the graphic, and it won't be so noticeable.

mholtum
07-04-2004, 02:49 AM
Did you center the table?

Bailx
07-05-2004, 04:40 PM
something i just noticed is if you use international codes instead of u.s. codes you get different weather output... i've only tested with quebec

dosn't show the Hi/ Low's as well as not being a 5 day forecast and being morning -> evening....

MorrisMcD
07-24-2004, 11:39 AM
How much is involved in making this module colapsible? I think I just need to add a few lines to the template, right? Just not sure.

Also, I dont know if this is causing it, but since adding modules and CMPS, I have noticed some pop ups.. Is anyone sure if the weather channel or whatever is giving popups?

KW802
08-03-2004, 12:05 PM
When creating the new User Profile field, what would the PCRE code be to make sure that it's numeric and 5 digits longs? I know from the example given "^[0-9]{7,8}$" that it will make sure it's numeric but what does the "{7,8}" get changed to for checking the zip code length?

Thanks.

attroll
08-24-2004, 02:02 AM
It does'nt work here. The displayed date is feb 2003 and stays that way. (??)

I have users on my site that have this same problem. I have tried thier zip codes and they all work for me. But when they look at the weather wit hthier zip code it displays an older date not the current date. I have had them clear there cookies and it still displays the older date.

Does anyone have an clue to why this is happening or how to cure it?

attroll
08-27-2004, 01:44 AM
I think I figured out what my users problems were. I had one of the users do a refresh it it fixed it. But I have not heard from the others yet.

rayzon
09-04-2004, 09:06 PM
Hmmm, I got the module to work initially but am now getting nothing. I tried as stated in one post to remove and then re-add the module. Still no good. Any suggestions?

www.rayzonz.com/forums

Bid4Hosting
09-08-2004, 07:52 PM
It work smooth... great job!

KW802
09-08-2004, 08:31 PM
When creating the new User Profile field, what would the PCRE code be to make sure that it's numeric and 5 digits longs? I know from the example given "^[0-9]{7,8}$" that it will make sure it's numeric but what does the "{7,8}" get changed to for checking the zip code length?

Thanks.
Anyone? :(

Ras Masta
09-19-2004, 04:25 PM
Could I do this as a seperate page?

cLord
09-20-2004, 02:32 AM
Could I do this as a seperate page?
Sure, why not?
Just go to the vBadvanced Members section and read the CMPS manual on how to add a page...

cLord ;)

MACHOBY
09-27-2004, 03:15 PM
I just put this on and it takes about 30 seconds for the forcast to load and I am on high-speed. I can't imagine how long dial-up users will have to wait. Any suggestions for changing this? I think it's the entire weatherroom.com site that is slow. Is there any other services that offer this?

58sniper
09-27-2004, 05:20 PM
It's not the speed of your connection. Their service has been REALLY slow lately. It could be due to the hurricanes. There might be a LOT more traffic going into their site.

eblivion
10-02-2004, 03:34 PM
Very nice!!!!!

Gronilot
10-11-2004, 01:35 AM
This will add a weather module to your CMPS...

(If your visitor isn't a member it tells them they must register to show the weather. If they are a member but haven't filled in the Zip Code field it tells the user they must edit their profile to add a zip code. If they have a zip code in their profile it will show a 5 day forecast of the weather in their area.)

1) In your Admincp - User Profile Fields - Select "Add New User Profile Field" - Choose single line text box - Create new field titled "Zip Code".

2) Still in your Admincp - User Profile Fields - Open "User Profile Field Manager" and look for the Zip Code field number - In this case it was field 5.

3) Stay in your Admincp - Styles & Templates - Style Manager - Add a new template called "adv_portal_weather".
Insert this code into the template:
IMPORTANT! Change all instances of $bbuserinfo[field5] to whatever your field number is. If it is number 10 change it to $bbuserinfo[field10]. If you forget this step it will not work!

4) Still in your Admincp - vBa CMPS - Add Module

- Module Title - Weather
- Module Identifier - Leave blank
- OR Template to Include - weather
- Activate and select the column you want it in.
- Save and you are done.


cLord ;)

Mine is not working properly. It says to "add Zip code" and takes me to edit profile... and I add and save the zipcode.. but it does not show the weathter.

Any ideas? I have double checked the field number .- I found 4 instances to change it..

Is there something else I should do?

rapheal
10-26-2004, 02:21 PM
Is possible give to users the posibility of CHOOSE weather conditions on their locations?


Select a country and city with in to view the forecast, INSTED OF zIP CODE!

how can it be done ?

58sniper
10-28-2004, 12:10 PM
It can't, at least not easily. That would add a TON of code to the page. Imagine the code for the pulldowns having to have EVERY COUNTRY and EVERY ZIP CODE IN THE WORLD? Not going to happen!

Ber|Art
11-02-2004, 02:23 AM
I am getting the Block and the link to the whether site but I ma getting a RED cross where the whether should display? Can someone tell me how to fix this? Thx!
Oh you can see what I mean at my test board: www.ber-art.nl/forums

CSS59
11-11-2004, 12:50 AM
sweet mod! Thank you!

BubbleHead
11-13-2004, 04:05 AM
I have this mod working, and it was a simple set-up.

My question... is there a to set-up this block to open in a new window when a user click on it?

I don't want people leaving my site if they do click on the weather block.