Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $page_num = 1;
- if(isset($_GET['page']){
- $page_num = urlencode($_GET['page']);
- }
- $id = urlencode($_GET['id']);
- $url = "https://gdata.youtube.com/feeds/api/playlists/$id?alt=jsonc&v=2&start-index={$page_num}
- &max-results=50";
- $content = file_get_contents($url);
- $json = json_decode($content, true);
- echo "<div id=\"info\"><center><h1><b>{$json['data']['title']}</center></b></h1><br>{$json['data']['description']} there are {$json['data']['totalItems']} uploaded in this playlist.</center><p></div><div class=\"decoration\"></div>";
- echo "<div id=\"center\">";
- echo "<ul>";
- $count = 0;
- foreach ($json['data']['items'] as $items) {
- ++$count;
- echo "<li style=\"width: 300px;min-height: auto;border: none;display: inline-block;margin: 5px;padding:10px;background-color: rgba(17,0,52,0.14);border-radius: 5px;\"><a href=\"video.php?plid={$json['data']['id']}&vidid={$items['video']['id']}\"><font size=\"5\" style=\"font-weight:bold;\">{$items['video']['title']}</font></a><Br \>";
- echo "<a href=\"video.php?plid={$json['data']['id']}&vidid={$items['video']['id']}\"><img style=\"width:300;height:auto;\" src=\"{$items['video']['thumbnail']['hqDefault']}\" title=\"{$items['video']['title']}\" id=\"ytThumb\"></img></a></li>";
- }
- echo "</ul>";
- echo "</div>";
- if($count == 50){
- echo "<a href='thispage.php?id=$id&startindex={$page_num}'>Get More Results...</a>"
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement