vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > Add-On Modules & Modifications > vBa CMPS v3.x & 2.x > Modifications (version 3.x & 2.x)

Reply
 
Thread Tools Display Modes
  #1  
Old 01-15-2007, 07:10 PM
theczech theczech is offline
Member
 
Join Date: Nov 2005
Posts: 78
Default Local weather

This is how I created a small window that shows a little weather info localized either for the user (if the user provided his/her zipcode) or for a pre-defined area if the user didn't provide his/her zipcode or isn't logged-in/registered.

vB version: 3.5.x, 3.6.x, 3.7.x
vBa version: 2.x, 3.x

Not guaranteed to work in other versions, however, reports have it that it works on vB 3.7.3 & vBa 3.1.


1. Create a custom user profile field:

Admin CP -> User Profile Fields -> Add New User Profile field

Profile Field Type: single-line text box
Title: ZIP code
Description: Enter your ZIP code. Some features on this website will be customized to your location (for example Weather Info). This information is kept private and other visitors cannot see it.
Max length of allowed user input: 5
Private Field: Yes
Field Searchable on Members List: No
Show on Members List: No
Regular Expression: "[0-9]" (dont enter the quotes)
Which page displays this option?: Edit Profile

IMPORTANT: Once you save the profile field and you're taken to the list of your profile fields, make a note of it's id number. Look to the right of it, it will say "field" and then a number, in my case it's "field7" This number is important, make a note of it, we'll use it later.

2. Create a template module:

Admin CP -> vBa CMPS -> Add Module -> Template

Fill out the fields to suit your taste.

Template to include: adv_portal_weather (or whatever you like)
Style: remember to pick one!
Use Module Shell Template: Yes
Template content: (WILL BE MODIFIED IN THE NEXT STEP)

Code:
<tr>
<td class="alt2" align="center">
<if condition="$bbuserinfo[FIELDX] == '' ">
Weather information for X__________X:<br>
<script src="http://netwx.accuweather.com/netweatherV2.asp?zipcode=DEFAULT_ZIP_HERE&lang=eng&size=5&metric=0"></script><br><br>
<if condition="$bbuserinfo[userid] > '0' ">
Would you like to see a weather info for your location?<br>
<br>
Click <a href="$vboptions[bburl]/profile.php?do=editprofile">here</a> and enter your zipcode into your profile. <br>
<br>
Every time you come back to our website your local weather will be displayed.
</if>
<if condition="$bbuserinfo[userid] == '0'">
Would you like to see weather info for your location?<br>
<br>
Please <a href="$vboptions[bburl]/register.php?">register</a> with our website and remember to fill in your zipcode.<br>
<br>
Every time you come back to our website your local weather will be displayed.
</if>
<else />
<script src="http://netwx.accuweather.com/netweatherV2.asp?zipcode=$bbuserinfo[FIELDX]&lang=eng&size=5&metric=0"></script>
</if>
</td>
</tr>
MODIFICATION OF THE CODE NECCESSARY TO MAKE IT WORK FOR YOUR WEBSITE:

- Replace the X__________X with the name of your default location. (which user will see if they do not provide their zip or if they are not logged in)

- Replace the DEFAULT_ZIP_HERE with the actual zipcode for your default location. Enter just 5 digits without any quotes.

X______X and DEFAULT_ZIP_HERE should match each other, duhh ;-)

- In both instances of [FIELDX] replace the X with the actual number I asked you to make a note of earlier.
It should for example look like this : [field7] or [field1]

END OF NECCESSARY MODIFICATION

OPTIONAL MODIFICATION:

You can change type of the weather block info by changing the parameter "size=5" in each of the lines that start with

Code:
<script scr=" ...... >
Just replace the number five with a number 1 through 6. Obviously some are suitable for side panels, some for center columns. Attached screenshots will give you an idea of what they look like.

END OF OPTIONAL MODIFICATON



That's it. If you followed the instructions to the T it should work on your website.

Remember, the module has to be active and you may have to edit the page you want it to display on and enable it there (put a checkmark next to it in Admip CP -> vBa CMPS -> Edit Page.

You can see it working here: www.TeamMR.com (left column, very bottom)

Enjoy!

Screenshots sizes 1 - 5 of unregistered users:
Attached Images
File Type: jpg weather_size1.JPG (41.4 KB, 810 views)
File Type: jpg weather_size2.JPG (32.1 KB, 429 views)
File Type: jpg weather_size3.JPG (69.5 KB, 531 views)
File Type: jpg weather_size4.JPG (77.3 KB, 459 views)
File Type: jpg weather_size5.JPG (14.4 KB, 543 views)

Last edited by theczech; 09-23-2008 at 10:34 AM.
Reply With Quote
  #2  
Old 01-15-2007, 07:11 PM
theczech theczech is offline
Member
 
Join Date: Nov 2005
Posts: 78
Default Re: Local weather

Post reserved for future use.

Screenshots:

size 6 and size 5 of a logged-in user
Attached Images
File Type: jpg weather_size6.JPG (26.6 KB, 270 views)
File Type: jpg weather_size5_logged_in.jpg (5.5 KB, 153 views)

Last edited by theczech; 01-15-2007 at 07:22 PM.
Reply With Quote
  #3  
Old 01-27-2007, 08:40 AM
TeddyKGB TeddyKGB is offline
Junior Member
 
Join Date: Apr 2006
Posts: 5
Default Re: Local weather

You might want to double check your templet code. I get html code when I use it.

It also doesn't work for me. I also use Field7 and even though it is already populated I still get the message that I need to edit it.

The other modification that you post this link in worked just fine for me but I wanted to alter the width so I tried this.

I will be going back to the other one until this one is corrected.

THanks!
Reply With Quote
  #4  
Old 01-28-2007, 10:23 AM
theczech theczech is offline
Member
 
Join Date: Nov 2005
Posts: 78
Default Re: Local weather

Quote:
Originally Posted by TeddyKGB View Post
You might want to double check your templet code. I get html code when I use it.

It also doesn't work for me. I also use Field7 and even though it is already populated I still get the message that I need to edit it.

The other modification that you post this link in worked just fine for me but I wanted to alter the width so I tried this.

I will be going back to the other one until this one is corrected.

THanks!

I think I see the problem. Code corrected, please, try again!

Thanks!

Last edited by theczech; 01-28-2007 at 10:31 AM.
Reply With Quote
  #5  
Old 01-29-2007, 07:47 PM
TeddyKGB TeddyKGB is offline
Junior Member
 
Join Date: Apr 2006
Posts: 5
Default Re: Local weather

Quote:
Originally Posted by theczech View Post
I think I see the problem. Code corrected, please, try again!

Thanks!
Closer but still isnt right, at least I don't think. I am getting footer type information (style dropdown, "log out" etc) in my weather box. Here is the code I used in the template.

Code:
<tr>
<td class="alt2" align="center">
<if condition="$bbuserinfo[field7] == '' ">
Weather information for Clemson, SC:<br>
<script src="http://netwx.accuweather.com/netweatherV2.asp?zipcode=29632&lang=eng&size=5&metric=0"></script><br><br>
<if condition="$bbuserinfo[userid] > '0' ">
Would you like to see a weather info for your location?<br>
<br>
Click <a href="$vboptions[bburl]/profile.php?do=editprofile">here</a> and enter your zipcode into your profile. <br>
<br>
Every time you come back to our website your local weather will be displayed.
</if>
<if condition="$bbuserinfo[userid] == '0'">
Would you like to see weather info for your location?<br>
<br>
Please <a href="$vboptions[bburl]/register.php?">register</a> with our website and remember to fill in your zipcode.<br>
<br>
Every time you come back to our website your local weather will be displayed.
</if>
<else />
<script src="http://netwx.accuweather.com/netweatherV2.asp?zipcode=$bbuserinfo[field7]&lang=eng&size=5&metric=0"></script">
</if>
</td>
</tr>
Reply With Quote
  #6  
Old 01-30-2007, 10:08 AM
theczech theczech is offline
Member
 
Join Date: Nov 2005
Posts: 78
Default Re: Local weather

I don't see anything wrong with this code and I have no idea why it should affect your footer etc.

Can you give me a link to the page you're trying it on?

What version of vB are you running?
Reply With Quote
  #7  
Old 02-15-2007, 02:01 AM
John_770 John_770 is offline
Need..More..Coffee..
 
Join Date: Feb 2007
Location: TN
Posts: 17
Default Re: Local weather

Getting the same thing here theczech - the default zip code weather is being displayed regardless of what's entered in the users profile.

Using 3.6.4 and 2.2.1

Props for a great looking module however..would like to see this get fixed!
Reply With Quote
  #8  
Old 02-16-2007, 06:09 AM
theczech theczech is offline
Member
 
Join Date: Nov 2005
Posts: 78
Default Re: Local weather

Quote:
Originally Posted by John_770 View Post
Getting the same thing here theczech - the default zip code weather is being displayed regardless of what's entered in the users profile.

Using 3.6.4 and 2.2.1

Props for a great looking module however..would like to see this get fixed!
I don't know what the variables for user profile fields in 3.6.x are as I run 3.5.x and it's running flawlessly ...

Sorry, I wish I could help you more. Send me a PM if you're willing to give me an access to your admin CP, then I'll be able to help you with your 3.6.4 version.
Reply With Quote
  #9  
Old 02-16-2007, 11:45 PM
John_770 John_770 is offline
Need..More..Coffee..
 
Join Date: Feb 2007
Location: TN
Posts: 17
Default Re: Local weather

I found what the problem was..it's an extra " in your code:

Remove the red " and all is good:

Code:
<script src="http://netwx.accuweather.com/netweatherV2.asp?zipcode=$bbuserinfo[FIELDX]&lang=eng&size=5&metric=0"></script">
Reply With Quote
  #10  
Old 02-17-2007, 12:49 AM
theczech theczech is offline
Member
 
Join Date: Nov 2005
Posts: 78
Default Re: Local weather

Thanks!!!!

Code fixed now and all should be working well ... appreciate your hawk eye!
Reply With Quote
  #11  
Old 02-24-2007, 06:45 PM
Essex-Poker.co.uk's Avatar
Essex-Poker.co.uk Essex-Poker.co.uk is offline
Member
 
Join Date: Feb 2007
Posts: 36
Default Re: Local weather

is there a version for us uk users??? we dont have zip codes but post codes
Reply With Quote
  #12  
Old 02-25-2007, 12:42 AM
theczech theczech is offline
Member
 
Join Date: Nov 2005
Posts: 78
Default Re: Local weather

Quote:
Originally Posted by motormeet.co.uk View Post
is there a version for us uk users??? we dont have zip codes but post codes

I'm sure you can figure out how to rename ZIPcode to Post code, how to find some uk weather website the provides with weather blogs based on postcodes, and how to replace the appropriate code ... you seem like a smart cookie ...
Reply With Quote
  #13  
Old 03-14-2007, 03:20 PM
Squintz Squintz is offline
Junior Member
 
Join Date: Mar 2007
Posts: 1
Default Re: Local weather

I'm still having the same problem that John had. No matter what I enter into my zip code in my user profile, it acts like there is no zip code entered into my profile. No weather data is showing up.

Any update to this?

Using 3.63 and 2.2.1

Last edited by Squintz; 03-14-2007 at 03:25 PM.
Reply With Quote
  #14  
Old 03-15-2007, 05:55 AM
theczech theczech is offline
Member
 
Join Date: Nov 2005
Posts: 78
Default Re: Local weather

Quote:
Originally Posted by Squintz View Post
I'm still having the same problem that John had. No matter what I enter into my zip code in my user profile, it acts like there is no zip code entered into my profile. No weather data is showing up.

Any update to this?

Using 3.63 and 2.2.1
Make sure you followed the instructions, although I can't guarantee this works on 3.63 as I don't have an admin access to any 3.63 board.

What I can guarantee is that is works on 3.5 as that's what we have at www.TeamMR.com and as you see works well there.

I'm sorry I can't be help you.
Reply With Quote
  #15  
Old 03-21-2007, 03:11 PM
mamasnbabies mamasnbabies is offline
Junior Member
 
Join Date: Jan 2005
Posts: 1
Default Re: Local weather

Works GREAT on our page so far.

Last edited by mamasnbabies; 03-21-2007 at 03:18 PM.
Reply With Quote
  #16  
Old 04-26-2007, 04:18 PM
javo javo is offline
Member
 
Join Date: May 2005
Posts: 50
Default Re: Local weather

This is awesome !
I just installed and working with 3.6.4!! (had the same issue as above but got it resolved)

Also, not everyone goes to the cmps page of my site. Most have a saved link directly to the forums. I have a column on the left on the main forums page and I wuld like to stick this weather information in there as well.
Any tips / advice?

Thanks,

Last edited by javo; 04-26-2007 at 04:56 PM.
Reply With Quote
  #17  
Old 04-27-2007, 05:55 AM
theczech theczech is offline
Member
 
Join Date: Nov 2005
Posts: 78
Default Re: Local weather

Quote:
Originally Posted by javo View Post
This is awesome !
I just installed and working with 3.6.4!! (had the same issue as above but got it resolved)

Also, not everyone goes to the cmps page of my site. Most have a saved link directly to the forums. I have a column on the left on the main forums page and I wuld like to stick this weather information in there as well.
Any tips / advice?

Thanks,
Would you post a link to your forums, please? Thank you!
Reply With Quote
  #18  
Old 04-27-2007, 11:25 AM
javo javo is offline
Member
 
Join Date: May 2005
Posts: 50
Default Re: Local weather

The site is www.mxcrazy.com
The direct link to the forums is www.mxcrazy.com/forums

I have the left column hidden right now. I was just looking for generic code that I can put in the column or directly under the Navbar.

It works great on the CMPS.. When I paste the same code inside the forums I get the issue where it uses the default location rather than whats defined in the profile field.
Reply With Quote
  #19  
Old 04-28-2007, 05:55 AM
theczech theczech is offline
Member
 
Join Date: Nov 2005
Posts: 78
Default Re: Local weather

The same code should work anywhere within vbulletin website. It's nothing limited to just vba, it's a straight up html and it uses vbulletin variables. I really wish I had the time to experiment with it in our forums, but I have a baby on a way that should be here any hour now so I'm quite busy, I hope you understand ...
Reply With Quote
  #20  
Old 04-30-2007, 04:56 PM
javo javo is offline
Member
 
Join Date: May 2005
Posts: 50
Default Re: Local weather

I understand..
Hopefully theres another guru out there that can help...

Grats on the little one!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Local music community jaffa Show off your vBadvanced! 0 06-15-2006 11:45 AM
Weather Channel - Weather Module boo Add-On Modules & Modifications 29 09-24-2005 12:24 PM


All times are GMT -4. The time now is 09:24 PM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.