(Parte de index donde muestra la imagen y descripcion de los videos)
Index.php
Código PHP:
<?php require("functions.php"); ?>
<?php require("simplepie.inc"); ?>
<?php
$pageUrl = "http://gdata.youtube.com/feeds/videos";
$pageSiz = 10;
$pageQue = getVariable($_GET["query"], "edgarel1");
$pageNum = getVariable($_GET["page"], 1);
$pageIni = $pageNum*$pageSiz-9;
$pageEnd = $pageUrl."?vq=".urlencode($pageQue)."&start-index=".$pageIni."&max-results=".$pageSiz."&alt=rss";
$vfeed = new SimplePie();
$vfeed->feed_url($pageEnd);
$vfeed->init();
$vfeed->handle_content_type();
$vmax = $vfeed->get_item_quantity();
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>SpryTube: Busca y descarga videos Youtube</title>
<meta name="description" content="Buscador de videos Youtube, visualiza y descarga videos de YouTube sin instalaciones adicionales." />
<meta name="keywords" content="youtube, videos, descarga, unijimpe, spry, download" />
<script type="text/javascript" src="includes/swfobject.js"></script>
<script type="text/javascript" src="includes/functions.js"></script>
<script type="text/javascript" src="js/mootools.js"></script>
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript" src="js/videobox.js"></script>
<script type="text/javascript">
var vartag = "<?php echo $pageQue; ?>";
var varpag = <?php echo $pageNum; ?>;
</script>
<link href="/styles.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/videobox.css" type="text/css" media="screen" />
</head>
<body>
<table width="840" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="840" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="38%" class="title"><img src="images/logo.gif" width="116" height="58" hspace="10"></td>
<td width="62%" align="right" class="title" style="padding-right:10px;">
<input name="criterio" type="text" id="criterio" value="<?php echo $pageQue; ?>" size="60">
<input name="Submit" type="button" class="boton" value="Buscar..." onClick="getVideo();" ></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"><table width="840" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="232" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="16"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
<tr>
<td align="center"><div class="borde" id="txtresult">Resultados de la búsqueda de <span id="query"><?php echo $pageQue; ?></span></div></td>
</tr>
<tr>
<td align="center"><div class="imgvideo">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php
for ($x = 0; $x < $vmax; $x++) {
$vitem = $vfeed->get_item($x);
$video = getVideoid($vitem->get_id());
?>
<tr>
<td height="10" colspan="2" valign="top"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
<tr spry:repeat="dsYouTube">
<td width="30%" valign="top"><img src="http://img.youtube.com/vi/<?php echo $video; ?>/2.jpg" width="134" height="97" hspace="16" border="0" style="cursor:pointer;"><br>
<br></td>
<td width="70%" class="lista">
<a href="http://www.youtube.com/watch?v=<?php echo $video; ?>" rel="vidbox" title="<?php echo feed2txt($vitem->get_description()); ?>"><?php echo $vitem->get_title(); ?></a><br><?php echo $vitem->get_title(); ?></a><br>
<span class="urlweb"><?php echo $vitem->get_id(); ?></span><br>
<?php echo feed2txt($vitem->get_description()); ?><br>
<li><a href="DYT.php?v=<?php echo $video; ?>&t=13"><img src="imgs/3gp.jpg" alt="Descargar en 3GP" width="20" height="20" border="0"> Descargar en 3GP</a></li>
<li><a href="DYT.php?v=<?php echo $video; ?>&t=18"><img src="imgs/mp4.jpg" alt="Descargar en MP4" width="20" height="20" border="0"> Descargar en MP4</a></li>
<li><a href="DYT.php?v=<?php echo $video; ?>&t=5"><img src="imgs/flv.jpg" alt="Descargar en FLV" width="20" height="20" border="0"> Descargar en FLV</a></li> <br>
<br></td>
</tr>
<?php } ?>
</table>
</div></td>
</tr>
<tr>
<td height="10"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
<tr>
<td align="center"><div class="borde" id="div"><a href="javascript:pagVideo(-1);">« anterior</a> Página <span id="pagnum"><?php echo $pageNum; ?></span> <a href="javascript:pagVideo(1);">siguiente »</a></div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="10"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
</table>
<div spry:region="dsYouTube" style="visibility:hidden;" id="readData"></div> </td>
<td width="328" align="center" valign="top" class="lista">
<div id="swfvideo" style="text-align:center;">
[COLOR="Blue"]<iframe src="Iframe.php; width=450 height=300 name="interno"></iframe>.[/COLOR]
<br>
<br>
<br> <br> <br> <br> Seleccione un video para reproducir.<span class="namedet" id="namedet"> </span></div>
Iframe.php
Código PHP:
<object width="500" height="320">
<param name="movie" value="http://www.youtube.com/v/<?php echo $video?>&autoplay=1">
</param>
<param name="allowFullScreen" value="true">
</param>
<embed src="http://www.youtube.com/v/<?php echo $video?>&autoplay=1" type="application/x-shockwave-flash" allowfullscreen="true" width="500" height="320"> </embed>
</object>