<? $q = $_POST['q']; $w = $_GET['w']; $a = $_GET['a']; if($q){ $q = ereg_replace('[[:space:]]+', '/', trim($q)); $old=array("þ","þ","Ð","Ð","Ý","Ý","Ç","Ç","Ö","Ö", "'" ); $new=array("s","s","g","g","i","i","c","c","o","o" ," " ); //$q = str_replace( $old, $new, $q ); $i = 100; if(!$_GET['p']) $_GET['p']=1; $start=((intval($_GET['p'])-1)*50)+1; $feedURL = "http://gdata.youtube.com/feeds/api/videos?vq=".urlencode($q)."&orderby=rating&start-index=".$start; // read feed into SimpleXML object $sxml = @simplexml_load_file(($feedURL)); //$sxml = mb_convert_encoding((string) $sxml , 'UTF-8' , 'ISO-8859-9'); // get summary counts from opensearch: namespace $counts = @$sxml->children('http://a9.com/-/spec/opensearchrss/1.0/'); $total = $counts->totalResults; $startOffset = $counts->startIndex; $endOffset = ($startOffset-1) + $counts->itemsPerPage; // echo '<ul class="results">'; $i=1; foreach ($sxml->entry as $entry) { // get nodes in media: namespace for media information $media = $entry->children('http://search.yahoo.com/mrss/'); // get video player URL $attrs = $media->group->player->attributes(); $watch = $attrs['url']; $watch=str_replace('http://www.youtube.com/watch?v=','index.php?w=',$watch); $kod1=str_replace('index.php?w=','',$watch); $kod=str_replace('&feature=youtube_gdata','',$kod1); $kod=str_replace('_player','',$kod); // get video thumbnail $attrs = $media->group->thumbnail[0]->attributes(); $thumbnail = $attrs['url']; // get <yt:duration> node for video length $yt = $media->children('http://gdata.youtube.com/schemas/2007'); $attrs = $yt->duration->attributes(); $length = $attrs['seconds']; $mins = floor ($length / 60); $secs = $length % 60; // get <gd:rating> node for video ratings $gd = $entry->children('http://schemas.google.com/g/2005'); if ($gd->rating) { $attrs = $gd->rating->attributes(); $rating = @$attrs['average']; } else { $rating = 0; } $hepsi=$_SESSION['userid']; ?> ვერადა ვერ მივხვდი რა მაქვს შეცდომა