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
Logging and nologging bulk insert
Hi,
Writing to the middle of a file
Hi I have a bit of a problem. Is there any way i can write some text to a middle of a text file. For instance on line 20? I know how to write text to the bottom of the file but not how i can get it to
Uploading/Downloading files stored in MySQL database
Hey all,This problem just came up in my website and I'm having a hard time figuring out what's wrong. I have a intranet portal running (custom built) and I'm storing all different types of documents
How do I create a 2D game "camera" to follow player?
In J2ME programming I'm targeting MIDP 2.0 devices.I'm using gamecanvas and I was thinking that I could create my full world (640 x 480) using a TiledLayer and then set the refpixel of the TilerLayer
Retrieving innerHTML with cURL?
Hey all (sorry I know I'm a leecher, but I soon won't be. This is my first PHP project, but not my last ).I need help with a little problem I am having. I am using cURL to navigate through some pages
Concatenate two strings ???
I have string one $string1 and another $string2.How to concatenate (add) both of them $string1+" "+$string2 also check condition for the total string length not more than 100 characters
Need help-Error istream header declaration
Hi Everyone ,I am having issue with istream declaration. I am new to C programming.can any one please help me ?I am getting error in getNameValuePair.h and getNameValuePair.C code.Here below the
disable all input buttons
Hello Friends,suppose i do have a file ( file.php ) has a submit buttonCode: [Select]<input type=submit name=add value=go> is there any way so i can make the button shown but in same
Writing Windows Device Drivers with C
Yes: one of the nice features of C is void*. You can put anything there and get anything out. Very error prone but absolutely brilliant for device drivers.Try
help need on ob_start()
HiI am a newbie in php, I have a codeLine number On/Off | Expand/Contract <?phpob_start();for($i=1;$i<=10;$i++){ sleep(1); echo $i; ob_flush();}?> I am trying to