Plugin Directory

Changeset 804415


Ignore:
Timestamp:
11/14/2013 02:42:35 PM (12 years ago)
Author:
sydcode
Message:

Fixed bug in user profile loader.

Location:
youtube-comments/trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • youtube-comments/trunk/class-comments.php

    r786864 r804415  
    66   
    77    protected static $instance = null;
    8     const PLUGIN_VERSION = '1.2.0';
     8    const PLUGIN_VERSION = '1.2.1';
    99    private $client = null;
    1010    private $youtube = null;
  • youtube-comments/trunk/readme.txt

    r786864 r804415  
    22Contributors: sydcode
    33Donate link:
    4 Tags: YouTube, video, comments
     4Tags: youtube, video, comments, video comments, google, social, social networks, social plugin, media
    55Requires at least: 3.3
    6 Tested up to: 3.6.1
    7 Stable tag: 1.2.0
     6Tested up to: 3.7.1
     7Stable tag: 1.2.1
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    7070* Added setting for URL custom fields.
    7171* Updated the readme.
     72
     73= 1.2.1 =
     74* Fixed bug in user profile loader.
  • youtube-comments/trunk/style.css

    r759170 r804415  
    2828#youtube-comments img {
    2929    border: none;
     30    box-shadow: none;
    3031    margin: 0;
    3132    padding: 0;
  • youtube-comments/trunk/template-comments.php

    r786864 r804415  
    3636foreach($comments->entry as $comment) {
    3737    // Get author metadata
     38    $author = false;
    3839    $author_uri = $comment->author->uri;
    39     $author = simplexml_load_file($author_uri);
    40     $author_link = $author->link->attributes();
    41     $media = $author->children('media', true);
    42     $thumbnail = $media->thumbnail->attributes();
     40    if (strpos($author_uri, '__NO_YOUTUBE_ACCOUNT__') === false) {
     41        $author = @simplexml_load_file($author_uri); // suppress errors
     42    }
     43    if ($author) {
     44        $link_atts = $author->link->attributes();
     45        $link_href = $link_atts->href;
     46        $media = $author->children('media', true);
     47        $thumbnail_atts = $media->thumbnail->attributes(); 
     48        $thumbnail_url = $thumbnail_atts->url;
     49    } else {
     50        // Default values for private profiles
     51        $link_href = '';
     52        $thumbnail_url = plugins_url('profile.png', __FILE__);
     53    }
     54    $name = $comment->author->name;
    4355    $posted = $this->time_ago($comment->published);
    4456    $text = nl2br($comment->content);
     
    5870        <li class='comment-item'>
    5971            <div class='author-thumbnail'>
    60                 <img src='<?php echo $thumbnail->url; ?>' alt='' />
     72                <a href='<?php echo $link_href; ?>' title='<?php echo $name; ?>'>
     73                    <img src='<?php echo $thumbnail_url; ?>' alt='' />
     74                </a>
    6175            </div>
    6276            <div class='comment-content'>
    6377                <span class='author-metadata'>
    64                     <a class='author-name' href='<?php echo $author_link->href; ?>'><?php echo $comment->author->name; ?></a>
     78                    <a class='author-name' href='<?php echo $link_href; ?>'><?php echo $name; ?></a>
    6579                    <span class='comment-posted'><?php echo $posted; ?></span>
    6680                </span>
  • youtube-comments/trunk/youtube-comments.php

    r786864 r804415  
    44Plugin Name: YouTube Comments
    55Description: This plugin finds YouTube links in post content and imports the video comments.
    6 Version: 1.2.0
     6Version: 1.2.1
    77Author: sydcode
    88Author URI: http://profiles.wordpress.org/sydcode
Note: See TracChangeset for help on using the changeset viewer.