Changeset 582059
- Timestamp:
- 08/05/2012 06:48:24 PM (14 years ago)
- Location:
- globalfeed/tags/0.1.2
- Files:
-
- 16 edited
- 1 copied
-
. (copied) (copied from globalfeed/trunk) (1 prop)
-
admin/mb_globalfeed_admin.php (modified) (2 diffs)
-
admin/mbgfa_theme.php (modified) (2 diffs)
-
admin/pages/admin_presentation.php (modified) (1 diff)
-
admin/pages/js/client_tools.js (modified) (1 diff)
-
event_scheduler_interfaces/wp-schedule-interface.php (modified) (1 diff)
-
feeds/mb_facebook/mb_facebook.php (modified) (10 diffs)
-
feeds/mb_facebook/pages/setup.php (modified) (3 diffs)
-
feeds/mb_twitter/mb_twitter.php (modified) (5 diffs)
-
feeds/mb_twitter/pages/setup.php (modified) (3 diffs)
-
feeds/mb_youtube/mb_youtube.php (modified) (3 diffs)
-
feeds/mb_youtube/pages/setup.php (modified) (3 diffs)
-
feeds/mbgf_rss/mbgf_rss.php (modified) (7 diffs)
-
feeds/mbgf_rss/pages/js/mbgf_rss.js (modified) (1 diff)
-
feeds/mbgf_rss/pages/settings-main.php (modified) (5 diffs)
-
mb_globalfeed.php (modified) (18 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
globalfeed/tags/0.1.2
-
Property
svn:ignore
set to
log.txt
-
Property
svn:ignore
set to
-
globalfeed/tags/0.1.2/admin/mb_globalfeed_admin.php
r577487 r582059 123 123 elseif ( isset( $_POST['mbgf_admin_page'] ) ) 124 124 $current_page = $_POST['mbgf_admin_page']; 125 126 if ( !isset($_REQUEST['mbgf_page_type']) ) 127 $_REQUEST['mbgf_page_type'] = ''; 125 128 126 129 switch ( $_REQUEST['mbgf_page_type'] ){ … … 219 222 else 220 223 require_once dirname(__FILE__) . '/pages/main.php'; 221 show_mbgf_admin_page( &$this->_globalfeed_settings );224 show_mbgf_admin_page( $this->_globalfeed_settings ); 222 225 $mb_globalfeed->save_settings(); 223 226 break; -
globalfeed/tags/0.1.2/admin/mbgfa_theme.php
r563348 r582059 116 116 * and wizards that are consistant with the general look of GlobalFeed. 117 117 * 118 * Automatically ensures that jQuery isloaded.118 * Automatically ensures that jQuery and Fancybox are loaded. 119 119 * 120 120 * @global type $mb_globalfeed … … 123 123 global $mb_globalfeed; 124 124 wp_enqueue_script('mb_globalfeed_client_tools', plugins_url( 'admin/pages/js/client_tools.js', $mb_globalfeed->plugin_location() ), array('jquery')); 125 wp_enqueue_script('fancybox', plugins_url( 'admin/pages/js/jquery.fancybox/jquery.fancybox.js', $mb_globalfeed->plugin_location() ), array('jquery', 'mb_globalfeed_client_tools')); 126 127 wp_enqueue_style('fancybox', plugins_url( 'admin/pages/js/jquery.fancybox/jquery.fancybox.css', $mb_globalfeed->plugin_location() )); 125 128 } 126 129 -
globalfeed/tags/0.1.2/admin/pages/admin_presentation.php
r577487 r582059 51 51 <li>container_class: The class to apply to the containing div.</li> 52 52 <li>include_blog_posts: Whether posts from the WordPress blog should be displayed.</li> 53 <li>use_globalfeed_theme: The GlobalFeed theme to use. Currently only option is 'wide' or 'default'.</li>53 <li>use_globalfeed_theme: The GlobalFeed theme to use. Currently only option is 'wide', 'fb' or 'default'.</li> 54 54 </ul> 55 55 -
globalfeed/tags/0.1.2/admin/pages/js/client_tools.js
r563348 r582059 8 8 /* ----------------------------------------------------------- Ajax Indicator */ 9 9 function toggleAjaxIndicator( obj ) { 10 jQuery( obj ).find('.ajax-loading-icon').toggle(); 10 if ( typeof obj === 'object' ) 11 obj.find('.ajax-loading-icon').toggle(); 12 else 13 jQuery( obj ).find('.ajax-loading-icon').toggle(); 11 14 } 12 15 13 16 function hideAjaxIndicator( obj ) { 14 jQuery( obj ).find('.ajax-loading-icon').hide(); 17 if ( typeof obj === 'object' ) 18 obj.find('.ajax-loading-icon').hide(); 19 else 20 jQuery( obj ).find('.ajax-loading-icon').hide(); 15 21 } 16 22 -
globalfeed/tags/0.1.2/event_scheduler_interfaces/wp-schedule-interface.php
r563348 r582059 92 92 $mb_globalfeed->print_debug_info($action); 93 93 94 if ( !class_exists($caller) || method_exists($caller, $action)) 95 return; 96 94 97 $mb_globalfeed->print_debug_info(call_user_func( array( &$$caller, $action ), $args )); 95 98 } -
globalfeed/tags/0.1.2/feeds/mb_facebook/mb_facebook.php
r578780 r582059 240 240 241 241 $actions = get_post_meta(get_the_ID(), 'actions', true); 242 if ( empty($actions) ) 243 return; 242 244 243 245 $echo = array(); … … 367 369 wp_verify_nonce( 'facebook-connect-settings_main' ); 368 370 369 if (!empty($this->feed_options['oauth_user_token']) || $_SERVER['mbgf_app_is_authed']|| get_transient('mbgf_app_is_authed')) {371 if (!empty($this->feed_options['oauth_user_token']) || (isset($_SERVER['mbgf_app_is_authed']) && $_SERVER['mbgf_app_is_authed']) || get_transient('mbgf_app_is_authed')) { 370 372 unset( $_SERVER['mbgf_app_is_authed'] ); 371 373 die( json_encode(true) ); … … 374 376 while ( $c <= 2 ) { 375 377 sleep(2); 376 if ( $_SERVER['mbgf_app_is_authed']|| get_transient('mbgf_app_is_authed') ) {378 if ( (isset($_SERVER['mbgf_app_is_authed']) && $_SERVER['mbgf_app_is_authed']) || get_transient('mbgf_app_is_authed') ) { 377 379 unset( $_SERVER['mbgf_app_is_authed'] ); 378 380 die(json_encode(true)); … … 440 442 */ 441 443 public function add_listener_vars($public_query_vars) { 442 $public_query_vars[] = $this->facebook_secret;444 //$public_query_vars[] = $this->facebook_secret; 443 445 return $public_query_vars; 444 446 } … … 683 685 foreach ($updates->data as $update) { 684 686 685 $update->id = split('_', $update->id);687 $update->id = explode('_', $update->id); 686 688 $page_id = $update->id[0]; 687 689 $update->id = $update->id[1]; … … 822 824 $post_args['post_content'] = $globalfeed->post_content(isset($update->message) ? $update->message : $update->story, $content_args); 823 825 824 $post_args['meta']['author'] = array( 'value' => $update->from, 'unique' => false ); 825 $post_args['meta']['privacy'] = array( 'value' => $update->privacy, 'unique' => false ); 826 $post_args['meta']['actions'] = array( 'value' => $update->actions, 'unique' => false ); 826 if ( isset($update->from) ) 827 $post_args['meta']['author'] = array( 'value' => $update->from, 'unique' => false ); 828 if ( isset($update->privacy) ) 829 $post_args['meta']['privacy'] = array( 'value' => $update->privacy, 'unique' => false ); 830 if ( isset($update->actions) ) 831 $post_args['meta']['actions'] = array( 'value' => $update->actions, 'unique' => false ); 827 832 828 833 $feed_items[] = $post_args; … … 983 988 984 989 $feed_options['oauth_user_token'] = $params['access_token']; 985 $feed_options['ouath_user_expires'] = $params['expires']; 990 991 if ( isset($params['expires']) ) 992 $feed_options['ouath_user_expires'] = $params['expires']; 986 993 987 994 // Get app access credentials … … 995 1002 996 1003 $feed_options['oauth_app_token'] = $params['access_token']; 997 $feed_options['ouath_app_expires'] = $params['expires']; 1004 1005 if ( isset($params['expires']) ) 1006 $feed_options['ouath_app_expires'] = $params['expires']; 998 1007 999 1008 // $globalfeed->print_debug_info($feed_options['oauth_user_token'] . $feed_options['oauth_app_token'], 'mb_facebook'); … … 1098 1107 //$this->feed_options['initial_setup_done'] == true; 1099 1108 } else { 1100 if (array_key_exists($_REQUEST['mbgf_admin_page'], $this->admin_pages)) 1109 // The specified page must be in our array of pages -- this stops people from accessing other files on the FS 1110 if ( isset($_REQUEST['mbgf_admin_page']) && array_key_exists($_REQUEST['mbgf_admin_page'], $this->admin_pages)) 1101 1111 require_once( "pages/{$_REQUEST['mbgf_admin_page']}.php" ); 1102 1112 else … … 1105 1115 1106 1116 // This function is created when the page is loaded. It is passed the feed settings. It returns true if changes were made to the settings. 1107 $changed = show_mb_facebook_page( &$this->feed_options );1117 $changed = show_mb_facebook_page( $this->feed_options ); 1108 1118 1109 1119 if ( $changed == true ) -
globalfeed/tags/0.1.2/feeds/mb_facebook/pages/setup.php
r578780 r582059 18 18 ?> 19 19 <h2><?php _e('Facebook Connect Initial Setup',$mb_globalfeed_facebook_connect->get_slug()); ?></h2> 20 <form >20 <form id="setup-form"> 21 21 <input type="hidden" id="activation_url" value="<?php echo $mb_globalfeed_facebook_connect->get_client_auth_redirect_url(); ?>" /> 22 22 <input type="hidden" id="_wpnonce" value="<?php echo wp_create_nonce( 'facebook-connect-settings_main' ); ?>" /> … … 78 78 }); 79 79 80 function authorize(){ 81 // Begin authorization 82 var app_id = jQuery('#app_id').val(); 83 var app_secret = jQuery('#app_secret').val(); 84 var app_id_match = new RegExp(/^[0-9]+$/); 85 var app_secret_match = new RegExp(/^[a-zA-Z0-9]+$/); 86 if (app_id_match.exec( app_id ) == null){ 87 showMessage('You must provide a valid app_id (must be only numbers)', 'app_id', true); 88 setMsgRemove( 'app_id', 'app_id' ); 89 return false; 90 } else if (app_secret_match.exec( app_secret ) == null){ 91 showMessage('You must provide a valid app_secret (only letters and numbers)', 'app_secret', true); 92 setMsgRemove( 'app_secret', 'app_secret' ); 93 return false; 94 } else { 95 hideMessage( 'app_id' ); 96 hideMessage( 'app_secret' ); 97 } 98 99 // Disable the button and begin auth 100 toggleAjaxIndicator( '#step-1' ); 101 hideAllMessages(); 102 jQuery('#authorize_button').attr("disabled", true); 103 104 // In order to get passed popup blockers, we open the AuthWindow now. In the future, this should pop up a temporary loading page, however we aren't that fancy yet. 105 authWindow = window.open('',"fb_activation_window","location=0,status=0,scrollbars=0, width=750,height=500"); 106 107 // Post the app_id and secret to the server for use in the auth process. 108 jQuery.post(ajaxurl, {action:'mbgf_facebook_connect_set_app_info',app_id:app_id,app_secret:app_secret,_wpnonce:jQuery('#_wpnonce').val()}, function(response){ 109 //authWindow = window.open(jQuery('#activation_url').val() + '&client_id=' + jQuery('#app_id').val(), ); 110 authWindow.location.href = jQuery('#activation_url').val() + '&client_id=' + jQuery('#app_id').val(); 111 setAuthWindowChecker( '#step-1', function(){jQuery('#authorize_button').attr("disabled", false)}, jQuery('#activation_redirection_url').val() ); 112 }); 113 } 114 115 function validate() { 116 jQuery('#validate_button').attr("disabled", true); 117 // Check input 118 var fb_object_id_match = new RegExp(/^[a-zA-Z0-9]*$/); 119 var fb_object_id = jQuery('#fb_object_id').val(); 120 if (fb_object_id_match.exec( fb_object_id ) == null){ 121 showMessage('You must provide a valid object id (must be only numbers)', 'fb_object_id', true); 122 setMsgRemove( 'fb_object_id', 'fb_object_id' ); 123 jQuery('#validate_button').attr("disabled", false); 124 return false; 125 } else { 126 hideMessage( 'fb_object_id' ); 127 } 128 129 jQuery('#fb_obj_confirm #confirm_fb_obj_id').children().fadeOut('fast', function () {jQuery(this).empty();}); 130 toggleAjaxIndicator( '#step-2' ); 131 hideAllMessages(); 132 133 req = get_fb_object( fb_object_id, '#confirm_fb_obj_id' ); 134 req.complete(function(response){ 135 console.log(response); 136 if ( response.status != 200 ) { 137 toggleAjaxIndicator( '#step-2' ); 138 jQuery('#validate_button').attr("disabled", false); 139 return false; 140 } 141 142 jQuery('#step-2>table').fadeOut('fast', function () { 143 jQuery(this).hide(); 144 jQuery('#confirm_fb_obj_id').show() 145 hideAjaxIndicator( '#step-2' ); 146 jQuery('#fb_obj_confirm').removeClass('hidden-step').show('fast'); 147 }); 148 }); 149 } 150 80 151 function setupStep( step ) { 81 152 switch( step ){ 82 153 case 1: 83 154 // Setup the authorization button for step 1 84 jQuery('#authorize_button').attr("disabled", false).click(function(){ 85 // Begin authorization 86 var app_id = jQuery('#app_id').val(); 87 var app_secret = jQuery('#app_secret').val(); 88 var app_id_match = new RegExp(/^[0-9]+$/); 89 var app_secret_match = new RegExp(/^[a-zA-Z0-9]+$/); 90 if (app_id_match.exec( app_id ) == null){ 91 showMessage('You must provide a valid app_id (must be only numbers)', 'app_id', true); 92 setMsgRemove( 'app_id', 'app_id' ); 93 return false; 94 } else if (app_secret_match.exec( app_secret ) == null){ 95 showMessage('You must provide a valid app_secret (only letters and numbers)', 'app_secret', true); 96 setMsgRemove( 'app_secret', 'app_secret' ); 97 return false; 98 } else { 99 hideMessage( 'app_id' ); 100 hideMessage( 'app_secret' ); 101 } 102 103 // Disable the button and begin auth 104 toggleAjaxIndicator( '#step-1' ); 105 hideAllMessages(); 106 jQuery('#authorize_button').attr("disabled", true); 107 108 // In order to get passed popup blockers, we open the AuthWindow now. In the future, this should pop up a temporary loading page, however we aren't that fancy yet. 109 authWindow = window.open('',"fb_activation_window","location=0,status=0,scrollbars=0, width=750,height=500"); 110 111 // Post the app_id and secret to the server for use in the auth process. 112 jQuery.post(ajaxurl, {action:'mbgf_facebook_connect_set_app_info',app_id:app_id,app_secret:app_secret,_wpnonce:jQuery('#_wpnonce').val()}, function(response){ 113 //authWindow = window.open(jQuery('#activation_url').val() + '&client_id=' + jQuery('#app_id').val(), ); 114 authWindow.location.href = jQuery('#activation_url').val() + '&client_id=' + jQuery('#app_id').val(); 115 setAuthWindowChecker( '#step-1', function(){jQuery('#authorize_button').attr("disabled", false)}, jQuery('#activation_redirection_url').val() ); 116 }); 117 }); 118 jQuery('#authorize_button').attr("disabled", false); 155 jQuery('#authorize_button').attr("disabled", false).click(authorize); 119 156 break; // End of step 1 120 157 case 2: … … 156 193 }); 157 194 }); 158 jQuery('#validate_button').click(function(){ 159 jQuery('#validate_button').attr("disabled", true); 160 // Check input 161 var fb_object_id_match = new RegExp(/^[a-zA-Z0-9]*$/); 162 var fb_object_id = jQuery('#fb_object_id').val(); 163 if (fb_object_id_match.exec( fb_object_id ) == null){ 164 showMessage('You must provide a valid object id (must be only numbers)', 'fb_object_id', true); 165 setMsgRemove( 'fb_object_id', 'fb_object_id' ); 166 jQuery('#validate_button').attr("disabled", false); 167 return false; 168 } else { 169 hideMessage( 'fb_object_id' ); 170 } 171 172 jQuery('#fb_obj_confirm #confirm_fb_obj_id').children().fadeOut('fast', function () {jQuery(this).empty();}); 173 toggleAjaxIndicator( '#step-2' ); 174 hideAllMessages(); 175 176 req = get_fb_object( fb_object_id, '#confirm_fb_obj_id' ); 177 req.complete(function(response){ 178 console.log(response); 179 if ( response.status != 200 ) { 180 toggleAjaxIndicator( '#step-2' ); 181 jQuery('#validate_button').attr("disabled", false); 182 return false; 183 } 184 185 jQuery('#step-2>table').fadeOut('fast', function () { 186 jQuery(this).hide(); 187 jQuery('#confirm_fb_obj_id').show() 188 hideAjaxIndicator( '#step-2' ); 189 jQuery('#fb_obj_confirm').removeClass('hidden-step').show('fast'); 190 }); 191 }); 192 }); 195 jQuery('#validate_button').click(validate); 193 196 jQuery('#step-2').addClass('setup'); 194 197 } 195 198 break; // End of step 2 196 199 } 197 198 } 199 200 function getLocaleString( locale ){ 201 202 } 203 200 } 201 202 jQuery('#setup-form').submit(function (e) { 203 //e.preventDefault(); 204 console.log(_currentStep); 205 switch (_currentStep){ 206 case 1: 207 authorize(); 208 break; 209 case 2: 210 validate(); 211 break; 212 } 213 }); 214 204 215 function nextStep() { 205 216 loadStep( _currentStep + 1 ); -
globalfeed/tags/0.1.2/feeds/mb_twitter/mb_twitter.php
r577487 r582059 121 121 'initial_setup_done' => false, 122 122 'show_welcome_message' => false, 123 'geotagging_enabled' => true 123 124 ); 124 125 … … 395 396 396 397 // Use the regex to replace numerical values to strings for older versions of php 397 $updates = json_decode( preg_replace('/("\w+"):(\d+)/', '\\1:"\\2"', $request['body']) );398 $updates = json_decode( preg_replace('/("\w+"):(\d+)/', '\\1:"\\2"', $request['body']), true ); 398 399 399 400 if ( $updates == NULL ) … … 402 403 $feed_items = array(); 403 404 foreach ($updates as $update) { 405 $globalfeed->print_debug_info($update); 406 if ( $update['user']['id'] != $feed_options['object_to_subscribe'] ) 407 continue; 404 408 405 if ( $update->user->id != $feed_options['object_to_subscribe'] )406 continue;407 $globalfeed->print_debug_info($update);408 409 $post_args = array( 409 'post_content' => $globalfeed->post_content($update ->text),410 'post_content' => $globalfeed->post_content($update['text']), 410 411 'post_excerpt' => '', 411 412 'comment_status' => 'closed', 412 413 'ping_status' => 'closed', 413 'post_author' => $update ->user->id,414 'post_title' => "@{$update ->user->screen_name}",415 'post_date' => date('Y-m-d H:i:s', strtotime( $update ->created_at) ),414 'post_author' => $update['user']['id'], 415 'post_title' => "@{$update['user']['screen_name']}", 416 'post_date' => date('Y-m-d H:i:s', strtotime( $update['created_at'] ) ), 416 417 'meta' => array( 417 'author_name' => $update ->user->name,418 'screen_name' => $update ->user->screen_name,419 'twitter_id' => $update ->id,420 'author_profile_image_url' => $update ->user->profile_image_url,421 'author_profile_image_url_https' => $update ->user->profile_image_url_https,422 'in_reply_to_status_id' => $update ->user->in_reply_to_status_id,423 'in_reply_to_user_id' => $update ->user->in_reply_to_user_id,424 'in_reply_to_screen_name' => $update ->user->in_reply_to_screen_name,418 'author_name' => $update['user']['name'], 419 'screen_name' => $update['user']['screen_name'], 420 'twitter_id' => $update['id'], 421 'author_profile_image_url' => $update['user']['profile_image_url'], 422 'author_profile_image_url_https' => $update['user']['profile_image_url_https'], 423 'in_reply_to_status_id' => $update['in_reply_to_status_id'], 424 'in_reply_to_user_id' => $update['in_reply_to_user_id'], 425 'in_reply_to_screen_name' => $update['in_reply_to_screen_name'], 425 426 ), 426 427 ); … … 438 439 $post_args['ID'] = $posts[0]->ID; 439 440 440 if ( $this->feed_options['geotagging_enabled'] ){441 $post_args['meta']['geo'] = $update->geo;442 $post_args['meta']['coordinates'] = $update->coordinates;443 $post_args['meta']['place'] = $update->place;441 if ( isset($this->feed_options['geotagging_enabled']) && $this->feed_options['geotagging_enabled'] && $update['user']['geo_enabled'] ){ 442 $post_args['meta']['geo'] = array('unique' => true, 'value' => $update['geo']); 443 $post_args['meta']['coordinates'] = array('unique' => true, 'value' => $update['coordinates']); 444 $post_args['meta']['place'] = array('unique' => true, 'value' => $update['place']); 444 445 } 445 446 … … 456 457 457 458 // Save all of the feed items. 458 $globalfeed->print_debug_info($feed_items);459 // $globalfeed->print_debug_info($feed_items); 459 460 //$globalfeed->print_debug_info( 460 461 $globalfeed->save_feed_items( $this->feed_slug, $feed_items ); -
globalfeed/tags/0.1.2/feeds/mb_twitter/pages/setup.php
r577487 r582059 18 18 ?> 19 19 <h2><?php _e('Twitter Connect Initial Setup',$mb_globalfeed_twitter_connect->get_slug()); ?></h2> 20 <form >20 <form id="setup-form"> 21 21 <input type="hidden" id="_wpnonce" value="<?php echo wp_create_nonce( 'twitter-connect-admin' ); ?>" /> 22 22 <input type="hidden" id="tw_api_url" value="<?php echo $mb_globalfeed_twitter_connect->apiurl(); ?>" /> … … 91 91 }); 92 92 }); 93 jQuery('#validate_button').click(function(){ 93 94 var validate = function (e) { 95 e.preventDefault(); 94 96 // The user has begun object validation 95 97 jQuery('#validate_button').attr("disabled", true); … … 109 111 jQuery('#validate_button').attr("disabled", false); 110 112 }) 111 }); 113 return false; 114 } 115 116 jQuery('#validate_button').click(validate); 117 jQuery('#setup-form').submit(validate); 112 118 jQuery('#step-1').addClass('setup'); 119 120 113 121 } 114 122 break; // End of step 2 -
globalfeed/tags/0.1.2/feeds/mb_youtube/mb_youtube.php
r577487 r582059 126 126 'initial_setup_done' => false, 127 127 'show_welcome_message' => false, 128 'use_https' => true 128 129 ); 129 130 … … 197 198 // Fetch the user data from YouTube 198 199 $userinfo = wp_remote_get("https://gdata.youtube.com/feeds/api/users/{$username}?alt=json"); 200 $this->globalfeed->print_debug_info($userinfo); 201 if (is_wp_error($userinfo)) { 202 // Try without https in case they have no https transports installed 203 $userinfo = wp_remote_get("http://gdata.youtube.com/feeds/api/users/{$username}?alt=json"); 204 $this->globalfeed->print_debug_info($userinfo); 205 206 if (is_wp_error($userinfo)) 207 die(json_encode ($userinfo->get_error_message())); 208 else 209 $this->feed_options['use_https'] = false; 210 } 211 199 212 $userinfo = json_decode($userinfo['body'], true); 200 213 $userinfo = $userinfo['entry']; … … 364 377 $globalfeed->print_debug_info('Update YouTube Feed Called.', 'mb_youtube'); 365 378 366 $api_url = "https://gdata.youtube.com/feeds/api/users/{$feed_options['object_to_subscribe']}/uploads?alt=json&orderby=published";379 $api_url = ($feed_options['use_https'] ? 'https://' : 'http://') ."gdata.youtube.com/feeds/api/users/{$feed_options['object_to_subscribe']}/uploads?alt=json&orderby=published"; 367 380 if ( $feed_options['max_feed_items'] != 0 ) 368 381 $api_url .="&max-results={$feed_options['max_feed_items']}"; -
globalfeed/tags/0.1.2/feeds/mb_youtube/pages/setup.php
r577487 r582059 18 18 ?> 19 19 <h2><?php _e('YouTube Connect Initial Setup',$mb_globalfeed_youtube_connect->get_slug()); ?></h2> 20 <form >20 <form id="setup-form"> 21 21 <input type="hidden" id="_wpnonce" value="<?php echo wp_create_nonce( 'youtube-connect-admin' ); ?>" /> 22 22 <input type="hidden" id="yt_api_url" value="<?php echo $mb_globalfeed_youtube_connect->apiurl(); ?>" /> … … 94 94 }); 95 95 }); 96 jQuery('#validate_button').click(function(){ 96 97 var validate = function (e) { 98 e.preventDefault(); 97 99 // The user has begun object validation 98 100 jQuery('#validate_button').attr("disabled", true); … … 112 114 jQuery('#validate_button').attr("disabled", false); 113 115 }) 114 }); 116 return false; 117 } 118 119 jQuery('#validate_button').click(validate); 120 jQuery('#setup-form').submit(validate); 115 121 jQuery('#step-1').addClass('setup'); 116 122 } -
globalfeed/tags/0.1.2/feeds/mbgf_rss/mbgf_rss.php
r577487 r582059 186 186 187 187 $feed_url = str_replace(' ','+',urldecode($_POST['rss_feed'])); 188 $rawxml = wp_remote_get( $feed_url ); 189 if ( is_wp_error($rawxml) ) 190 die( json_encode('Error reading rss feed.')); 191 192 try { 193 $feed = simplexml_load_string($rawxml['body']); 194 195 // If this was not XML, check and see if it contains a link to an XML doc 196 if ( $feed === false ) { 197 // Things aren't okay. Check and see if we maybe got a webpage with a link to a feed 198 if ( is_array($rawxml) ) { 199 if ( isset( $rawxml['response'] ) && is_array($rawxml['response']) && $rawxml['response']['code'] === 200) { 200 // We got served a page okay... 201 $dom = new DOMDocument; 202 if ( !$dom->loadHTML($rawxml['body']) ) 203 die( json_encode('Error reading rss feed.')); 204 205 $this->globalfeed->print_debug_info('dom'); 206 foreach ( $dom->getElementsByTagName('link') as $link ) { 207 if ( $link->attributes->getNamedItem('rel')->nodeValue != 'alternate' || $link->attributes->getNamedItem('type')->nodeValue != 'application/rss+xml' 208 || is_null($link->attributes->getNamedItem('href')->nodeValue)) 209 continue; 210 211 $feed_url = str_replace(' ','+',$link->attributes->getNamedItem('href')->nodeValue); 212 $rawxml = wp_remote_get( $feed_url ); 213 if ( is_wp_error($rawxml) ) 214 die( json_encode('Error reading rss feed.')); 215 216 $feed = simplexml_load_string($rawxml['body']); 217 218 if ( $feed !== false ) 219 break; 220 } 221 } 222 } else { 223 die( json_encode('Error reading rss feed.')); 224 } 188 189 $feed = $this->parse_rss_feed($feed_url); 190 191 if ( !$feed || is_wp_error($feed) ) 192 die( json_encode(array('Error reading rss feed.', $feed))); 193 194 if ( isset($feed['feed_list']) ) { 195 // The function found an html page linking to a list of feeds. Ask the 196 // client which feed is desired 197 $feed_list = array(); 198 foreach ($feed['feed_list'] as $feed_url => $feed_info) { 199 $feed_list[] = array( 200 'title' => $feed_info['title'], 201 'url' => $feed_url 202 ); 225 203 } 226 204 227 if ( $feed === false ) 228 die( json_encode('Error reading rss feed.')); 229 230 // Things seem to be okay 231 $namespaces = $feed->getNamespaces(true); 232 $feed = $feed->channel; 233 } catch (Exception $exc) { 234 die( json_encode('Error reading rss feed.')); 235 } 236 237 if ($feed == NULL) 238 die( json_encode('Error reading rss feed.')); 205 die(json_encode(array( 'feeds_found' => $feed_list ))); 206 } 207 208 if ( isset($feed['url']) && !empty($feed['url']) ) 209 $feed_url = $feed['url']; 210 211 $feed = $feed['feed']; 239 212 240 213 // Save the feed data … … 259 232 } 260 233 234 /** 235 * Attempts to grab a valid RSS feed from a url, or get the feeds pointed to 236 * by the page at that url. (Ie: A wordpress blog that has links to several feeds) 237 * 238 * @param str $feed_url The url of the feed, or the page that links to the feed 239 * @return boolean|array Array on success, false on fail 240 * 241 * @todo Get rid of the @ warning blockers by filtering the content. 242 */ 243 private function parse_rss_feed( $feed_url ) { 244 $rawxml = wp_remote_get( $feed_url ); 245 if ( is_wp_error($rawxml) ) 246 return $rawxml; 247 248 try { 249 @$feed = simplexml_load_string($rawxml['body']); 250 251 // If this was not XML, check and see if it contains a link to an XML doc 252 if ( $feed === false ) { 253 // Things aren't okay. Check and see if we maybe got a webpage with a link to a feed 254 if ( is_array($rawxml) ) { 255 $feed_list = array(); 256 if ( isset( $rawxml['response'] ) && ((int) $rawxml['response']['code']) === 200) { 257 // We got served a page okay... 258 $dom = new DOMDocument; 259 if ( @!$dom->loadHTML($rawxml['body']) ) 260 return false; 261 262 foreach ( $dom->getElementsByTagName('link') as $link ) { 263 if ( $link->attributes->getNamedItem('rel')->nodeValue != 'alternate' || $link->attributes->getNamedItem('type')->nodeValue != 'application/rss+xml' 264 || is_null($link->attributes->getNamedItem('href')->nodeValue)) 265 continue; 266 267 $feed_url = str_replace(' ','+',$link->attributes->getNamedItem('href')->nodeValue); 268 $rawxml = wp_remote_get( $feed_url ); 269 270 if ( is_wp_error($rawxml) ) 271 return false; 272 273 @$feed = simplexml_load_string($rawxml['body']); 274 275 if ( $feed !== false ) 276 // This seems to be a legit feed, add it to the list of those found 277 $feed_list[ $feed_url ] = array( 'title' => (string) trim( !empty($feed->channel->title) ? $feed->channel->title[0] : $link->attributes->getNamedItem('title')->nodeValue[0] ), 'url' => $feed_url, 'contents' => $feed ); 278 } 279 280 $feed_count = count($feed_list); 281 if ( $feed_count === 0 ) 282 // No feeds found, send error 283 return false; 284 else if ( $feed_count > 1 ) 285 // Several feeds found, send list 286 return array( 'feed_list' => $feed_list ); 287 else { 288 // One feed found, return that feed 289 $feed = array_pop( $feed_list ); 290 $feed_url = $feed['url']; 291 $feed = $feed['contents']; 292 } 293 } 294 } else { 295 return false; 296 } 297 } 298 299 if ( $feed === false ) 300 return false; 301 302 // Things seem to be okay 303 return array( 304 'url' => $feed_url, 305 'namespaces' => $feed->getNamespaces(true), 306 'feed' => $feed->channel 307 ); 308 } catch (Exception $exc) { 309 return false; 310 } 311 } 312 261 313 public function remove_rss_feed() { 262 314 check_admin_referer( 'mb-rss-admin' ); … … 269 321 'post_type' => $this->globalfeed->post_type_namespace() . $this->get_slug(), 270 322 'numberposts' => -1, 323 'posts_per_page' => -1, 271 324 'meta_value' => $feed_url, 272 325 'meta_key' => 'source', … … 433 486 // Attempt to parse the xml feed 434 487 try { 435 $updates = simplexml_load_string($request['body']);436 if ($updates == NULL )488 @$updates = simplexml_load_string($request['body']); 489 if ($updates == NULL && empty($updates)) 437 490 throw new Exception('Could not parse XML. Invalid structure or not XML/RSS.'); 438 491 … … 483 536 $posts = query_posts($posts_query); 484 537 if ( count($posts) >= 1 ) 485 $post_args['import_id'] = $posts[0] ['ID'];538 $post_args['import_id'] = $posts[0]->ID; 486 539 487 540 // Add the categories to the category variable. … … 494 547 $content = $update->children($namespaces['content']); 495 548 $post_args['post_content'] = (string) trim($content->encoded); 496 } 549 } else if ( isset($update->description) ) { 550 $post_args['post_content'] = (string) $update->description[0]; 551 } 497 552 498 553 // Get media information if its supported … … 500 555 // Get the content from the media namespace 501 556 $content = $update->children($namespaces['media']); 502 503 // Set the post format based on the medium type504 $post_args['post_format'] = $this->medium_post_format_conversions[$this->get_xml_attr($content->content[0], 'medium')];505 $post_args['post_content'] = (string) trim($content->description);506 $post_args['meta']['media'] =array(507 'url' => $this->get_xml_attr($content->content[0], 'url'),508 'medium' => $this->get_xml_attr($content->content[0], 'medium'),509 'height' => (int) $this->get_xml_attr($content->content[0], 'height'),510 'width' => (int) $this->get_xml_attr($content->content[0] ,'width'),511 );512 513 $post_args['meta']['rating'] = (string) trim($content->rating);514 $post_args['meta']['copyright'] = (string) trim($content->copyright);515 $post_args['meta']['copyright_link'] = $this->get_xml_attr($content->copyright, 'url');516 $post_args['meta']['thumbnail'] = $this->get_xml_attr($content->thumbnail[0], 'url');517 $post_args['meta']['thumbnail_size'] = array(518 'width' => (int) $this->get_xml_attr($content->thumbnail[0], 'width'),519 'height' => (int) $this->get_xml_attr($content->thumbnail[0], 'height'),520 ); 521 522 // Save the category as an array523 if ( $this->get_xml_attr($content->category, 'label') != '')524 $post_args['categories'][(string) trim($content->category)] = $this->get_xml_attr($content->category, 'label');525 else526 $post_args['categories'][(string) trim($content->category)] = (string) trim($content->category);557 if ( $content->content[0] ) { 558 // Set the post format based on the medium type 559 $post_args['post_format'] = (string) $this->medium_post_format_conversions[$this->get_xml_attr($content->content[0], 'medium')];$this->globalfeed->print_debug_info('ere'); 560 $post_args['post_content'] = (string) trim($content->description); 561 $post_args['meta']['media'] = array( 'unique' => false, 'value' => array( 562 'url' => $this->get_xml_attr($content->content[0], 'url'), 563 'medium' => $this->get_xml_attr($content->content[0], 'medium'), 564 'height' => (int) $this->get_xml_attr($content->content[0], 'height'), 565 'width' => (int) $this->get_xml_attr($content->content[0] ,'width'), 566 ) ); 567 $post_args['meta']['rating'] = (string) trim($content->rating); 568 $post_args['meta']['copyright'] = (string) trim($content->copyright); 569 $post_args['meta']['copyright_link'] = (string) $this->get_xml_attr($content->copyright, 'url'); 570 $post_args['meta']['thumbnail'] = (string) $this->get_xml_attr($content->thumbnail[0], 'url'); 571 $post_args['meta']['thumbnail_size'] = array( 'unique' => false, 'value' => array( 572 'width' => (int) $this->get_xml_attr($content->thumbnail[0], 'width'), 573 'height' => (int) $this->get_xml_attr($content->thumbnail[0], 'height'), 574 ) ); 575 576 // Save the category as an array 577 if ( $this->get_xml_attr($content->category, 'label') != '') 578 $post_args['categories'][(string) trim($content->category)] = $this->get_xml_attr($content->category, 'label'); 579 else 580 $post_args['categories'][(string) trim($content->category)] = (string) trim($content->category); 581 } 527 582 } 528 583 -
globalfeed/tags/0.1.2/feeds/mbgf_rss/pages/js/mbgf_rss.js
r563348 r582059 40 40 if (response == true) { 41 41 // Setup is complete, go to main configuration. 42 showMessage('The feed was removed successfully.', 'removeSuccess ', false, 10000);42 showMessage('The feed was removed successfully.', 'removeSuccess_' + Math.round(Math.random()*1000), false, 10000); 43 43 link_obj.parent().parent().remove(); 44 44 return true; -
globalfeed/tags/0.1.2/feeds/mbgf_rss/pages/settings-main.php
r578780 r582059 12 12 global $mb_globalfeed,$mbgf_rss,$mbgfa_theme; 13 13 14 wp_enqueue_script('jquery');14 $mbgfa_theme->queue_js_client_tools(); 15 15 ?> 16 16 <h2><?php _e('MB RSS') ?></h2> 17 <form >17 <form id="settings-form"> 18 18 <input type="hidden" value="<?php echo wp_create_nonce( 'mb-rss-admin' ) ?>" id="_wpnonce" /> 19 19 <div id="notices"> … … 46 46 </table> 47 47 </fieldset> 48 49 <div id="multiple_feeds_selector" style="display:none;"> 50 <h3>Multiple feeds were found at that url...</h3> 51 <p>Which would you like to import?</p> 52 <ul class="feed_list"></ul> 53 </div> 48 54 </form> 49 55 <script type="text/javascript"> 50 56 jQuery(document).ready(function(){ 51 jQuery('.add_feed a').click(function(){ 57 var submit = function(e){ 58 e.preventDefault(); 52 59 // Disable the element for checking... 53 60 jQuery(this).attr('disabled',''); … … 55 62 toggleAjaxIndicator('.add_feed'); 56 63 64 urlcheck = new RegExp(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i); 65 checkUrl = function ( url ) { 66 return urlcheck.exec(url); 67 } 68 57 69 // Apply the checking pattern... 58 urlcheck = new RegExp(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i);59 if ( ! urlcheck.exec(jQuery('.add_feed input').val()) ){70 71 if ( !checkUrl(jQuery('.add_feed input').val()) ){ 60 72 showMessage('The url entered does not appear correct.', 'badUrl', false, 10000); 61 73 jQuery('.add_feed input').removeAttr('disabled'); … … 63 75 return; 64 76 } 65 66 feed_info = add_feed( jQuery('.add_feed input').val() ); 67 if ( feed_info != false ) { 68 feed_info.success(function (iresponse){ 69 try { 70 if (iresponse.responseText != undefined) 71 response = jQuery.parseJSON(iresponse.responseText); 72 else 73 response = jQuery.parseJSON(iresponse); 74 } catch(err) { 75 showMessage('Error: An error was encountered saving the feed. ' + iresponse, 'saveError', true); 76 hideAjaxIndicator('.add_feed'); 77 return; 78 } 79 80 if ( typeof(response) == "undefined" || response == null || response.title == null ){ 81 showMessage('Error: An error was encountered saving the feed. ' + response, 'saveError', true); 82 hideAjaxIndicator('.add_feed'); 83 return; 84 } 85 86 feed_item = jQuery("<tr><td class='feed_description'><strong>" + response.title + "</strong><br />" + response.description + "</td><td class='icons'><a href='" + response.feed_url + "' class='remove_feed'><?php $mbgfa_theme->minus('Remove Feed',16);?></a><?php $mbgfa_theme->ajaxIndicator('Working...');?></td></tr>"); 87 jQuery('#feed_list').append(feed_item); 88 89 setupRemoveHandler(jQuery('#feed_list').last().find('a')); 90 hideAjaxIndicator('.add_feed'); 91 jQuery('.add_feed input').val(''); 92 }); 93 } 77 var do_add_feed = function ( feed_url, cb ) { 78 if ( typeof feed_url === 'undefined' ) 79 feed_url = jQuery('.add_feed input'); 80 81 feed_info = add_feed( feed_url ); 82 if ( feed_info != false ) { 83 feed_info.success(function (iresponse){ 84 try { 85 if (iresponse.responseText != undefined) 86 response = jQuery.parseJSON(iresponse.responseText); 87 else 88 response = jQuery.parseJSON(iresponse); 89 } catch(err) { 90 showMessage('Error: An error was encountered saving the feed. ' + iresponse, 'saveError', true); 91 hideAjaxIndicator('.add_feed'); 92 return; 93 } 94 95 if ( typeof(response) == "undefined" || response == null || (response.title == null && response.feeds_found == null) ){ 96 showMessage('Error: An error was encountered saving the feed. ' + response, 'saveError', true); 97 hideAjaxIndicator('.add_feed'); 98 return; 99 } 100 101 if ( response.title != null ) { 102 // The feed was successfully parsed 103 feed_item = jQuery("<tr><td class='feed_description'><strong>" + response.title + "</strong><br />" + response.description + "</td><td class='icons'><a href='" + response.feed_url + "' class='remove_feed'><?php $mbgfa_theme->minus('Remove Feed',16);?></a><?php $mbgfa_theme->ajaxIndicator('Working...');?></td></tr>"); 104 jQuery('#feed_list tbody').append(feed_item); 105 106 setupRemoveHandler(jQuery('#feed_list tbody tr:last-child a')); 107 hideAjaxIndicator('.add_feed'); 108 jQuery('.add_feed input').val(''); 109 if ( typeof cb !== 'undefined' ) 110 cb(); 111 } else { 112 // Multiple feeds were found -- ask the user which they want 113 jQuery('#multiple_feeds_selector .feed_list').empty(); 114 115 var c = 0; 116 for ( i in response.feeds_found ) { 117 jQuery('#multiple_feeds_selector .feed_list').append( 118 '<li><label for="found_feed_' + c + '"><input id="found_feed_' + c + '" name="found_feed_' + c + '" type="checkbox" value="' + response.feeds_found[i].url + '" /> ' + response.feeds_found[i].title + "</label><?php echo $mbgfa_theme->ajaxIndicator('Getting Feed...', true); ?></li>" 119 ); 120 121 c++; 122 } 123 124 jQuery('#multiple_feeds_selector .feed_list li input').change(function () { 125 var parent = jQuery(this).parents('li'); 126 if ( checkUrl(jQuery(this).val()) ) { 127 jQuery(this).attr('disabled', true); 128 toggleAjaxIndicator(jQuery(this).parents('li')); 129 do_add_feed( jQuery(this).val(), function () { 130 parent.fadeOut(function () { 131 jQuery(this).remove(); 132 if ( jQuery('#multiple_feeds_selector .feed_list').children('li').length === 0 ) 133 jQuery.fancybox.close(); 134 }); 135 } ); 136 } else 137 parent.remove(); 138 }); 139 140 jQuery.fancybox.open({ content: jQuery('#multiple_feeds_selector'), beforeClose: function () {hideAjaxIndicator('.add_feed');} }); 141 } 142 }); 143 } 144 }; 145 146 do_add_feed( jQuery('.add_feed input').val() ); 94 147 jQuery('.add_feed input').removeAttr('disabled'); 95 }); 148 return false; 149 } 96 150 151 jQuery('.add_feed a').click(submit); 152 jQuery('#settings-form').submit(function (e) { 153 if ( jQuery('.add_feed input').is(':focus') ) { 154 e.preventDefault(); 155 submit(e); 156 return false; 157 } 158 }) 97 159 setupRemoveHandler(); 98 160 … … 117 179 118 180 function setupRemoveHandler( item ) { 119 if ( typeof(item) == 'undefined') {181 if ( typeof(item) === 'undefined' ) { 120 182 jQuery('.remove_feed').click(function(){ 121 183 jQuery(this).hide(); -
globalfeed/tags/0.1.2/mb_globalfeed.php
r579409 r582059 2 2 /* 3 3 Plugin Name: GlobalFeed 4 Plugin URI: http:// MichaelBlouin.ca5 Version: 0.1. 14 Plugin URI: http://GlobalFeed.MichaelBlouin.ca 5 Version: 0.1.2 6 6 Author: <a href="http://www.michaelblouin.ca/">Michael Blouin</a> 7 7 Description: This plugin can integrate nearly any type of feed into the WordPress feed on your blog pages. … … 46 46 private $_loaded = false; 47 47 private $current_page = false; 48 private $globalfeed_version = '0.1 0';48 private $globalfeed_version = '0.1.2'; 49 49 private $_in_widget = false; 50 50 private $_in_shortcode = false; … … 526 526 function create_options(){ 527 527 // Create plugin options 528 $this->load_settings ;528 $this->load_settings(); 529 529 add_option( $this->saved_options_name['settings'], $this->settings ); 530 530 add_option( $this->saved_options_name['feeds'], array() ); … … 683 683 $current_page_info = array( 684 684 'page' => $current_page, 685 'category' => $fake_query->category__in,686 'tag' => $fake_query->tag__in,685 'category' => (isset($fake_query->category__in) ? $fake_query->category__in : array()), 686 'tag' => (isset($fake_query->tag__in) ? $fake_query->tag__in : array()), 687 687 'request' => $request, 688 688 'query' => &$fake_query … … 736 736 737 737 // Add the post types to the query and return 738 if ( count( $post_types ) > 0 ) 739 $request[ 'post_type' ] = array_unique( array_merge( (array) $request[ 'post_type' ], $post_types ) ); 738 if ( count( $post_types ) > 0 ) { 739 if ( isset($request[ 'post_type' ]) ) 740 $request[ 'post_type' ] = array_unique( array_merge( (array) $request[ 'post_type' ], $post_types ) ); 741 else 742 $request[ 'post_type' ] = $post_types; 743 } 740 744 741 745 $this->print_debug_info("Request Modified.", 'notifications'); … … 913 917 914 918 // Define template file locations (for the feed and globalfeed default 915 $templates_path = dirname($this->registered_feeds[$feed_slug]['file_path']) . '/templates/'; 919 if ( !empty($feed_slug) ) 920 $templates_path = dirname($this->registered_feeds[$feed_slug]['file_path']) . '/templates/'; 921 else 922 $templates_path = ''; 923 916 924 $feed_templates_path = dirname(__FILE__) . "/templates/"; 917 925 … … 933 941 $located = $feed_templates_path . $template_name; 934 942 break; 935 } else if ( file_exists($templates_path . $template_name) ) {943 } else if ( !empty($templates_path) && file_exists($templates_path . $template_name) ) { 936 944 $this->load_theme_stylesheet($templates_path); 937 945 $located = $templates_path . $template_name; … … 999 1007 if ( !empty($feeds) ) { 1000 1008 foreach ( $feeds as $slug => &$feed ) { 1001 if ( $feed['autoload'] !== false ) 1009 $this->print_debug_info($feed); 1010 if ( !isset($feed['autoload']) || $feed['autoload'] !== false ) 1002 1011 require_once($feed['file_path']); 1003 1012 … … 1026 1035 $feed = &$feeds[ $feed_slug ]; 1027 1036 1028 if ( $feed['loaded'] ) {1037 if ( isset($feed['loaded']) && $feed['loaded'] ) { 1029 1038 global $$feed['class_name']; 1030 1039 return $$feed['class_name']; … … 1062 1071 $wp_required = explode('.', $feed['WordPressVersion']); 1063 1072 foreach ($wp_required as $i => $value) { 1064 if ( !isset($wpv[$i]) || ((int) $wpv[$i]) < ((int) $ wordpress_required[$i]) )1073 if ( !isset($wpv[$i]) || ((int) $wpv[$i]) < ((int) $value) ) 1065 1074 $requirements[ 'WordPress Version' ] = sprintf( __("{$feed['Name']} requires WordPress v%s+.", $feed['Slug']), $feed['WordPressVersion'] ); 1066 1075 } 1067 1076 1068 1077 // Check that Global Feed is v0.1 or greater 1069 $gfv = explode('.', $ mb_globalfeed->version);1078 $gfv = explode('.', $this->version()); 1070 1079 $globalfeed_required = explode('.', $feed['GlobalFeedVersion']); 1071 1080 foreach ($globalfeed_required as $i => $value) { … … 1174 1183 ); 1175 1184 1176 $options = wp_parse_args( $options, $default );1185 $options = wp_parse_args( $options, $defaults ); 1177 1186 1178 1187 //The post type plus the Global Feed namespace cannot be more than 20 characters. … … 1197 1206 1198 1207 //Do not allow feeds to force their own activation 1199 if ( !empty( $registered_feeds[ $feed_slug ] ) )1208 if ( !empty( $registered_feeds[ $feed_slug ] ) && isset($registered_feeds[ $feed_slug ][ 'activated' ]) ) 1200 1209 $options[ 'activated' ] = $registered_feeds[ $feed_slug ][ 'activated' ]; 1210 else 1211 $options[ 'activated' ] = true; 1201 1212 1202 1213 // We're good to save feed settings … … 1315 1326 // This is not implemented yet... 1316 1327 } else { // Save categories as meta instead 1317 $feed_item['meta']['categories'] = $feed_item['categories']; 1328 if ( !isset($feed_item['meta']) ) 1329 $feed_item['meta'] = array(); 1330 1331 $feed_item['meta']['categories'] = array( 'unique' => true, 'value' => $feed_item['categories'] ); 1318 1332 unset($feed_item['categories']); 1319 1333 }; … … 1323 1337 // This is not implemented yet... 1324 1338 } else { // Save tags as meta instead 1325 $feed_item['meta']['tags'] = $feed_item['tags']; 1339 if ( !isset($feed_item['meta']) ) 1340 $feed_item['meta'] = array(); 1341 1342 $feed_item['meta']['tags'] = array( 'unique' => true, 'value' => $feed_item['tags']); 1326 1343 unset($feed_item['tags']); 1327 1344 }; … … 1397 1414 // Calculate where pages should be shown. 1398 1415 foreach ( $feed_options[ 'pages_to_show' ] as $key => $value ) { 1399 if ( in_array( $key, array( 'tag', 'category' ) ) ) {1416 if ( in_array( $key, array( 'tag', 'category' ) ) && is_array($value) ) { 1400 1417 foreach ( $value as $tax ) { 1401 1418 if ( is_array( $pages[$key][$tax] ) ) … … 1426 1443 if ( !empty($feed_options[ 'pages_not_to_show' ])){ 1427 1444 foreach ( $feed_options[ 'pages_not_to_show' ] as $key => $value) { 1428 if ( in_array( $key, array( 'tag', 'category' ) ) ) {1445 if ( in_array( $key, array( 'tag', 'category' ) ) && is_array($value) ) { 1429 1446 foreach ( $value as $tax ) { 1430 1447 if ( is_array( $pages[ $key ][ $tax ] ) ) … … 1555 1572 1556 1573 if ( in_array('url', $types) ) { 1557 $pattern = '/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:\.\?+=&%@!\-\/]))?([^à ¢â‚¬Å“�«»„])/u';1574 $pattern = '/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:\.\?+=&%@!\-\/]))?([^“�«»„])/u'; 1558 1575 $text = implode(' ',preg_replace_callback( $pattern, array( &$this, '_replace_link_callback'), explode(' ', $text))); 1559 1576 } … … 1603 1620 * @return The formatted excerpt 1604 1621 */ 1605 function post_content( $content, $args ) {1622 function post_content( $content, $args = array() ) { 1606 1623 $args = wp_parse_args($args, $this->settings['post_content']); 1607 1624 -
globalfeed/tags/0.1.2/readme.txt
r578932 r582059 5 5 Requires at least: 3.3 6 6 Tested up to: 3.4.1 7 Stable tag: 0.1. 17 Stable tag: 0.1.2 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 35 35 36 36 If you are interested in developing GlobalFeed, or have a fix you would like to submit, please go to our bug reports page through the plugin and get in touch. 37 38 = Requirements = 39 PHP >= 5.2.2 37 40 38 41 == Installation == … … 86 89 == Changelog == 87 90 91 = 0.1.2 = 92 - MB RSS can be pointed to a webpage and will attempt to automatically discover its RSS feeds, and will then prompt the user if more than one feed is found. 93 - Added additional parsing capabilities to MB RSS to increase compatibility with feeds such as Tumblr and DeviantArt. 94 - Fixed a large number of notices that were appearing in older versions of PHP and that were breaking the plugin. 95 - Stopped the user from being redirected when pressing enter while a feed setup textbox was focused. 96 - Stopped MB RSS from displaying multiple feed removed messages when a feed as removed after adding one or more feeds. 97 88 98 = 0.1.1 = 89 99 - Stability improvements for feed setup screens, including much better support for the Facebook feed. … … 113 123 = 0.2 = 114 124 * More configuration options in both the plugin admin and all feed admin pages. 125 * Tumblr and DeviantArt quickembeds in MB RSS. 115 126 * Ability to just attach media (pictures/videos) to posts instead of embedding it directly in the content. 116 * Customize feed update interval117 127 * Better in-plugin support (explanation of options/features) 118 128 * Flickr feed 119 * DeviantArt feed120 129 * Google+ feed 121 130
Note: See TracChangeset
for help on using the changeset viewer.