Plugin Directory

Changeset 711609


Ignore:
Timestamp:
05/12/2013 05:28:54 AM (13 years ago)
Author:
mobius5150
Message:

Fixed a bug in parsing youtube video URLs and added a new mb_globalfeed_fb_post_content_args filter. Will follow up by adding the same filter for other feeds.

Location:
globalfeed/trunk
Files:
2 edited

Legend:

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

    r711217 r711609  
    645645        wp_verify_nonce( 'facebook-connect-settings_main' );
    646646       
    647         $res = $this->update_feed();
     647        $res = $this->update_feed(array());
    648648       
    649649        if ( is_int($res) )
     
    696696        $feed_items = array();
    697697        foreach ($updates->data as $update) {
    698            
    699698            $update->id = explode('_', $update->id);
    700699            $page_id = $update->id[0];
     
    758757                            // The link is to a youtube video. Extract the id, then call the embedder.
    759758                            $post_args['meta']['video_source'] = 'youtube';
    760                             $post_args['meta']['youtube_id'] = substr( $post_args['meta']['link'], strripos( $post_args['meta']['link'], '/' ) + 9 );
     759                            $globalfeed->print_debug_info("Parsing youtube id:" . $post_args['meta']['link']);
     760                            parse_str( parse_url( $post_args['meta']['link'], PHP_URL_QUERY ), $url_params );
     761                            $post_args['meta']['youtube_id'] = $url_params['v'];
     762//                            $post_args['meta']['youtube_id'] = substr( $post_args['meta']['link'], strripos( $post_args['meta']['link'], '/' ) + 9 );
    761763                           
    762764                            $content_args['media_format'] = 'video';
     
    764766                        }
    765767                    }
    766                     // Let GlobalFeed embed the content of required.
    767                    
    768768                    break;
    769769                case 'link' :
     
    850850           
    851851            // The $content_args array will contain information about any media to be embedded in the content
     852            $content_args = apply_filters('mb_globalfeed_fb_post_content_args', $content_args, $post_args);
    852853            $post_args['post_content'] = $globalfeed->post_content(isset($update->message) ? $update->message : $update->story, $content_args);
    853854           
  • globalfeed/trunk/mb_globalfeed.php

    r711217 r711609  
    16811681           
    16821682            // First check if there is a set word limit
    1683             if ( isset($args['character_count']) && $args['word_count'] !== false ) {
     1683            if ( isset($args['word_count']) && $args['word_count'] !== false ) {
    16841684                $words = explode(' ', $content);
    16851685                $content = implode(' ', array_slice($words, 0, $args['word_count']));
Note: See TracChangeset for help on using the changeset viewer.