Plugin Directory

Changeset 1319968


Ignore:
Timestamp:
01/02/2016 06:09:37 PM (10 years ago)
Author:
MalteseSolutions
Message:

Update for New Year fix

Location:
fireems-stats
Files:
26 added
3 edited

Legend:

Unmodified
Added
Removed
  • fireems-stats/trunk/assets/admin.php

    r1294662 r1319968  
    44 *
    55 * @link       http://maltesesolutions.com
    6  * @since      1.0.0
     6 * @since      1.1.1
    77 *
    88 * @package    FireEms Stats
     
    1111function fireems_updatepage() {
    1212    $Option = get_option('fireEMS');
     13    $ServerYear = (int)substr(current_time( 'mysql' ), 0, 4);
    1314    $Year = ($_GET['year_id']);
    1415    if($Year == 0) {
    1516        $CurrentYear = $Option['currentyear'];
     17        if($Option['currentyear'] < $ServerYear) {
     18            $CurrentYear = $ServerYear;
     19        } else {
     20            $CurrentYear = $Option['currentyear'];
     21        }
    1622    } else {
    1723        $CurrentYear = $Year;
     
    4248        case 'notable':
    4349            create_newyear($_POST['NewYear']);
     50
     51            // Update options to reflect the current year
     52            $fireEMS_options = array(
     53                'installed' => '1',
     54                'col1_title' => $Option['col1_title'],
     55                'col2_title' => $Option['col2_title'],
     56                'col3_title' => $Option['col3_title'],
     57                'display_col1' => $Option['display_col1'],
     58                'display_col2' => $Option['display_col2'],
     59                'currentyear' => $ServerYear
     60            );
     61            update_option('fireEMS', $fireEMS_options);
     62
    4463            $success = 1;
    4564            $smsg = '<div id="message" class="updated">A New Year Has Been Created!</div>';
  • fireems-stats/trunk/assets/functions.php

    r1294662 r1319968  
    5252function create_newyear($Year) {
    5353    $NewYear = $Year;
    54     $CurrentYear = date(Y);
    5554    global $wpdb;
    5655    $prefix = $wpdb->prefix;
     
    7776        // Update Year Table
    7877        $wpdb->insert("$stats", array('year' => $NewYear));
    79     }
    80     if($NewYear > $CurrentYear) {
    81         // Update Options with Current Year
    82         update_option('fireEMS_current_year', $NewYear);
    8378    }
    8479    $wpdb->flush();
  • fireems-stats/trunk/readme.txt

    r1294662 r1319968  
    33Tags: fire department, EMS, monthly calls, fire stats, ems stats
    44Requires at least: 4.0
    5 Tested up to: 4.3.1
    6 Stable tag: 1.0.1
     5Tested up to: 4.4
     6Stable tag: 1.1.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1414FireEMS Stats (Lite) allows your Fire or EMS Organization to list montly activity on the front page.
    1515Edit your stats manually to keep your visitors and community up to date.
    16 
    17 * Infinite polls
    18 * Multiple polls per page
    19 * One preference per user
    20 * Customizable text
    21 * Lightweight script
    22 * List of voters per poll
    2316
    2417Please take just few seconds to rate this plugin and tell the others how it works.
     
    5144== Changelog ==
    5245
     46= 1.1.1 (2016-01-01) =
     47* The program failed to recognize the current year of the server.
     48
    5349= 1.0.1 (2015-11-25) =
    5450* Fixed an issue with the uninstall plugin
Note: See TracChangeset for help on using the changeset viewer.