Plugin Directory

Changeset 789075


Ignore:
Timestamp:
10/17/2013 04:05:59 AM (12 years ago)
Author:
cptup
Message:

version 1.4.1

Location:
captain-up/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • captain-up/trunk/README.md

    r751697 r789075  
    9595## Changelog
    9696
     97###### 1.4.1
     98
     99* Support for WordPress 3.6.1
     100
     101* Better indication of a successful install.
     102
     103* Fixed issue with `cptup_widgets_edit.js`.
     104
    97105###### 1.4.0
    98106
  • captain-up/trunk/captainup.php

    r751697 r789075  
    44Plugin URI: http://www.captainup.com
    55Description: Add Game Mechanics to your site and increase your engagement and retention. 2 minutes install: Simply add your free Captain Up API Key and you are good to go. The plugin also adds widgets you can use to show leaderboards and activities within your site.
    6 Version: 1.4.0
     6Version: 1.4.1
    77Author: Captain Up Team
    88License: GPL2
     
    1515
    1616    if (isset($_POST['submit'])) {
     17       
     18        // Mark whether this is a new install of Captain Up. We'll
     19        // later display different messages based on this.
     20        if (get_option('captain-api-key') == "") {
     21            update_option('captain-first-install', true);
     22        } else {
     23            update_option('captain-first-install', false);
     24        }
     25
    1726        // Save the Captain Up options on POST
    1827        update_option('captain-api-key', $_POST['captain-api-key']);
     
    3342    }
    3443
    35     if(isset($_GET['submitted'])) {
    36         echo "<div id='update' class='updated'><p>Settings updated.</p></div>\n";
    37     }
    38 
    3944    // Get the Captain Up API Key
    4045    $captain_api_key = get_option('captain-api-key');
     
    4550    // Get the Captain Up Locale
    4651    $captain_locale = get_option('captain-locale');
     52
     53    // Get the first-install status
     54    $captain_first_install = get_option('captain-first-install');
     55
     56    // Add a message to the page, indicating that the form has
     57    // been submitted successfully, either (1) For enabling
     58    // Captain Up (2) Disabling Captain Up or (3) For changing
     59    // the settings.
     60    if (isset($_GET['submitted'])) {
     61        if ($captain_first_install == true && $captain_api_key != "") {
     62            echo "<div id='update' class='updated'><p>Rock on! Captain Up is now available on your site, <a target='_blank' href='".get_home_url()."'>go check it out ⇒</a></p></div>\n";
     63        } else if ($captain_api_key == "") {
     64            echo "<div id='update' class='updated'>".
     65                "<p>Captain Up has been <em>disabled</em>. If any problem ".
     66                "occured or you have any questions, ".
     67                "<a href='mailto:team@captainup.com'>".
     68                "contact our support team</a></p></div>\n";
     69        } else {
     70            echo "<div id='update' class='updated'><p>Your settings have been updated, <a target='_blank' href='".get_home_url()."'>see how everything looks ⇒</a></p></div>\n";
     71        }
     72    }
    4773
    4874    $pwd = dirname(__FILE__) . '/'; # Plugin Directory
     
    166192function cptup_settings_files($page) {
    167193    // I swear to god this is what Wordpress Codex suggests to do
    168     if ($page != "toplevel_page_cptup-config-menu") {
    169         return;
    170     }
     194    if ($page != "toplevel_page_cptup-config-menu") return;
     195
    171196    // Add the scripts
    172197    wp_enqueue_style('cpt-css');
     
    276301// Enqueue scripts to handle editing the Widgets options in
    277302# the widgets admin panel tab.
    278 function widgets_edit_script() {
    279         wp_enqueue_script(
    280             'cptup_widgets_edit',
    281             plugins_url('/js/cptup_widgets_edit.js', __FILE__),
    282             array('jquery')
    283         );
    284 }
    285 add_action('widgets_init', 'widgets_edit_script');
     303function widgets_edit_script($hook) {
     304    // Only enqueue the script in the widgets tab
     305    if('widgets.php' != $hook) return;
     306
     307    wp_enqueue_script(
     308        'cptup_widgets_edit',
     309        plugins_url('/js/cptup_widgets_edit.js', __FILE__),
     310        array('jquery')
     311    );
     312}
     313add_action('admin_enqueue_scripts', 'widgets_edit_script');
    286314
    287315
  • captain-up/trunk/readme.txt

    r751697 r789075  
    33Tags: game-mechanics,captainup,gamification,engagement,comments,widget,plugin,twitter,facebook,google
    44Requires at least: 3.0.1
    5 Tested up to: 3.6.0
     5Tested up to: 3.6.1
    66Stable tag: trunk
    77License: GPLv2 or later
     
    116116== Changelog ==
    117117
     118= 1.4.1 =
     119
     120* Support for WordPress 3.6.1
     121
     122* Better indication of a successful install.
     123
     124* Fixed issue with `cptup_widgets_edit.js`.
     125
    118126= 1.4.0 =
    119127
Note: See TracChangeset for help on using the changeset viewer.