function ShowVideoGallery($dataid, $time = "", $local = "-") { $url = ytapi . 'standardfeeds/'; if ($local == "-") { $url .= ytpos; } else { if (strlen($local) > 0) { $url .= $local . '/'; } } $url .= $dataid; if (strlen($time) > 0) { $url .= "?time=" . $time; } $xml = xml_load2($url); if ($xml != NULL) { vg_head(); foreach ($xml->entry as $entry) { $media = $entry->children('http://search.yahoo.com/mrss/'); ob_start(); print_r($media); $checking = ob_get_contents(); ob_end_clean(); if (hasBadKey($checking)) { //out_bad(); } else { $yt = $media->children('http://gdata.youtube.com/schemas/2007'); $gd = $entry->children('http://schemas.google.com/g/2005'); $title = $media->group->title; $author = $entry->author->name; $description = $media->group->description; ob_start(); echo $media->group->category; $category = ob_get_contents(); ob_end_clean(); $attrs = $media->group->player->attributes(); $id = $attrs['url']; $id = substr(stristr($id, "v="), 2, 11); $attrs = $media->group->thumbnail[0]->attributes(); $thumbnail = $attrs['url']; $thumbnail = 'https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=' . urlencode($thumbnail) . '&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*'; //$thumbnail = 'lib/ytp.php?'.(str_replace("ytimg","yx_x",str_replace("/","|",$thumbnail))); $attrs = $yt->duration->attributes(); $length = $attrs['seconds']; $attrs = $yt->statistics->attributes(); $viewCount = "0"; @($viewCount = $attrs['viewCount']); if ($gd->rating) { $attrs = $gd->rating->attributes(); $rating = $attrs['average']; $rating = substr($rating, 0, 3); } else { $rating = 0; } vg_out($id, $title, $author, $description, $length / 60, $rating, $viewCount, $category, $thumbnail); } } vg_end(); } else { echo '<b><a href="http://code.google.com/p/youtubeindex/">NGSY</a>_FAILED:LOAD_VIDEO_LIST</b><br>Please contact laobubu@gmail.com'; } }
?> <div class="miniTitle"><?php echo Comments; ?> </div> <div id="comments_jar">Loading comments...</div> <script language="JavaScript">jumpcommentpage(1);</script><br> <div class="miniTitle"><?php echo PostComments; ?> </div> <div><iframe src="http://ng.laobubu.net/lib/postComment.php?v=<?php echo $ID; ?> " width="630" height="75" frameborder="0">Need IFrame</iframe></div><br> <div class="miniTitle"><?php echo RelatedVideos; ?> </div> <?php vg_head(); for ($i = 0; $i < count($relatedvideo); $i++) { vg_out($relatedvideo[$i][0], $relatedvideo[$i][1], $relatedvideo[$i][2], $relatedvideo[$i][3], $relatedvideo[$i][4], $relatedvideo[$i][5], $relatedvideo[$i][6], $relatedvideo[$i][7], $relatedvideo[$i][8]); } vg_end(); ?> </td> </tr> </table> <?php include THEME_PATH . "/footer.php";