![]() |
YoWindow Weather Widget
1 Attachment(s)
What is it?
A simple template modification to bring the YoWindow Weather Widget to vB4 Quote:
Title: Weather Location Code Description: (Whatever you want - here's what I use because the process might confuse some users) Quote:
Field Editable by User: Yes Private Field: Yes Field Searchable on Members List: No Show on Members List: No Display Page: Edit Profile Take note of the newly created profile field number. 2. Next you need to create a new template. Go to AdminCP > Styles & Templates > Style Manager > Add New Template Title: block_weather Code:
<center><li> 3. Go to AdminCP > Forums & Moderators > Forum Blocks Manager > Add Block Title: Weather Forecast Content Type: HTML Content: <div></div> Template To Use: block_weather Now, this part may prove tricky for some going by what I've seen in other weather widget modifications so I'll try and make it simple and add a few pictures, this process is also required to be done by your members to display their local forecast. Go to http://yowindow.com/weatherwidget.php and fill in your details and generate the code. The only part of the code you need is the number after id=gn: and before &. Take note of that number and go to Edit Profile on your site, scroll down to the newly made Weather Code Location and blurb box and enter the number. Save your profile. Go back to your forum home and the new block should display with your weather details for the next 5 days. Click on the scenery image and it will expand to full-screen and give a more detailed outlook. How To Add Location Scenery (village, seaside, airport or oriental) To Your Weather Widget - https://vborg.vbsupport.ru/showpost....1&postcount=24 How To Add Weather Widget To Member Profiles - https://vborg.vbsupport.ru/showpost....4&postcount=18 Added: 28.12.2012 An alternative version that uses IP location to display the weather rather than creating and entering data into a profile field can be found here - https://vborg.vbsupport.ru/showpost....8&postcount=36. It also allows the user to display weather forecasts from many other locations via dropdown menus. If anyone wants to further develop any of my addons, you are free to do so. |
To make a CMS widget
1. Go to AdminCP > Styles & Templates > Style Manager > Add New Template Title: vbcms_widget_weather Code:
<div class="cms_widget"> 2. Go to AdminCP > vBulletin CMS > Widgets > Create New Widget Type: Static HTML Title: Weather Forecast Save 3. Configure the newly created widget Enter Static HTML: <div></div> Template Name: vbcms_widget_weather Save 4. Go to AdminCP > vBulletin CMS > Layout Manager and place the weather widget where you want it to appear on your CMS grid. |
That is so cool! Thank you very much!
|
Quote:
|
Look great Gemma!!
Just to confirm what happens if there is no weather set in your profile field? what does it default to? |
Quote:
Code:
<vb:else /> Code:
<vb:if condition="$bbuserinfo[fieldXX]"> |
Ah thanks, just trying it out now...
Looks great, shame the list is not very comprehensive for Spain, no Balearic islands and so on, hopefully they will add some :) |
I've made a small edit to the block_weather code. I didn't realise I had left a part of my own location in the code and I've also set the miniLocation_bar to false.
To update just replace the block_template code |
Hey Gemma,
Do you know how difficult it would be to add this to a 'weather' tab on a usersprofile instead of a sidebar block? Only thinking as then you don't have an empty block for those who do not want to use it or slowing down loading speeds every time the page is loaded? |
I'll have a look and get back to you about the tab :)
But if you don't want it to show to those who don't enter anything in the profile field replace the block_template code with the code in this post |
Hey Gemma, I didn't initially read the whole thread, I just started installing it because it seemed awesome...
...until I realized it required Forum Block Sidebar. :sad: How can I adapt this so that members can put it in their profile? That's what I initially thought this was. I don't use forum sidebar on my site because members complain it slows down their browser. |
1 Attachment(s)
Quote:
Quote:
There is probably a lot simpler way to do this - I've never created a profile block before. 1. Create your profile field as normal. 2. Then create a new template called weather_aboutme Code:
<div> 3. In your AdminCP, go to Plugins & Products > Add New Plugin Product: vBulletin Hook Location: member_build_blocks_start Title: Show Weather In Profile Execution Order: 5 Plugin PHP Code: Code:
{ |
You're so awesome it's ridiculous.
|
That is brilliant! Thank you so much!!!
|
Is there one of these that will work on vbulletin forum 4.0? Please would love one
|
Quote:
|
This might be asking for too much, but . . doesn't hurt to try.
I like the idea of adding this widget as a box in the member profile. I went through this post and followed the instructions and it works . . . but . . . I notice that no matter which user profile I am viewing on the forums, it still loads my personalized YoWindow on the page. Is there anyway to make this only display on your personal profile page? and better yet, allow you to view the forecast for other users if you browse their profile? |
Quote:
In your MEMBERINFO template find: Code:
{vb:raw template_hook.profile_sidebar_stats} Code:
<!---Weather Profile Block---> No need for the plugin to be added from post#12, this will now show the weather for each member who has entered the profile data, if they haven't entered any data no block will appear....and when anyone else views the member's profile it will show the weather of the person whose profile you are viewing (if data entered). Also I've had to delete the <vb:else /> part of the code - if I get time later I'll look into that. |
That is exactly what I was looking for. Thank you Gemma ;)
|
Working great! Thanks!
|
Quote:
|
I've updated part of the code, it should still work with the old code but if you want to upgrade find:
Code:
<object type="application/x-shockwave-flash" data="http://swf.yowindow.com/wimo/hpPal/hpPal.swf" width="220" height="150"> Code:
<object type="application/x-shockwave-flash" data="http://swf.yowindow.com/yowidget3.swf" width="220" height="150"> |
Is there a way to add the different scenes to this? On the "block" all I can get is the country side looking one, but on profiles I got the airport one by playing with the code alittle....how would one make the airport or the other scenes work on block?
Or is this even possible? Thanks in advance. |
1 Attachment(s)
Quote:
Or you could do it this way. Create a new user profile field. Profile Field Type: Single-Selection Radio ButtonTitle: Weather Location Scene Description: Choose from Village, Seaside, Airport and Oriental imagery for the background of your weather forecast report. Options: village seaside airport oriental Set Default: Yes Field Required: No Field Editable By User: Yes Private Field: Yes Field Searchable on Members List: No Show on Members List: No Take note of the profile field number. Save Note: the scenery options must be in lowercase letters (village, seaside, airport or oriental). In your template find Code:
amp;us=metric& Code:
{vb:raw bbuserinfo.fieldYY} Code:
amp;us=metric&{vb:raw bbuserinfo.fieldYY} |
Wow, just wow. Thank you very much. I used the first option you gave, as I then can switch it up for the members when I want them to see something different.
Thank you for taking the time Gemma! Very much appreciated. |
Quote:
|
Thanks, Gemma. Installed this one on my test board and it look super cool!!
|
@Gemma, Your widget language stays in English, but the original yowindow widget can change the language.
I changed the line Code:
value="location_id=gn:{vb:raw bbuserinfo.fieldXX}&time_format=24&us=metric&background=#FFFFFF&mini_locationBar=false&copyright_bar=false" Code:
value="location_id=gn:{vb:raw bbuserinfo.fieldXX}&time_format=24&us=metric&lang=nl&background=#FFFFFF&mini_locationBar=false&copyright_bar=false" |
Quote:
|
I have this mod now running on my board in the CMS as a widget, but changed the code a tiny bit so that it auto-scales. Now the code looks like this (my changes are marked in RED)
Code:
<div class="cms_widget"> |
Think my weather widget is broken. All it has done is show rain since the beginning of June :(
|
I inserted the code in the block, created the custom field and the number assigned in the field code. On vbulletin 4.2 shows always newyork is normal?
|
Quote:
|
Very nice, installed, along with a moon phase widget below.
|
The template code has been updated slightly, to update find:
Code:
<a href="http://yowindow.com?client=widget&link=stub" Code:
<a href="http://yowindow.com/weatherwidget.php" |
1 Attachment(s)
Here is an alternative method of displaying the widget. In this one it should display your weather according to your IP and also give you the option to view other locations.
To use this method, create a new template called block_weather and copy the following code: Code:
<li> Title: Weather Forecast Description: Whatever Cache Time: You Decide Display Order: Up to you Content Type: HTML Content: <div></div> Template To Use: block_weather Save. Purge cache. You should be able to add this to your CMS or MEMBERINFO (profile) template by substituting the block_weather code into the relevant template. |
Excellent work on this mod am wondering why it keeps defaulting to Temperature: °C??
Is there something I need to edit for it to either ask or default it to Temperature: °F? I am using the IP auto version which I think is really neat! |
1 Attachment(s)
Quote:
Thank you for your method, it is working , but with some problems for me: How to create a new template called block_weather? in pic 1: what is this box (with ? in my pic) how to change from F to Celsius degrees? although I have this in the code : unit_system: "metric" in pic 2: I have these blocks, but when i activate the weather block, it pushes these blocks to the bottom of the forum screen and with full size of the screen as in pic 3!! |
Quote:
Find: Code:
var flashvars = { Code:
var flashvars = { |
Quote:
Code:
var flashvars = { Code:
var flashvars = { |
All times are GMT. The time now is 02:21 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|