<?
include_once('classes/dbayar.php');
$baglan = mysql_connect($dbhost,$dbkullanici,$dbsifre);
mysql_select_db($dbadi,$baglan);
mysql_query("SET NAMES 'UTF-8'");
mysql_query("SET CHARACTER SET UTF-8");
mysql_query("SET COLLATION_CONNECTION = 'UTF-8'");
class Youtube
{
var $dom, $idvideo, $title, $video;
function videoTitle()
{
return $this->title;
}
function pagination()
{
return true;
}
function tag($tag, $page = 1)
{
if ($page <= 0) $page = 1;
$start = ($page-1)*10 + 1;
$tag = str_replace(' ', '+', $tag);
$feed = ('http://gdata.youtube.com/feeds/api/videos?vq='.$tag.'&start-index='.$start.'&max-results=10&orderby=updated&alt=rss');
$this->dom = getFeed($feed);
}
function video($id)
{
$this->idvideo = $id;
$feed = ("http://gdata.youtube.com/feeds/api/videos/".$id);
$this->dom = getFeed($feed);
$this->video = $this->dom->getElementsByTagName('entry')->item(0);
$this->title = $this->video->getElementsByTagName('title')->item(0)->textContent;
}
function player()
{
?>
<object width="425" height="355">
<param name="movie" value="http://www.youtube.com/v/<?=$this->idvideo?>" />
<param name="wmode" value="transparent" />
<embed src="http://www.youtube.com/v/<?=$this->idvideo?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed>
</object>
<?
}
function view($tag)
{
$videos = $this->dom->getElementsByTagName('item');
foreach ($videos as $video)
{
$id = $video->getElementsByTagName('guid')->item(0)->textContent;
$id = explode('/', $id);
$id = $id[6];
echo '<p class="links"><a href="'.BASE_URL.'/0/video/'.$tag.'/'.$id.'.html">Video izle</a>';
echo '<div class="video">';
echo '<FORM action=/ok.php
method=post><input type=hidden name=ix value=1><INPUT class=button type=submit value=VideoEkle name=send_button>';
$title = $video->getElementsByTagName("title")->item(0)->textContent;
echo ' video : <input name="adi" class="field" id="adi"
style="WIDTH: 200px; HEIGHT: 20px" value="'.$title.'" size="40" />';echo '<td width="84" align="left"><b> Kategori :</b></td>
<td width="136"><select name="kategori" id="kategori">';
$isimx="select * from wp_term_taxonomy where taxonomy='category'";
$sorgu=mysql_query($isimx);
while($veri = mysql_fetch_array($sorgu))
{
$q2=mysql_query("Select * from wp_terms where term_id='$veri[term_id]'");
$r2=mysql_fetch_array($q2);
$nos=$c['term_taxonomy_id'];
$nos2=$c['name'];
echo "<option value=$veri[term_taxonomy_id]>$r2[name]</option>";
}
echo '</select>';
echo ' <td width="84" align="left"><b> Kullanici (sec):</b></td>
<td width="136"><select name="user" id="user">';
$katsec="select * from wp_users";
$katbul=mysql_query($katsec);
while($veri = mysql_fetch_array($katbul))
{
$q2=mysql_query("Select * from wp_users");
$r2=mysql_fetch_array($q2);
echo "<option value=$veri[ID]>$veri[user_login]</option>";
}
echo '</select>';
$fotos = $video->getElementsByTagNameNS("http://search.yahoo.com/mrss/", "thumbnail");
$tiempo = $video->getElementsByTagNameNS("http://gdata.youtube.com/schemas/2007", "duration");
$tiempo = $tiempo->item(0)->getAttribute("seconds");
$i = 0;
echo '<div class="img">';
foreach ($fotos as $foto)
{
$url1 = $foto->getAttribute("url");
echo '<input type=hidden name="resim" class="field" id="resim"
style="WIDTH: 200px; HEIGHT: 20px" value="'.$url1.'" size="10" />';
$i++;
if ($i > 2) break;
}
echo '</div>';
echo '<img src="'.$url1.'" alt="'.$title.'"/>';
echo '<br />';
echo '<div class="tags">'; echo 'Etiketler: ';
echo '<input name="tago" class="field" id="tago"
style="WIDTH: 300px; HEIGHT: 260px" value="'.cut($video->getElementsByTagName("keywords")->item(0)->textContent).'" size="10" />';
$tags1 = $video->getElementsByTagName("category");
echo '<br />';
echo '<textarea class="field" type=hidden style="WIDTH: 0; HEIGHT: 0" name="kod" rows="5" cols="40" id="kod"><object width="300" height="260"><param name="movie" value="http://www.youtube.com/v/'.$id.'"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'.$id.'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" height="260"></embed></object> </textarea>';
echo '</div>';
echo '</div>';
echo '</Form>';
}
}
}
?> Kod sorunu
1
●469
- 18-04-2010, 22:38:59Üyeliği durdurulduArkadaşlar elimde bir youtube botu var bot güzel çekiyor ancak çektiği videonun thumb resmini degil de konuda, direk videoyu gösteriyor...Ama videonun embed koduna baktığım zaman küçük thumb resim url sini de vermiş kod olarak....ftp ye resimleri de çekmiş....Ben bu küçük resimleri sitede nasıl gösterebilirim? Yani resimlere tıklayınca açılacak sayfada video olacak şekilde....Aşağıdaki yotube bot sayfa kodlarıdır..Sistem wordpress entegrelidir.... yardımcı olacak arkadaşlara teşekkürler....