I have a script on a site that pulls in you-tube videos,
The problem is, that the thumb nails for the site, no longer show up.
I have tried to add codes to remove the line causing the problem but this fails me.
The code is this if anyone has a way to fix it.
<?php
function yt($ytsearch) {
global $ytcurrenttag;
global $ytvids;
global $ytid;
$ytvids = array();
$ytid=0;
function ytinsidethetag($ytparser, $ytdata){
global $ytcurrenttag;
global $ytvids;
global $ytid;
if(!strcmp(strtolower($ytcurrenttag),"title")) {
$ytvids[$ytid]['type'] = "yt";
$ytvids[$ytid]['title']=$ytdata;
$ytvids[$ytid]['title'][0] = ucwords($ytvids[$ytid]['title'][0]);
}
}
function ytopentag($ytparser, $ytdata, $ytattr=''){
global $ytcurrenttag;
$ytcurrenttag = $ytdata;
global $ytvids;
global $ytid;
if(!strcmp(strtolower($ytcurrenttag),"media:player")) {
$ytvids[$ytid]['link']=str_replace("watch?v=","v/",$ytattr['URL']);
$ytvids[$ytid]['thumb']=str_replace("http://www.youtube.com/v/","http://img.youtube.com/vi/",$ytvids[$ytid]['link']);
$ytvids[$ytid]['thumb'].="/2.jpg";
}
}
function ytclosetag($ytparser, $ytdata){
global $ytid;
if(!strcmp(strtolower($ytdata),"entry"))
$ytid++;
}
$ytxml_parser = xml_parser_create();
xml_set_element_handler($ytxml_parser, "ytopentag", "ytclosetag");
xml_set_character_data_handler($ytxml_parser, "ytinsidethetag");
include("fetch.php");
$ytdata = fetchrssyt("http://gdata.youtube.com/feeds/videos?vq=$ytsearch&start-index=1&max-results=40");
if(!(xml_parse($ytxml_parser, $ytdata)))
die("Error on line " . xml_get_current_line_number($ytxml_parser));
xml_parser_free($ytxml_parser);
return $ytvids;
}
?>
The code in the browser for the thumb comes up.
http://img.youtube.com/vi/lOgQyIMX_XU&feature=youtube_gdata/2.jpg
and i think for it to work i need.
http://img.youtube.com/vi/lOgQyIMX_XU/2.jpg
lOgQyIMX_XU = whatever video needs to be displayed.
Someone said to try this.
$ytid = str_replace('feature=youtube_gdata', '',$ytid);
$ytid = str_replace('&', '',$ytid);
$ytid = str_replace('amp;', '',$ytid);
but it did nothing for the problem
Thanks
asp authentication problem
Hello all,
Dealing with code in db query
I am dealing with C code and I need to make sure it is encoded some how to ensure its integrity and then decoded. For security and later readability.
What's best way to get a user's Word doc converted to simple html and images?
Hi all,I was just wondering if anybody has any experience of this.Basically, I'm building a site for a guy and he keeps throwing tonnes of content my way, all Word docs with tables, images, etc.The
User feedback after MySQL query has been executed
Hi all, I've just registered on PHPFreaks because I've got a question that I simply can't work out by myself.Im developing a web based reporting application, based upon PHP/MySQL. At some point the
=> and <=
So I was digging through some code when I came across the <= operator. This is the first time I've ever seen it. I felt the same way I did when I first saw a ternary statement. What is
Windows 7
Windows 7 default user account control worries experts. Corporate IT departments should be pleased with new security measures in Windows 7, but consumers are still at risk of getting hit by malware
elseif help!
OK so I'm new to the site, as well as PHP altogether (Trying my hand at managing an online RPG) and so far it's been quite smooth. However whilst trying to change an aspect of the game from giving the
$_POST
Hi, I have 2 seperate php files, and i want my $_POSt["fname"] To go into both of them, For Example:Goto: http://ucp.south-westrp.com/UCP.phpType Username: Comptons_Eazy_EAnd Password:
Querying info from one table based on info in another
Hi, I am currently trying to make a part for my user driven website where one user can subscribe to another and whoever they have subscribed to is echoed back on there profile page. my users table
How to generate a text file using php...?
Hi, Can anyone give me code to generate a text file using phpThanks in advance