items)) {
foreach ($get_videos_->items as $key => $video) {
$thumb = PT_GetMedia('upload/photos/thumbnail.jpg');
if (!empty($video->snippet->thumbnails->maxres->url)) {
$thumb = $video->snippet->thumbnails->maxres->url;
} else if (!empty($video->snippet->thumbnails->medium->url)) {
$thumb = $video->snippet->thumbnails->medium->url;
}
$tags = '';
if (!empty($video->snippet->tags)) {
if (is_array($video->snippet->tags)) {
$tags_array = array();
$tag_count = 0;
foreach ($video->snippet->tags as $key => $tag) {
if ($tag_count < 11) {
$tags_array[] = $tag;
}
$tag_count++;
}
$tags = implode(',', $tags_array);
}
}
$duration = '00:00';
if (!empty(covtime($video->contentDetails->duration))) {
$duration = covtime($video->contentDetails->duration);
}
$array_data = array(
'ID' => $video->id,
'TITLE' => $video->snippet->title,
'DESC' => $video->snippet->description,
'THUMB' => $thumb,
'TAGS' => $tags,
'DURATION' => $duration
);
echo PT_LoadAdminPage('import-from-youtube/list', $array_data);
}
} else {
echo '
No videos found
';
}
?>
items)) { ?>