Changeset 578780
- Timestamp:
- 07/29/2012 05:36:13 PM (13 years ago)
- Location:
- globalfeed/trunk
- Files:
-
- 6 edited
-
admin/pages/admin_settings.php (modified) (1 diff)
-
feeds/mb_facebook/mb_facebook.php (modified) (3 diffs)
-
feeds/mb_facebook/pages/js/mb_facebook.js (modified) (1 diff)
-
feeds/mb_facebook/pages/setup.php (modified) (4 diffs)
-
feeds/mbgf_rss/pages/settings-main.php (modified) (4 diffs)
-
mb_globalfeed.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
globalfeed/trunk/admin/pages/admin_settings.php
r577487 r578780 22 22 // An update has been submitted. Save the settings. 23 23 $update = true; 24 $mb_globalfeed->print_debug_info($_POST);25 24 26 25 // Plugin update interval 27 if (isset($_POST['settings-plugin_update_interval']) && in_array($_POST['settings-plugin_update_interval'], $settings['plugin_update_intervals'] ) ) 26 if (isset($_POST['settings-plugin_update_interval']) && in_array($_POST['settings-plugin_update_interval'], $settings['plugin_update_intervals'] ) ) { 28 27 $settings['plugin_update_interval'] = $_POST['settings-plugin_update_interval']; 28 $mb_globalfeed->change_default_update_interval(); 29 } 29 30 30 31 } -
globalfeed/trunk/feeds/mb_facebook/mb_facebook.php
r577487 r578780 421 421 $result = $this->update_feed(null); 422 422 423 if ( $result === false ) 423 if ( $result === false ) { 424 $this->feed_options['object_to_subscribe'] = $this->feed_defaults['object_to_subscribe']; 425 $this->feed_options['subscribe_object_type'] = $this->feed_defaults['subscribe_object_type']; 426 $this->feed_options['initial_setup_done'] = false; 427 $this->feed_options['show_welcome_message'] = false; 428 424 429 die(json_encode('Error: A network error occured while requesting data from facebook.')); 430 } 425 431 426 432 // Update and return the feed items retrieved. … … 822 828 $feed_items[] = $post_args; 823 829 } 824 830 825 831 // Set this as the last time the feed was updated 826 832 if (count($feed_items)) { … … 829 835 // Save all of the feed items. 830 836 $globalfeed->save_feed_items( $this->feed_slug, $feed_items ); 837 $this->register_feed(true); 831 838 return count( $feed_items ); 832 } 833 $this->register_feed(true); 839 } else { 840 return false; 841 } 834 842 } 835 843 -
globalfeed/trunk/feeds/mb_facebook/pages/js/mb_facebook.js
r577487 r578780 44 44 function format_fb_obj( fb_obj ) { 45 45 output_div = '<div class="fb_obj">'; 46 output_div += '<img src="' + fb_obj.metadata.connections.picture + '" />'; 46 console.log(fb_obj); 47 output_div += '<img src="' + (typeof fb_obj.metadata.connections.picture !== 'undefined' ? fb_obj.metadata.connections.picture : fb_obj.picture) + '" />'; 47 48 if (fb_obj.username == undefined) 48 49 output_div += '<div class="obj_info"><strong>' + fb_obj.name + '</strong> - ' + fb_obj.id + '</div>'; -
globalfeed/trunk/feeds/mb_facebook/pages/setup.php
r577487 r578780 115 115 setAuthWindowChecker( '#step-1', function(){jQuery('#authorize_button').attr("disabled", false)}, jQuery('#activation_redirection_url').val() ); 116 116 }); 117 118 119 117 }); 120 118 jQuery('#authorize_button').attr("disabled", false); … … 128 126 showMessage('Please try again.', 'tryagain', false, 10000); 129 127 jQuery('#validate_button').attr("disabled", false); 128 hideAjaxIndicator( '#step-2' ); 130 129 }); 131 130 jQuery('#step-2>table').show().fadeIn('fast'); … … 151 150 } else { 152 151 // Setup failed somewhere along the way. 153 showMessage(' Error: An error was encountered along the way while connecting with Facebook.\n\n' + response, 'setupError', true);152 showMessage('<p>Error: An error was encountered along the way while connecting with Facebook.</p><p>Please ensure that you have enterred the correct information and you have permission to access this object.', 'setupError', true); 154 153 toggleAjaxIndicator('#fb_obj_confirm'); 155 jQuery( this).removeAttr('disabled');154 jQuery('#confirm_id_yes').removeAttr('disabled'); 156 155 } 157 156 }); … … 187 186 jQuery(this).hide(); 188 187 jQuery('#confirm_fb_obj_id').show() 189 toggleAjaxIndicator( '#step-2' );188 hideAjaxIndicator( '#step-2' ); 190 189 jQuery('#fb_obj_confirm').removeClass('hidden-step').show('fast'); 191 190 }); -
globalfeed/trunk/feeds/mbgf_rss/pages/settings-main.php
r577487 r578780 56 56 57 57 // Apply the checking pattern... 58 urlcheck = new RegExp(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/ );58 urlcheck = new RegExp(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i); 59 59 if ( !urlcheck.exec(jQuery('.add_feed input').val()) ){ 60 60 showMessage('The url entered does not appear correct.', 'badUrl', false, 10000); 61 61 jQuery('.add_feed input').removeAttr('disabled'); 62 hideAjaxIndicator('.add_feed'); 62 63 return; 63 64 } … … 73 74 } catch(err) { 74 75 showMessage('Error: An error was encountered saving the feed. ' + iresponse, 'saveError', true); 76 hideAjaxIndicator('.add_feed'); 75 77 return; 76 78 } … … 78 80 if ( typeof(response) == "undefined" || response == null || response.title == null ){ 79 81 showMessage('Error: An error was encountered saving the feed. ' + response, 'saveError', true); 82 hideAjaxIndicator('.add_feed'); 80 83 return; 81 84 } … … 85 88 86 89 setupRemoveHandler(jQuery('#feed_list').last().find('a')); 87 toggleAjaxIndicator('.add_feed');90 hideAjaxIndicator('.add_feed'); 88 91 jQuery('.add_feed input').val(''); 89 92 }); -
globalfeed/trunk/mb_globalfeed.php
r577487 r578780 394 394 395 395 /** 396 * Called when the default feed update interval is changed. Re-schedules events. 397 * 398 */ 399 function change_default_update_interval() { 400 foreach ($this->registered_feeds as $slug => $feed) { 401 if ( $feed->request_frequency !== 'mbgf_default' ) 402 continue; 403 404 // Unschedule and re-schedule feed update 405 $this->unschedule_event( $feed->class_name, 'update_feed' ); 406 $this->schedule_event( $feed->class_name, 'update_feed', $this->settings['plugin_update_interval'] ); 407 } 408 } 409 410 /** 396 411 * Gets the post formats supported by the current WordPress theme. 397 412 *
Note: See TracChangeset
for help on using the changeset viewer.