The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
YoWindow Weather Widget Details »» | |||||||||||||||||||||||||||||||||||||||
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> <div class="block smaller"> <div class="blocksubhead"> <a class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a> <span class="blocktitle">{vb:raw blockinfo.title}</span> </div> <div class="widget_content blockbody floatcontainer"> <div id="block_html_{vb:raw blockinfo.blockid}" class="blockrow"> <vb:if condition="$bbuserinfo[fieldXX] !=''"> <div style="width:230px; height:150px;"> <object type="application/x-shockwave-flash" data="http://swf.yowindow.com/yowidget3.swf" width="220" height="150"> <param name="movie" value="http://swf.yowindow.com/yowidget3.swf"/> <param name="allowfullscreen" value="true"/> <param name="wmode" value="opaque"/> <param name="bgcolor" value="#FFFFFF"/> <param name="flashvars" value="location_id=gn:{vb:raw bbuserinfo.fieldXX}&time_format=24&us=metric&background=#FFFFFF&mini_locationBar=false&copyright_bar=false" /> <a href="http://yowindow.com/weatherwidget.php" style="width:220px;height:150px;display: block;text-indent: -50000px;font-size: 0px;background:#DDF url(http://yowindow.com/img/logo.png) no-repeat scroll 50% 50%;" >HTML weather</a> </object> </div> <div style="width: 220px; height: 15px; font-size: 14px; font-family: Arial,Helvetica,sans-serif;"> <span style="float:left;"><a target="_top" href="http://yowindow.com?client=widget&link=copyright" style="color: #2fa900; text-decoration:none;" title="Desktop weather">YoWindow.com</a></span> <span style="float:right; color:#888888;"><a href="http://yr.no" style="color: #2fa900; text-decoration:none;">yr.no</a></span> </div> <vb:else /> <br/><b>Add your <a href="{vb:raw vboptions.bburl}/profile.php?do=editprofile">Weather Location Code</A> to show your weather forecast in this block. <br/></b> </vb:if> </div> </div> </div> <div class="underblock"></div> </li></center> 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. Screenshots
Show Your Support
|
Comments |
#2
|
||||
|
||||
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"> <div class="block"> <div class="cms_widget_header"> <h3><img src="{vb:stylevar imgdir_siteicons}/html.png" alt="" /> {vb:raw widget_title}</h3> </div> <div class="cms_widget_content_restore_widget_content"> <center> <vb:if condition="$bbuserinfo[fieldXX] !=''"> <div style="width:230px; height:150px;"> <object type="application/x-shockwave-flash" data="http://swf.yowindow.com/yowidget3.swf" width="220" height="150"> <param name="movie" value="http://swf.yowindow.com/yowidget3.swf"/> <param name="allowfullscreen" value="true"/> <param name="wmode" value="opaque"/> <param name="bgcolor" value="#FFFFFF"/> <param name="flashvars" value="location_id=gn:{vb:raw bbuserinfo.fieldXX}&time_format=24&us=metric&background=#FFFFFF&mini_locationBar=false&copyright_bar=false" /> <a href="http://yowindow.com/weatherwidget.php" style="width:220px;height:150px;display: block;text-indent: -50000px;font-size: 0px;background:#DDF url(http://yowindow.com/img/logo.png) no-repeat scroll 50% 50%;" >HTML weather</a> </object> </div> <div style="width: 220px; height: 15px; font-size: 14px; font-family: Arial,Helvetica,sans-serif;"> <span style="float:left;"><a target="_top" href="http://yowindow.com?client=widget&link=copyright" style="color: #2fa900; text-decoration:none;" title="Desktop weather">YoWindow.com</a></span> <span style="float:right; color:#888888;"><a href="http://yr.no" style="color: #2fa900; text-decoration:none;">yr.no</a></span> </div> <vb:else /> <br/><b>Add your <a href="{vb:raw vboptions.bburl}/profile.php?do=editprofile">Weather Location Code</A> to show your weather forecast in this block. <br/></b> </vb:if> </div> </center> </div> </div> 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. |
#3
|
||||
|
||||
That is so cool! Thank you very much!
|
#4
|
||||
|
||||
It is quite configurable too if you want to change the size, units, time, scenery image etc - just match up your new settings (embedded code) to the code I've given and remember to re-add the <vb:if condition="$bbuserinfo[fieldXX] !=''"> and {vb:raw bbuserinfo.fieldXX} bits.
|
Благодарность от: | ||
Taurus1 |
#5
|
|||
|
|||
Look great Gemma!!
Just to confirm what happens if there is no weather set in your profile field? what does it default to? |
#6
|
||||
|
||||
Quote:
Code:
<vb:else /> <br/><b>Add your <a href="{vb:raw vboptions.bburl}/profile.php?do=editprofile">Weather Location Code</A> to show your weather forecast in this block. <br/></b> </vb:if> </div> Code:
<vb:if condition="$bbuserinfo[fieldXX]"> <center><li> <div class="block smaller"> <div class="blocksubhead"> <a class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a> <span class="blocktitle">{vb:raw blockinfo.title}</span> </div> <div class="widget_content blockbody floatcontainer"> <div id="block_html_{vb:raw blockinfo.blockid}" class="blockrow"> <div style="width:230px; height:150px;"> <object type="application/x-shockwave-flash" data="http://swf.yowindow.com/yowidget3.swf" width="220" height="150"> <param name="movie" value="http://swf.yowindow.com/yowidget3.swf"/> <param name="allowfullscreen" value="true"/> <param name="wmode" value="opaque"/> <param name="bgcolor" value="#FFFFFF"/> <param name="flashvars" value="location_id=gn:{vb:raw bbuserinfo.fieldXX}&time_format=24&us=metric&background=#FFFFFF&mini_locationBar=false&copyright_bar=false" /> <a href="http://yowindow.com/weatherwidget.php" style="width:220px;height:150px;display: block;text-indent: -50000px;font-size: 0px;background:#DDF url(http://yowindow.com/img/logo.png) no-repeat scroll 50% 50%;" >HTML weather</a> </object> </div> <div style="width: 220px; height: 15px; font-size: 14px; font-family: Arial,Helvetica,sans-serif;"> <span style="float:left;"><a target="_top" href="http://yowindow.com?client=widget&link=copyright" style="color: #2fa900; text-decoration:none;" title="Desktop weather">YoWindow.com</a></span> <span style="float:right; color:#888888;"><a href="http://yr.no" style="color: #2fa900; text-decoration:none;">yr.no</a></span> </div> </div> </div> </div> <div class="underblock"></div> </li></center></vb:if> |
#7
|
|||
|
|||
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 |
#8
|
||||
|
||||
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 |
#9
|
|||
|
|||
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? |
#10
|
||||
|
||||
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 |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|