Guest User

Untitled

a guest
Nov 18th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <?php
  2. $whole = explode("?",$_SERVER['REQUEST_URI']);
  3. $p = explode("/",$whole[0]);
  4. parse_str($whole[1], $_GET);
  5. array_shift($p);/*
  6. //demo:
  7. if($p[0] == '1a'){
  8. echo "1a";
  9. array_shift($p);
  10. if($p[0] == '2a'){
  11. echo '2a';
  12. array_shift($p);
  13. if($p[0] == '3a'){
  14. echo '3a';
  15. }
  16. }
  17. if($p[0] == '2b'){
  18. echo '2b';
  19. array_shift($p);
  20. }
  21. }*/
  22. if($p[0] == 'watch'){
  23. include('youtube.php');
  24. $id = $_GET['v'];
  25. $seconds = getYoutubeDurationInSeconds($id);
  26. if($seconds <= 0){die("error id");}
  27. $snippet= getYoutubeSnippet($id);
  28. $var['title'] = $snippet['title'];
  29. $format = ($seconds > 60*60)?"H:i:s":"i:s";
  30. $var['scale']['start']='00:00';
  31. $var['scale']['end']=gmdate($format, floor($seconds * 5 / 5));
  32. $var['related']=getRelatedVideos($id);
  33.  
  34. //render('template/watch',$var);
  35. include('view.php');
  36. exit;
  37. }
  38. exit;
Add Comment
Please, Sign In to add comment