Plugin Directory

Changeset 591186


Ignore:
Timestamp:
08/28/2012 03:11:09 AM (14 years ago)
Author:
mobius5150
Message:

Committing the first of the changes for 0.1.3 to trunk.. Not updating stable tag yet. See readme.txt for changes under 0.1.3

Location:
globalfeed/trunk/feeds
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • globalfeed/trunk/feeds/mb_facebook/mb_facebook.php

    r591175 r591186  
    229229            add_action( 'wp_ajax_mbgf_facebook_connect_redo_initial_setup', array( &$this, 'redo_initial_setup' ));
    230230            add_action( 'wp_ajax_mbgf_facebook_connect_reset_feed_defaults', array( &$this, 'reset_feed_defaults' ));
     231            add_action( 'wp_ajax_mbgf_facebook_connect_manual_feed_update', array( &$this, 'ajax_do_update' ));
     232           
    231233           
    232234            add_action( 'mbgf_feed_menu-' . $this->get_slug(), array(&$this, 'register_admin_menus'));
     
    644646        }
    645647        exit;
     648    }
     649   
     650    /**
     651     * This calls the update_feed function and is accessible from the WP Admin page
     652     *
     653     */
     654    public function ajax_do_update() {
     655        check_admin_referer( 'facebook-connect-settings_main' );
     656        wp_verify_nonce( 'facebook-connect-settings_main' );
     657       
     658        $res = $this->update_feed();
     659       
     660        if ( is_int($res) )
     661            die(json_encode(array('status' => 'success', 'update_count' => $res)));
     662        else
     663            die(json_encode(array('status' => 'failure', 'error' => $res)));
    646664    }
    647665   
     
    860878            return count( $feed_items );
    861879        } else {
    862             return false;
     880            return 0;
    863881        }
    864882    }
  • globalfeed/trunk/feeds/mb_facebook/pages/settings-main.php

    r577487 r591186  
    4242    <fieldset id="fb_reset_options" class="optgrp"><legend>Reset Feed</legend>
    4343        <table>
    44         <tr id="reset_fb_auth_cont"><td><input type="button" value="Reset Facebook Authorization" id="reset_fb_auth" /></td><td><?php $mbgfa_theme->informative('This will re-request access codes from Facebook. Handy if you&apos;ve had to reset any or if authentication is failing.'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
    45         <tr id="redo_initial_setup_cont"><td><input type="button" value="Redo Initial Setup" id="redo_initial_setup" /></td><td><?php $mbgfa_theme->informative('This will bring up the initial setup wizard, however it will not reset any settings.'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
    46         <tr id="reset_feed_defaults_cont"><td><input type="button" value="Reset Feed Defaults" id="reset_feed_defaults" /></td><td><?php $mbgfa_theme->informative('This function completely resets the plugin to defaults.'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
     44            <tr id="manual_update_cont"><td><input type="button" value="Update Feed Manually" id="manual_update" /></td><td><?php $mbgfa_theme->informative('This will tell the feed to update, typically usefull if the feed is not updating automatically. <p>P.s. If things arent working right, make sure to let us know so we can fix it!</p>'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
     45            <tr id="reset_fb_auth_cont"><td><input type="button" value="Reset Facebook Authorization" id="reset_fb_auth" /></td><td><?php $mbgfa_theme->informative('This will re-request access codes from Facebook. Handy if you&apos;ve had to reset any or if authentication is failing.'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
     46            <tr id="redo_initial_setup_cont"><td><input type="button" value="Redo Initial Setup" id="redo_initial_setup" /></td><td><?php $mbgfa_theme->informative('This will bring up the initial setup wizard, however it will not reset any settings.'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
     47            <tr id="reset_feed_defaults_cont"><td><input type="button" value="Reset Feed Defaults" id="reset_feed_defaults" /></td><td><?php $mbgfa_theme->informative('This function completely resets the plugin to defaults.'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
    4748        </table>
    4849    </fieldset>
     
    8889                    error: function(){
    8990                        showMessage( 'Error: A network error occured.', 'network_error', true, 10000 );
    90                         toggleAjaxIndicator( element_id );
     91                        hideAjaxIndicator('#redo_initial_setup_cont');
    9192                    }
    9293                });
     
    104105                    error: function(){
    105106                        showMessage( 'Error: A network error occured.', 'network_error', true, 10000 );
    106                         toggleAjaxIndicator( element_id );
     107                        hideAjaxIndicator('#reset_feed_defaults_cont');
    107108                    }
    108109                });
    109110            }); // reset_feed_defaults.click()
     111           
     112            jQuery('#manual_update').click(function(){
     113                toggleAjaxIndicator('#manual_update_cont');
     114                jQuery.ajax({
     115                    url: ajaxurl,
     116                    data: {action:'mbgf_facebook_connect_manual_feed_update',_wpnonce:jQuery('#_wpnonce').val()},
     117                    statusCode: {
     118                        200: function (response) {
     119                            json = jQuery.parseJSON(response);
     120                           
     121                            hideAjaxIndicator('#manual_update_cont');
     122                            if ( typeof json.status !== 'undefined' && json.status === 'success' )
     123                                showMessage( 'The feed updated successfully.<p>If you triggered a manual update because of an error or something does not appear to be working properly, please be sure to let us know so we can fix it!</p>', 'manual_update', false, 10000 );
     124                            else
     125                                showMessage( 'The feed did not update successfully. The update method returned ' + json.error + '<p>If you triggered a manual update because of an error or something does not appear to be working properly, please be sure to let us know so we can fix it!</p>', 'manual_update_error', true, 10000 );
     126                        }},
     127                    error: function(){
     128                        showMessage( 'Error: A network error occured.', 'network_error', true, 10000 );
     129                        hideAjaxIndicator('#manual_update_cont');
     130                    }
     131                });
     132            }); // manual_update.click()
    110133        });
    111134       
  • globalfeed/trunk/feeds/mb_twitter/mb_twitter.php

    r582062 r591186  
    187187            add_filter( 'the_author', array( &$this, 'the_author' ));
    188188            add_action( 'mbgf-fb-theme_show_user_actions', array( &$this, 'show_user_actions' ) );
     189           
    189190        }
    190191       
     
    194195            add_action( 'wp_ajax_mbgf_twitter_connect_redo_initial_setup', array( &$this, 'redo_initial_setup' ) );
    195196            add_action( 'wp_ajax_mbgf_twitter_connect_reset_feed_defaults', array( &$this, 'reset_feed_defaults' ) );
     197            add_action( 'wp_ajax_mbgf_twitter_connect_manual_feed_update', array( &$this, 'ajax_do_update' ) );
    196198            add_action( 'mbgf_unregister_feed-' . $this->get_slug(), array( &$this, 'unregister_feed') );
     199           
    197200        }
    198201    }
     
    369372    }
    370373   
    371 
    372    
     374    /**
     375     * This calls the update_feed function and is accessible from the WP Admin page
     376     *
     377     */
     378    public function ajax_do_update() {
     379        check_admin_referer( 'twitter-connect-admin' );
     380        wp_verify_nonce( 'twitter-connect-admin' );
     381       
     382        $res = $this->update_feed();
     383       
     384        if ( is_int($res) )
     385            die(json_encode(array('status' => 'success', 'update_count' => $res)));
     386        else
     387            die(json_encode(array('status' => 'failure', 'error' => $res)));
     388    }
    373389
    374390    /**
     
    380396     * @param type $args
    381397     */
    382     function update_feed( $args ) {
     398    function update_feed() {
    383399        $globalfeed = &$this->globalfeed;
    384400        $feed_options = &$this->feed_options;
     
    389405        if ( $feed_options['last_feed_update'] != 0 )
    390406            $api_url .= "&since_id={$feed_options['last_feed_update']}";
    391         $globalfeed->print_debug_info($api_url);
     407           
    392408        $request = wp_remote_get( $api_url );
    393409       
     
    399415       
    400416        if ( $updates == NULL )
    401             return false;
     417            return 0;
    402418       
    403419        $feed_items = array();
     
    450466       
    451467        if ( count($feed_items) <= 0 )
    452             return false;
     468            return 0;
    453469       
    454470        // Set the last status update received...
  • globalfeed/trunk/feeds/mb_twitter/pages/settings-main.php

    r577487 r591186  
    3535    <fieldset id="tw_reset_options" class="optgrp"><legend>Reset Feed</legend>
    3636        <table>
    37         <tr id="redo_initial_setup_cont"><td><input type="button" value="Redo Initial Setup" id="redo_initial_setup" /></td><td><?php $mbgfa_theme->informative('This will bring up the initial setup wizard and remove all stored feed items, however it will not reset any settings.'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
    38         <tr id="reset_feed_defaults_cont"><td><input type="button" value="Reset Feed Defaults" id="reset_feed_defaults" /></td><td><?php $mbgfa_theme->informative('This will completely reset the feed to its initial settings, simultaneously removing all stored feed items.'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
     37            <tr id="manual_update_cont"><td><input type="button" value="Update Feed Manually" id="manual_update" /></td><td><?php $mbgfa_theme->informative('This will tell the feed to update, typically usefull if the feed is not updating automatically. <p>P.s. If things arent working right, make sure to let us know so we can fix it!</p>'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
     38            <tr id="redo_initial_setup_cont"><td><input type="button" value="Redo Initial Setup" id="redo_initial_setup" /></td><td><?php $mbgfa_theme->informative('This will bring up the initial setup wizard and remove all stored feed items, however it will not reset any settings.'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
     39            <tr id="reset_feed_defaults_cont"><td><input type="button" value="Reset Feed Defaults" id="reset_feed_defaults" /></td><td><?php $mbgfa_theme->informative('This will completely reset the feed to its initial settings, simultaneously removing all stored feed items.'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
    3940        </table>
    4041    </fieldset>
     
    8182            }); // reset_feed_defaults.click()
    8283           
     84            jQuery('#manual_update').click(function(){
     85                toggleAjaxIndicator('#manual_update_cont');
     86                jQuery.ajax({
     87                    url: ajaxurl,
     88                    data: {action:'mbgf_twitter_connect_manual_feed_update',_wpnonce:jQuery('#_wpnonce').val()},
     89                    statusCode: {
     90                        200: function (response) {
     91                            json = jQuery.parseJSON(response);
     92                           
     93                            hideAjaxIndicator('#manual_update_cont');
     94                            if ( typeof json.status !== 'undefined' && json.status === 'success' )
     95                                showMessage( 'The feed updated successfully.<p>If you triggered a manual update because of an error or something does not appear to be working properly, please be sure to let us know so we can fix it!</p>', 'manual_update', false, 10000 );
     96                            else
     97                                showMessage( 'The feed did not update successfully. The update method returned ' + json.error + '<p>If you triggered a manual update because of an error or something does not appear to be working properly, please be sure to let us know so we can fix it!</p>', 'manual_update_error', true, 10000 );
     98                        }},
     99                    error: function(){
     100                        showMessage( 'Error: A network error occured.', 'network_error', true, 10000 );
     101                        hideAjaxIndicator('#manual_update_cont');
     102                    }
     103                });
     104            }); // manual_update.click()
    83105        });
    84106
  • globalfeed/trunk/feeds/mb_youtube/mb_youtube.php

    r582062 r591186  
    176176            add_action( 'wp_ajax_mbgf_youtube_connect_redo_initial_setup', array( &$this, 'redo_initial_setup' ) );
    177177            add_action( 'wp_ajax_mbgf_youtube_connect_reset_feed_defaults', array( &$this, 'reset_feed_defaults' ) );
     178            add_action( 'wp_ajax_mbgf_youtube_connect_manual_feed_update', array( &$this, 'ajax_do_update' ) );
    178179            add_action( 'mbgf_unregister_feed-' . $this->get_slug(), array( &$this, 'unregister_feed') );
    179180        }
     
    360361       
    361362        return $this->globalfeed->register_feed($info, $feed_options);
     363    }
     364   
     365    /**
     366     * This calls the update_feed function and is accessible from the WP Admin page
     367     *
     368     */
     369    public function ajax_do_update() {
     370        check_admin_referer( 'youtube-connect-admin' );
     371        wp_verify_nonce( 'youtube-connect-admin' );
     372       
     373        $res = $this->update_feed();
     374       
     375        if ( is_int($res) )
     376            die(json_encode(array('status' => 'success', 'update_count' => $res)));
     377        else
     378            die(json_encode(array('status' => 'failure', 'error' => $res)));
    362379    }
    363380
     
    447464       
    448465        if ( count($feed_items) <= 0 )
    449             return false;
     466            return 0;
    450467       
    451468        // Set the last status update received...
  • globalfeed/trunk/feeds/mb_youtube/pages/settings-main.php

    r577487 r591186  
    3636    <fieldset id="yt_reset_options" class="optgrp"><legend>Reset Feed</legend>
    3737        <table>
     38            <tr id="manual_update_cont"><td><input type="button" value="Update Feed Manually" id="manual_update" /></td><td><?php $mbgfa_theme->informative('This will tell the feed to update, typically usefull if the feed is not updating automatically. <p>P.s. If things arent working right, make sure to let us know so we can fix it!</p>'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
    3839            <tr id="redo_initial_setup_cont"><td><input type="button" value="Redo Initial Setup" id="redo_initial_setup" /></td><td><?php $mbgfa_theme->informative('This will bring up the initial setup wizard and remove all saved feed items, however it will not reset any settings.'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
    3940            <tr id="reset_feed_defaults_cont"><td><input type="button" value="Reset Feed Defaults" id="reset_feed_defaults" /></td><td><?php $mbgfa_theme->informative('This will completely reset the feed to its default settings, removing all stored feed items.'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
     
    7980                });
    8081            }); // redo_initial_setup.click()
     82           
     83            jQuery('#manual_update').click(function(){
     84                toggleAjaxIndicator('#manual_update_cont');
     85                jQuery.ajax({
     86                    url: ajaxurl,
     87                    data: {action:'mbgf_youtube_connect_manual_feed_update',_wpnonce:jQuery('#_wpnonce').val()},
     88                    statusCode: {
     89                        200: function (response) {
     90                            json = jQuery.parseJSON(response);
     91                           
     92                            hideAjaxIndicator('#manual_update_cont');
     93                            if ( typeof json.status !== 'undefined' && json.status === 'success' )
     94                                showMessage( 'The feed updated successfully.<p>If you triggered a manual update because of an error or something does not appear to be working properly, please be sure to let us know so we can fix it!</p>', 'manual_update', false, 10000 );
     95                            else
     96                                showMessage( 'The feed did not update successfully. The update method returned ' + json.error + '<p>If you triggered a manual update because of an error or something does not appear to be working properly, please be sure to let us know so we can fix it!</p>', 'manual_update_error', true, 10000 );
     97                        }},
     98                    error: function(){
     99                        showMessage( 'Error: A network error occured.', 'network_error', true, 10000 );
     100                        hideAjaxIndicator('#manual_update_cont');
     101                    }
     102                });
     103            }); // manual_update.click()
    81104        });
    82105
  • globalfeed/trunk/feeds/mbgf_rss/mbgf_rss.php

    r582062 r591186  
    169169        if (is_admin()) {
    170170            add_action( 'wp_ajax_mbgf_rss_add_rss_feed', array( &$this, 'add_rss_feed' ) );
     171            add_action( 'wp_ajax_mbgf_rss_manual_feed_update', array( &$this, 'ajax_do_update' ) );
    171172            add_action( 'wp_ajax_mbgf_rss_remove_rss_feed', array( &$this, 'remove_rss_feed' ) );
    172173            add_action( 'wp_ajax_mbgf_rss_reset_feed_defaults', array( &$this, 'reset_feed_defaults' ) );
     
    446447    }
    447448
     449    /**
     450     * This calls the update_feed function and is accessible from the WP Admin page
     451     *
     452     */
     453    public function ajax_do_update() {
     454        check_admin_referer( 'mb-rss-admin' );
     455        wp_verify_nonce( 'mb-rss-admin' );
     456       
     457        $res = $this->update_feed();
     458       
     459        if ( is_int($res) )
     460            die(json_encode(array('status' => 'success', 'update_count' => $res)));
     461        else
     462            die(json_encode(array('status' => 'failure', 'error' => $res)));
     463    }
     464   
    448465    /**
    449466     * This function manually updates the feed and is usually called by a scheduler
  • globalfeed/trunk/feeds/mbgf_rss/pages/settings-main.php

    r582062 r591186  
    4343    <fieldset id="rss_reset_options" class="optgrp"><legend>Reset Feed</legend>
    4444        <table>
     45            <tr id="manual_update_cont"><td><input type="button" value="Update Feed Manually" id="manual_update" /></td><td><?php $mbgfa_theme->informative('This will tell the feed to update, typically usefull if the feed is not updating automatically. <p>P.s. If things arent working right, make sure to let us know so we can fix it!</p>'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
    4546            <tr id="reset_feed_defaults_cont"><td><input type="button" value="Reset Feed Defaults" id="reset_feed_defaults" /></td><td><?php $mbgfa_theme->informative('This function completely resets the plugin to defaults.'); ?><?php $mbgfa_theme->ajaxIndicator(true); ?></td></tr>
    4647        </table>
     
    176177                });
    177178            }); // reset_feed_defaults.click()
     179           
     180            jQuery('#manual_update').click(function(){
     181                toggleAjaxIndicator('#manual_update_cont');
     182                jQuery.ajax({
     183                    url: ajaxurl,
     184                    data: {action:'mbgf_rss_manual_feed_update',_wpnonce:jQuery('#_wpnonce').val()},
     185                    statusCode: {
     186                        200: function (response) {
     187                            json = jQuery.parseJSON(response);
     188                           
     189                            hideAjaxIndicator('#manual_update_cont');
     190                            if ( typeof json.status !== 'undefined' && json.status === 'success' )
     191                                showMessage( 'The feed updated successfully.<p>If you triggered a manual update because of an error or something does not appear to be working properly, please be sure to let us know so we can fix it!</p>', 'manual_update', false, 10000 );
     192                            else
     193                                showMessage( 'The feed did not update successfully. The update method returned ' + json.error + '<p>If you triggered a manual update because of an error or something does not appear to be working properly, please be sure to let us know so we can fix it!</p>', 'manual_update_error', true, 10000 );
     194                        }},
     195                    error: function(){
     196                        showMessage( 'Error: A network error occured.', 'network_error', true, 10000 );
     197                        hideAjaxIndicator('#manual_update_cont');
     198                    }
     199                });
     200            }); // manual_update.click()
    178201        });
    179202
Note: See TracChangeset for help on using the changeset viewer.