Update the code in order to meet latest yahoo API weather changes
Update the info – ho i find my WOEID
think is the best wp weather plugin – that’s why i fixed it ??
https://www12.zippyshare.com/v/U4h8nnbp/file.html
Plugin could not be activated because it triggered a fatal error.
Fatal error: Cannot redeclare register_mysettings() (previously declared in /homepages/9/d531093429/htdocs/WeatherPress/wp-content/plugins/smooth-slider/settings/settings.php:1053) in /homepages/9/d531093429/htdocs/WeatherPress/wp-content/plugins/beautiful-yahoo-weather/inc/options-page.php on line 32
When i try to Activate that is what I get, what do I need to do next?
Thank you for your time.
Curtis
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>the forecast display the wrong days.
ie. we are monday and the next days are thursday and friday !!!
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>“urdu” => array(
“????? ???”,
“????? ??????? “,
” ?????”,
” ???? ?????”,
” ?????? ???? “,
” ???? ??? ??? ????”,
” ???? ??? ????”,
” ??? ??? ????”,
” ?????? ????? ????? “,
” ????? ????? “,
” ??? ???? “,
” ???? “,
” ????”,
” ???”,
” ???? ??? ??? “,
” ??? ?? ???? ??? “,
” ??? “,
” ???? “,
” ????? “,
“????”,
” ?????? “,
” ??? ??? ???? ?? ?????? “,
” ????? “,
” ??? “,
” ???”,
“???”,
” ??? ????”,
” ??? ???? “,
” ????? ?? ??? ???? “,
” ???? ??? ?? ??? ???? ??? “,
” ??? ?? “,
” ??? ??? “,
” ???? ?? ????? ??? “,
” ?????? ??? “,
” ??”,
” ???? ??? ??????? ????”,
” ??? ???”,
” ?????? ???? “,
” ???? “,
” ???? “,
” ???? “,
” ???? ??????? “,
” ??? ???? “,
” ???? ??????? “,
” ???? “,
” ????? ????? “,
” ???? ??? ??? “,
” ?????? ????”,
3200 => ” ?????? ???? ?? “
) ,
///////////////////////////////////////////////////////////////////////////
‘urdu’=>array(
“??? ?? ?????”,
“???”,
” ??”,
“????”,
“????”,
“????”,
“????”,
“???? ?????”,
“???? ?????”,
“???”,
“?????”,
“????”,
“?????”,
“???”,
“????”,
“????????”,
“??????”,
“????”,
“????”
),
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>I think I’m missing something really obvious – no forecast is showing up at all. I went to the settings in the sidebar and added the city code from the extended forecast per the instructions, updated all the settings for styling and descriptions, and then added the widget to my footer via the Appearance > Widgets menu. All that shows up is the title I’ve given the widget in the Footer section.
What am I missing?
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>Wanting to use this plugin on a site that will be measured for Accessibility factors but it is throwing errors due to missing “alt” tags on the images used in the plugin. The images are those that indicate ‘sun’, ‘sun+cloud’, ‘moon’ etc.
Could you please add meaningful “alt” tags for the images used in the plugin?
(not title tags, they’re bad for Accessibility).
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>I’m not sure what happened to the plugin author.. I haven’t seen many responses, but here are some updates that I hope helps someone else.
I am a very picky weather widget person… and after initially shooting this plugin down, I gave it another try. It took alot of manual editing but it is finally perfect.
I know others have asked about removing certain data fields, and I had that same issue…. and same goes for custom text that did not show up, so those were manual as well. It seems that the CSS codes did work properly, so you can still made those changes thru the plugin options.
I also found that certain cities WOEID codes did not work with this widget— that’s a bummer. When I used the nearest big city, and it worked ok… but still wish it worked with any city code.
I also needed to remove the blank space that was left at the top, if you had no widget title. This is the CSS I used to hide that :
/* Hide widget title on top of beautiful yahoo weather sidebar widget */
#byw-2 .widget-title {
display: none;
}
I have manually edited the shortcode.php file (in the inc directory), and finally made it work for me…. I’ll paste the code below and hopefully it helps others.
Make sure you Rename or backup your original shortcode.php file.
Then dump this code into new file with shortcode.php filename, then upload via FTP:
<?php // [beautiful-yahoo-weather]
function beautifulyahooweather_func()
{
$location = get_option('byw_woeid');
$unit = get_option('byw_unit');
$imgset = plugins_url('../images/', __FILE__) . get_option('byw_image_set') . "/png/";
$lang = get_option('byw_lang');
$name_city = get_option('byw_name_city');
$bgcolor = get_option('byw_bgcolor');
$css = get_option('byw_css');
$mylang = get_option('byw_mylang');
$smylang = get_option('byw_smylang');
$byw_rtlorltr=get_option('byw_rtlorltr');
$byw_fontsize=get_option('byw_fontsize');
// Get database cache
$byw_feed = get_transient('weather_feed');
if (empty($byw_feed))
{
$query = "select * from weather.forecast where location = '" . $location . "' and u = '" . $unit . "'";
$url = 'https://query.yahooapis.com/v1/public/yql?q=' . urlencode($query) . '&rnd=' . date('Y') . (date('n') - 1) . date('w') . date('G') . '&format=json';
$jsonStr = file_get_contents($url);
$phpobj = json_decode($jsonStr);
$byw_feed = $phpobj->query->results->channel;
// Set database cache
set_transient('weather_feed', $byw_feed, 5*60);
}
$wd = $byw_feed->wind->direction;
$wf = $byw_feed->item->forecast[0]; //today
$wf_1 = $byw_feed->item->forecast[1]; // after 1 day
$wf_2 = $byw_feed->item->forecast[2]; // after 2 day
if ("315" <= $wd or $wd < "45")
{
$wind_jahat = 3; // 3=North
}
elseif ("45" <= $wd and $wd < "135")
{
$wind_jahat = 4; // 4=East
}
elseif ("135" <= $wd and $wd < "225")
{
$wind_jahat = 5; // 5=South
}
else
{
$wind_jahat = 6; //6=West
}
include('lang.php');
if (!empty($wd)) { ?>
<div class="weather-wid" style="font-family: inherit; direction:<?php print $byw_rtlorltr ?>; background-color:<?php print $bgcolor; ?>; overflow:hidden; padding: 0px;">
<div class="now-weather">
<div class="c-now-weather" style="margin: 0px; font-size: 22px; color: rgba(81, 81, 81, 1); margin: 0 0 4px 0; <?php print "font-size: $css[2]px; color: $css[3]; font-family:$css[4];" ?> "><?php print $name_city; ?><img style="margin-top:-20px;margin-left:6px; float: none;" src="<?php print plugins_url( '../images/i1.png' , __FILE__ ) ?>"></div>
<div class="t-now-weather" style="float:left; width: 100%; <?php if ( $byw_rtlorltr=="rtl" ){ print 'text-align: right;';}else{print 'text-align: left;';} ?>">
<img style="margin-bottom: -10px; float:<?php if($byw_rtlorltr=="rtl") { print 'left';} else { print 'right';} ?>;max-width: 50%; <?php print "height: $css[0]px; width: $css[1]px;" ?>" src="<?php print $imgset; ?><?php print $byw_feed->item->condition->code; ?>.png">
<span style=" <?php print "font-size: $css[5]px; color: $css[6]; font-family:$css[7];" ?> "><?php print $byw_feed->item->condition->temp; ?></span>
<sup class="c-t-now-weather" style="color:rgba(131, 131, 131, 0.43); <?php print "font-size: $css[8]px; color: $css[9]; font-family:$css[10];" ?> ">
°<?php print strtoupper($unit); ?>
</sup>
<br />
<span class="w-c-t-now-weather" style=" <?php print "font-size: $css[11]px; color: $css[12]; font-family:$css[13];" ?> ">
<?php print " ".$condition_text[$lang][$byw_feed->item->condition->code]; ?>
</span>
<br />
</div>
<div style="float:left; width:100%;font-size:11px;">
<span class="b-now-weather" style="font-size: 12px; <?php print "font-size: $css[14]px; color: $css[15]; font-family:$css[16];" ?> ">
<?php print $transl[$lang][0]; ?>: <?php print round($byw_feed->wind->speed,1); ?> k/h
</span>
<br />
<span style="font-size: 12px; <?php print "font-size: $css[17]px; color: $css[18]; font-family:$css[19];" ?> ">
Wind direction: <?php print $transl[$lang][$wind_jahat]; ?>
</span>
<br />
<span style=" <?php print "font-size: $css[31]px; color: $css[32]; font-family:$css[33];" ?> ">
<?php print $transl[$lang][7] . ": " . $byw_feed->astronomy->sunrise . " , " . $transl[$lang][8] . ": " . $byw_feed->astronomy->sunset; ?>
</span>
<span style="float:left; width:100%; margin-bottom:5px;font-size:9px;<?php print "font-size: $css[34]px; color: $css[35]; font-family:$css[36];" ?> ">
<?php print $transl[$lang][9] . ": " . $byw_feed->atmosphere->humidity ." % , " . $transl[$lang][11] . ": " . round($byw_feed->atmosphere->pressure/1000, 2) . " bar"; ?>
</span>
</div>
<div style="font-size:14px; overflow:hidden; width:100%; float:left;">
<div style="font-size:14px; float:left; width:32%; text-align:center; <?php print "font-size: $css[22]px; color: $css[23]; font-family:$css[24];" ?> " class="today">
<img style="max-width:100%;<?php print "height: $css[20]px; width: $css[21]px;" ?>" src="<?php print $imgset.$wf->code; ?>.png">
<br />
<?php print $transl[$lang][2]; ?>
<br />
<span class="ht-today" style="color:rgba(81, 81, 81, 1); <?php print "font-size: $css[25]px; color: $css[26]; font-family:$css[27];" ?>"><?php print $wf->high; ?><sup class="s-today">°</sup></span> <span style="color:#aeb2ae; <?php print "font-size: $css[28]px; color: $css[29]; font-family:$css[30];" ?> " class="lt-today"><?php print $wf->low; ?><sup class="s-today">°</sup></span>
</div>
<div class="today" style="font-size:14px; text-align:center; border-right:2px solid rgba(240, 240, 240, 0.66); border-left:2px solid rgba(240, 240, 240, 0.66);float:left; width:33%; <?php print "font-size: $css[22]px; color: $css[23]; font-family:$css[24];" ?> ">
<img style="max-width:100%; <?php print "height: $css[20]px; width: $css[21]px;" ?> " src="<?php print $imgset.$wf_1->code; ?>.png">
<br />
<?php print esc_attr($transl[$lang][$condition_day[$wf_1->day]]); ?>
<br />
<span class="ht-today" style="color:rgba(81, 81, 81, 1); <?php print "font-size: $css[25]px; color: $css[26]; font-family:$css[27];" ?>"><?php print $wf_1->high; ?><sup class="s-today">°</sup></span> <span style="color:#aeb2ae; <?php print "font-size: $css[28]px; color: $css[29]; font-family:$css[30];" ?>" class="lt-today"> <?php print $wf_1->low; ?><sup class="s-today">°</sup></span>
</div>
<div style=" font-size:14px; float:left; width:32%; text-align:center; <?php print "font-size: $css[22]px; color: $css[23]; font-family:$css[24];" ?> " class="today">
<img style="max-width:100%; <?php print "height: $css[20]px; width: $css[21]px;" ?> " src="<?php print $imgset.$wf_2->code; ?>.png">
<br />
<?php print esc_attr($transl[$lang][$condition_day[$wf_2->day]]); ?>
<br />
<span class="ht-today" style="color:rgba(81, 81, 81, 1); <?php print "font-size: $css[25]px; color: $css[26]; font-family:$css[27];" ?> "><?php print $wf_2->high; ?><sup class="s-today">°</sup></span> <span style="color:#aeb2ae; <?php print "font-size: $css[28]px; color: $css[29]; font-family:$css[30];" ?> " class="lt-today"> <?php print $wf_2->low; ?><sup class="s-today">°</sup></span>
</div>
</div>
</div>
<?php } } add_shortcode('beautiful-yahoo-weather', 'beautifulyahooweather_func'); ?>
Thanks.
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>Hi, Author,
One more question, the widget updates the weather around 4:00PM in Taiwan.
How can I make it updated in the early morning?
Thanks.
Best regards,
Alvin
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>Hi, Author,
I think that it is the best free plugin on www.ads-software.com.
So fancy!
I also installed WPML for Chinese and English.
Is it possible to show English weather info in English pages and Chinese info in Chinese pages?
Regards,
Alvin
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>I try to use this but the WOEID of BORACAY is wrong spelling, WOEID current spelling is BOROCAY.
how to correct it?
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>How to change from metric (km/h) to english (miles)?
Thanks.
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>Hi,
I really like your weather plugin… however when I added the widget version, I am getting the errors below when I try to load the page.
Any ideas?
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /homepages/45/d231223501/htdocs/5-aurora/wp-content/plugins/beautiful-yahoo-weather/inc/shortcode.php on line 21
Warning: file_get_contents(https://query.yahooapis.com/v1/public/yql?q=select+%2A+from+weather.forecast+where+location+%3D+%2715022410%27+and+u+%3D+%27c%27&rnd=20141156&format=json) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /homepages/45/d231223501/htdocs/5-aurora/wp-content/plugins/beautiful-yahoo-weather/inc/shortcode.php on line 21
Thank you
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>Hi, here’s a corrected translation, in French, to include in “lang.php”.
( lines 513 > 563 )
'french' => array(
" Tornade ",
" Tempête tropicale ",
" Tempête ",
" Orages ",
" Foudre ",
" Pluie avec neige ",
" Pluie et grêle ",
" Neige et pluie ",
" Bruine vergla?ante ",
" Bruine ",
" Pluie froide ",
" Pluie ",
" Pluie ",
" Neige ",
" Pluie et neige ",
" Vent et neige ",
" Neige ",
" Grêle ",
" Gel ",
" Brume sèche ",
" Brumeux ",
" Brouillard et brume ",
" Brouillard ",
" Vent ",
" Vent ",
" Froid ",
" Nuageux ",
" Pluie nocturne",
" Nuageux ",
" Nuit couverte ",
" Ciel clair ",
" Ciel clair ",
" Ensoleillé ",
" Nuit de pleine lune ",
" Jour ",
" Pluie et grêle ",
" Très chaud ",
" Foudre ",
" Pluie ",
" Pluie ",
" Pluie ",
" Neige ",
" Averses de neige ",
" Forte neige ",
" Pluie ",
" Bruine ",
" Pluie et neige ",
" Foudre ",
3200 => "non disponible"
),
Best regards.
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>Hi,
Is it possible to change the sunrise / sunset hours to a 24h format ?
” 7:12 am 5:43 pm ” to ” 07:12 17:43 ” …ect..
Best regards.
Tks.
( and, Mr Pishdar, thank you for this great plugin !)
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>hey don’t work for me?
this error… it’s not show infomartion….
https://phanmemquanlyquancafefull.files.wordpress.com/2014/09/er.png
thanks
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>Hello Developer,
Any option to show 7 days weather instead of three >??
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>Any chance in future updates for options to pick Speed & Visibility: MPH (vs KPM) and Pressure: Inches (vs BAR)?
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>Hi, your weather plugin is beautiful. However, the Greek translations are really wrong/incomplete.
I’ve tried entering my own custom descriptions in the table provided, but they don’t display. I’m editing language.php instead as a quick fix, but since it’ll get overwritten on update it would be nice if the custom description feature worked.
Would also be happy to send you a corrected Greek translation once I’m done, if you can let me know how to get it to you.
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>The weather widget on my site randomly disappears and reappears. This plugin seems to work just fine, so I’m wondering if it’s Yahoo’s service cutting out. Have you or anyone experienced this issue before?
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>Hi,
How can i set auto location for site viewers ?
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>Hi, not sure how to test this, but does the weather auto update dynamically on the page without refresh? Thanks
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>Hi,
Please pardon my ignorance but, I need help in setting up temp/ forcast for different cities for different pages. This interface/GUI is the best I came across and I am hell bent on implementing this plugin.
I’d sincerely appreciate the help in configuring, please pardon my ignorance if I might have missed this feature if there is already.
Much respect and love.
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>nice plugin.
if I don’t want certain lines, such as wind speed, direction, humidity, etc’ where can i remove those so the lines and images i do want will move up instead of having an empty space(which happens if i just enter ‘0’ for font size).
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>Hi,
When i try to edit the input for the weather widget and try to save it i get this warning:
“Warning: Cannot modify header information – headers already sent by (output started at /home/wedding/public_html/wp-content/plugins/beautiful-yahoo-weather/shortcode.php:1869) in /home/wedding/public_html/wp-includes/pluggable.php on line 1121”
Any ideas how i can fix it? Cheers!!
https://www.ourwedding.nl
Theme: Radiate
php 5.4
https://www.ads-software.com/plugins/beautiful-yahoo-weather/
]]>