Plugin Directory

Changeset 1846121


Ignore:
Timestamp:
03/24/2018 09:44:43 AM (8 years ago)
Author:
abooze
Message:

v1.2 - older php compatibility

Location:
ab-simple-weather
Files:
17 added
2 edited

Legend:

Unmodified
Added
Removed
  • ab-simple-weather/trunk/Readme.txt

    r1844696 r1846121  
    22Contributors: abooze
    33Donate link: http://aboobacker.com/
    4 Tags: 1.1
     4Tags: 1.2
    55Requires at least: 4.0
    6 Tested up to: 4.9.1
     6Tested up to: 4.9.4
    77Requires PHP: 5.4
    8 Stable tag: 1.1
     8Stable tag: 1.2
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5858* Initial release.
    5959
     60= 1.1 =
     61* Fixed a minor bug
     62
     63= 1.2 =
     64* Fixed older PHP version compatibility
     65
    6066== Upgrade notice ==
    61 
    62 = 1.1 =
    63 Fixed a minor bug
  • ab-simple-weather/trunk/ab-simple-weather.php

    r1844696 r1846121  
    44Description: A simple but powerful plugin to show current weather in your website
    55Author: Aboobacker P Ummer
    6 Version: 1.1
     6Version: 1.2
    77*/
    88register_activation_hook(__FILE__, 'absw_defaults_fn');
     
    4343add_filter("mce_external_plugins", "enqueue_abswTiny_script");
    4444add_action( 'wp_enqueue_scripts', 'absw_weather_assets' );
    45 function absw_weather_script() { ?>
     45function absw_weather_script() {
     46    $options = get_option('absw_plugin_options'); ?>
    4647    <script type="text/javascript ">
    4748    //Docs at http://simpleweatherjs.com
    4849    jQuery(document).ready(function() {
    4950        jQuery.simpleWeather({
    50             location: '<?php echo get_option("absw_plugin_options")["weather_loc"];?>', 
     51            location: '<?php echo $options["weather_loc"];?>', 
    5152            woeid: '',
    52             unit: '<?php echo $unit = get_option("absw_plugin_options")["absw_weather_unit"] == 'Celsius' ? 'c' : 'f'; ?>',
     53            unit: '<?php echo $unit = $options["absw_weather_unit"] == 'Celsius' ? 'c' : 'f'; ?>',
    5354            success: function(weather) {
    54                 html = '<<?php echo get_option("absw_plugin_options")["absw_element"];?> class="abWeatherDisplay">';
    55                 <?php if ( isset(get_option("absw_plugin_options")["weather_icon"] ) && get_option('absw_plugin_options')['weather_icon'] != '' ) { ?>
    56                 html += '<i class="absicoin_<?php echo get_option("absw_plugin_options")["absw_element"];?> icon-' + weather.code + '"></i> ';
     55                html = '<<?php echo $options["absw_element"];?> class="abWeatherDisplay">';
     56                <?php if ( isset($options["weather_icon"] ) && $options['weather_icon'] != '' ) { ?>
     57                html += '<i class="absicoin_<?php echo $options["absw_element"];?> icon-' + weather.code + '"></i> ';
    5758                <?php } ?>
    5859                html += weather.temp + '&deg;' + weather.units.temp;
    59                 html += '</<?php echo get_option("absw_plugin_options")["absw_element"];?>>';
     60                html += '</<?php echo $options["absw_element"];?>>';
    6061                html += '<ul>';
    61                 <?php if ( isset(get_option("absw_plugin_options")["city"] ) && get_option("absw_plugin_options")["city"] != '' ) { ?>
     62                <?php if ( isset($options["city"] ) && $options["city"] != '' ) { ?>
    6263                html += '<li>' + weather.city + ', ' + weather.region;
    6364                <?php } ?>
    64                 <?php if ( isset(get_option("absw_plugin_options")["country"] ) && get_option("absw_plugin_options")["country"] != '' ) { ?>
     65                <?php if ( isset($options["country"] ) && $options["country"] != '' ) { ?>
    6566                html += ', ' + weather.country + ' </li>';
    6667                <?php } else  { ?>
    6768                html += ' </li>';
    6869                <?php } ?>
    69                 <?php if ( isset(get_option("absw_plugin_options")["condition"] ) && get_option("absw_plugin_options")["condition"] != '' ) { ?>
     70                <?php if ( isset($options["condition"] ) && $options["condition"] != '' ) { ?>
    7071                html += '<li class="currently">' + weather.currently + '</li>';
    7172                <?php } ?>
    72                 <?php if ( isset(get_option("absw_plugin_options")["humidity"] ) && get_option("absw_plugin_options")["humidity"] != '' ) { ?>
     73                <?php if ( isset($options["humidity"] ) && $options["humidity"] != '' ) { ?>
    7374                html += '<li class="humidity">Humidity ' + weather.humidity + '%</li>';
    7475                <?php } ?>
    75                 <?php if ( isset(get_option("absw_plugin_options")["wind"] ) && get_option("absw_plugin_options")["wind"] != '' ) { ?>
     76                <?php if ( isset($options["wind"] ) && $options["wind"] != '' ) { ?>
    7677                html += '<li>' + weather.wind.direction + ' ' + weather.wind.speed + ' ' + weather.units.speed + '</li>';
    7778                <?php } ?>
Note: See TracChangeset for help on using the changeset viewer.