Plugin Directory

Changeset 714458


Ignore:
Timestamp:
05/17/2013 04:12:53 PM (13 years ago)
Author:
webternals
Message:

AdMangler v0.1.4

Location:
admangler
Files:
3 edited
11 copied

Legend:

Unmodified
Added
Removed
  • admangler/tags/0.1.4/adMangler.class.php

    r714099 r714458  
    2323            $this->positionsTable = $wpdb->prefix."AdMangler_positions";
    2424
    25             add_action( 'init', function () {
     25           
     26            function enqueue_scripts() {
    2627                wp_enqueue_script("jquery");
    2728                //wp_enqueue_script('jquery.validate', '/' . PLUGINDIR . '/admangler/js/jquery.validate.min.js');
    28             });
     29            }
     30            add_action( 'init', 'enqueue_scripts');
    2931
    3032            // Generate the Admin Menu
     
    3739
    3840                // init process for registering our button
    39                 add_action('init', function () {
     41                function register_button() {
    4042                   
    4143                    //Abort early if the user will never see TinyMCE
     
    4547                    //Add a callback to regiser our tinymce plugin
    4648                    //This callback registers our plug-in
    47                     add_filter("mce_external_plugins", function ($plugin_array) {
     49                    function filter_plugin($plugin_array) {
    4850                        global $PLUGINDIR;
    4951                        $plugin_array['wpse72394_button'] =  '/' . PLUGINDIR . '/admangler/js/shortcode.js';
    5052                        return $plugin_array;
    51                     });
     53                    }
     54                    add_filter("mce_external_plugins", "filter_plugin");
    5255
    5356                    // Add a callback to add our button to the TinyMCE toolbar
    5457                    //This callback adds our button to the toolbar
    55                     add_filter('mce_buttons', function ($buttons) {
     58                    function filter_button($buttons) {
    5659                                //Add the button ID to the $button array
    5760                        $buttons[] = "wpse72394_button";
    5861                        return $buttons;
    59                     });
    60                 });
     62                    }
     63                    add_filter('mce_buttons', 'filter_button');
     64                }
     65                add_action('init', 'register_button');
    6166            }
    6267
     
    542547        function send_statistics($action)
    543548        {
    544            
    545                 try {
    546                 $api = new WebAPI('publicapi', 'publicapi');
    547  
    548                 $phone = new SimpleXMLElement('<request></request>');
    549                 $phone->addChild('action', 'stats');
    550                 $phone->addChild('application', 'AdMangler');
    551                 $phone->addChild('version', $this->codeVersion);
    552                 $phone->addChild('database', $this->dbVersion);
    553                 $phone->addChild('status', $action);
    554                 $phone->addChild('domain', urlencode($_SERVER['SERVER_NAME']));
    555                 $api->add_request($phone);
    556                 $api->request();
    557                 } catch (Exception $e) { /* Fail quitely */ }
     549            try {
     550            $api = new WebAPI('publicapi', 'publicapi');
     551
     552            $phone = new SimpleXMLElement('<request></request>');
     553            $phone->addChild('action', 'stats');
     554            $phone->addChild('application', 'AdMangler');
     555            $phone->addChild('version', $this->codeVersion);
     556            $phone->addChild('database', $this->dbVersion);
     557            $phone->addChild('status', $action);
     558            $phone->addChild('domain', urlencode($_SERVER['SERVER_NAME']));
     559            $api->add_request($phone);
     560            $api->request();
     561            } catch (Exception $e) { /* Fail quitely */ }
    558562        }
    559563       
  • admangler/tags/0.1.4/adMangler.php

    r714097 r714458  
    44        Plugin URI: http://www.webternals.com/projects/admangler/
    55        Description: AdMangler (Beta) Display, sell, and manage ad space on your Wordpress powered site.
    6         Version: 0.1.2
     6        Version: 0.1.4
    77        Author: Webternals, LLC - Allen Sanford
    88        Author URI: http://www.webternals.com/
     
    1616
    1717
    18     $codeVersion = '0.1.2';
     18    $codeVersion = '0.1.4';
    1919    $dbVersion = '0.0.9';
    2020
  • admangler/tags/0.1.4/readme.txt

    r714099 r714458  
    55Requires at least: 2.8.2
    66Tested up to: 3.5.1
    7 Stable Tag: 0.1.3
     7Stable Tag: 0.1.4
    88
    99AdMangler (Beta) Display, sell, and manage ad space on your Wordpress powered site.
     
    6161
    6262== Changelog ==
     63
     64= 0.1.4 =
     65* Fixed anonymous function use. Anonymous function are only full supported in PHP 5.3 and above. Shame on me!
     66
     67= 0.1.3 =
     68* Version mismatch
    6369
    6470= 0.1.2 =
  • admangler/trunk/adMangler.class.php

    r714099 r714458  
    2323            $this->positionsTable = $wpdb->prefix."AdMangler_positions";
    2424
    25             add_action( 'init', function () {
     25           
     26            function enqueue_scripts() {
    2627                wp_enqueue_script("jquery");
    2728                //wp_enqueue_script('jquery.validate', '/' . PLUGINDIR . '/admangler/js/jquery.validate.min.js');
    28             });
     29            }
     30            add_action( 'init', 'enqueue_scripts');
    2931
    3032            // Generate the Admin Menu
     
    3739
    3840                // init process for registering our button
    39                 add_action('init', function () {
     41                function register_button() {
    4042                   
    4143                    //Abort early if the user will never see TinyMCE
     
    4547                    //Add a callback to regiser our tinymce plugin
    4648                    //This callback registers our plug-in
    47                     add_filter("mce_external_plugins", function ($plugin_array) {
     49                    function filter_plugin($plugin_array) {
    4850                        global $PLUGINDIR;
    4951                        $plugin_array['wpse72394_button'] =  '/' . PLUGINDIR . '/admangler/js/shortcode.js';
    5052                        return $plugin_array;
    51                     });
     53                    }
     54                    add_filter("mce_external_plugins", "filter_plugin");
    5255
    5356                    // Add a callback to add our button to the TinyMCE toolbar
    5457                    //This callback adds our button to the toolbar
    55                     add_filter('mce_buttons', function ($buttons) {
     58                    function filter_button($buttons) {
    5659                                //Add the button ID to the $button array
    5760                        $buttons[] = "wpse72394_button";
    5861                        return $buttons;
    59                     });
    60                 });
     62                    }
     63                    add_filter('mce_buttons', 'filter_button');
     64                }
     65                add_action('init', 'register_button');
    6166            }
    6267
     
    542547        function send_statistics($action)
    543548        {
    544            
    545                 try {
    546                 $api = new WebAPI('publicapi', 'publicapi');
    547  
    548                 $phone = new SimpleXMLElement('<request></request>');
    549                 $phone->addChild('action', 'stats');
    550                 $phone->addChild('application', 'AdMangler');
    551                 $phone->addChild('version', $this->codeVersion);
    552                 $phone->addChild('database', $this->dbVersion);
    553                 $phone->addChild('status', $action);
    554                 $phone->addChild('domain', urlencode($_SERVER['SERVER_NAME']));
    555                 $api->add_request($phone);
    556                 $api->request();
    557                 } catch (Exception $e) { /* Fail quitely */ }
     549            try {
     550            $api = new WebAPI('publicapi', 'publicapi');
     551
     552            $phone = new SimpleXMLElement('<request></request>');
     553            $phone->addChild('action', 'stats');
     554            $phone->addChild('application', 'AdMangler');
     555            $phone->addChild('version', $this->codeVersion);
     556            $phone->addChild('database', $this->dbVersion);
     557            $phone->addChild('status', $action);
     558            $phone->addChild('domain', urlencode($_SERVER['SERVER_NAME']));
     559            $api->add_request($phone);
     560            $api->request();
     561            } catch (Exception $e) { /* Fail quitely */ }
    558562        }
    559563       
  • admangler/trunk/adMangler.php

    r714097 r714458  
    44        Plugin URI: http://www.webternals.com/projects/admangler/
    55        Description: AdMangler (Beta) Display, sell, and manage ad space on your Wordpress powered site.
    6         Version: 0.1.2
     6        Version: 0.1.4
    77        Author: Webternals, LLC - Allen Sanford
    88        Author URI: http://www.webternals.com/
     
    1616
    1717
    18     $codeVersion = '0.1.2';
     18    $codeVersion = '0.1.4';
    1919    $dbVersion = '0.0.9';
    2020
  • admangler/trunk/readme.txt

    r714099 r714458  
    55Requires at least: 2.8.2
    66Tested up to: 3.5.1
    7 Stable Tag: 0.1.3
     7Stable Tag: 0.1.4
    88
    99AdMangler (Beta) Display, sell, and manage ad space on your Wordpress powered site.
     
    6161
    6262== Changelog ==
     63
     64= 0.1.4 =
     65* Fixed anonymous function use. Anonymous function are only full supported in PHP 5.3 and above. Shame on me!
     66
     67= 0.1.3 =
     68* Version mismatch
    6369
    6470= 0.1.2 =
Note: See TracChangeset for help on using the changeset viewer.