Youtube Channel Plugin
Seeing Error on Channel (2 posts)

  1. bryananthonylewis
    Posted 3 years ago #

    Is there a demo of this I can check out?

    I've installed the plugin on my website and added this short code to my page... [ytchannel channel="AMerehomage" showcase="JTMQ27km0K4" limit="6" showcase_width="630" thumbnail_width="200"]

    But for some reason I'm getting an error...
    Youtube Channel "AMerehomage" not found
    Warning: Invalid argument supplied for foreach() in /nfs/c06/h04/mnt/92807/domains/merehomage.com/html/wp-content/plugins/youtube-channel-showcase/youtubechannel.php on line 41

    This is the channel I want to show... http://www.youtube.com/user/AMerehomage?feature=watch

    This is the video I want to feature... http://www.youtube.com/watch?v=JTMQ27km0K4&list=UUyXGljk4ZQN1IM0lbakIrvw&index=1&feature=plcp

    I'm not for sure what I'm doing wrong.



  2. constantine.johny
    Posted 3 years ago #

    Hi, I had the same error.
    You probably have fopen disabled on your hosting...

    To fix this, open youtubechanel.php and fix these lines:

    Find function function xml2array($url, $get_attributes = 1, $priority = 'tag')
    Comment this:

    /*  if (!($fp = @ fopen($url, 'r')))
            return array ();
        } */

    And just after those lines add this:

    $ch = curl_init();
    $timeout = 0;
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    $file_contents = curl_exec($ch);

    Next, comment this:

    /*while (!feof($fp))
            $contents .= fread($fp, 8192);
        fclose($fp);  */

    And it should be working now.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Youtube Channel Plugin
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic