Want more features on Pastebin? Sign Up, it's FREE!

YouTube Playlist

By: Streamingdb-net on Oct 11th, 2011  |  syntax: PHP  |  size: 0.83 KB  |  views: 81  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. $videos = get_post_meta($post->ID, "youtube", true);
  3.   if ($videos != "")
  4.   {
  5.     echo '<div id="playlist">';
  6.     echo '<div class="s_playlist">';
  7.     echo '<div id="playlist_t">PLAYLIST <strong>1</strong></div>';
  8.     echo '<div class="cdiv"></div>';
  9.     echo '</div>';
  10.     echo '<div class="description">';
  11.     echo '<ul>';
  12.     $videos = nl2br($videos);
  13.     $videos = explode("<br />", $videos);
  14.     foreach ($videos as $video)
  15.     {
  16.      // preleva ID video dopo la "v="
  17.     $url = $video; parse_str(parse_url($url, PHP_URL_QUERY ));
  18.     // output del video
  19.     echo '<li><a href="#" onclick="openYouTube(\''.$v.'\')">1</a></li>';
  20.     }
  21.     echo '<div id="bg" class="popup_bg"></div>';
  22.     echo '</ul>';
  23.     echo '<div class="cdiv">';
  24.     echo '</div>';
  25.     echo '<br>';
  26.     echo '</div>';
  27.     echo '</div>';
  28.   }
  29. ?>
clone this paste RAW Paste Data