Page 1 of 6 1234 ... LastLast
Results 1 to 20 of 112

Thread: Local weather

  1. #1

    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:
    Last edited by theczech; 09-23-2008 at 11:34 AM.

  2. #2

    Default Re: Local weather

    Post reserved for future use.

    Screenshots:

    size 6 and size 5 of a logged-in user
    Last edited by theczech; 01-15-2007 at 08:22 PM.

  3. #3
    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!

  4. #4

    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 11:31 AM.

  5. #5
    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>

  6. #6

    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?

  7. #7
    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!

  8. #8

    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.

  9. #9
    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">

  10. #10

    Default Re: Local weather

    Thanks!!!!

    Code fixed now and all should be working well ... appreciate your hawk eye!

  11. #11

    Default Re: Local weather

    is there a version for us uk users??? we dont have zip codes but post codes

  12. #12

    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 ...

  13. #13
    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 04:25 PM.

  14. #14

    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.

  15. #15

    Default Re: Local weather

    Works GREAT on our page so far.
    Last edited by mamasnbabies; 03-21-2007 at 04:18 PM.

  16. #16

    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 05:56 PM.

  17. #17

    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!

  18. #18

    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.

  19. #19

    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 ...

  20. #20

    Default Re: Local weather

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

    Grats on the little one!

Page 1 of 6 1234 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Local music community
    By jaffa in forum Show off your vBadvanced!
    Replies: 0
    Last Post: 06-15-2006, 12:45 PM
  2. Weather Channel - Weather Module
    By boo in forum Add-On Modules & Modifications
    Replies: 29
    Last Post: 09-24-2005, 01:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •