video.php 476 B

123456789101112131415161718
  1. <?php
  2. require_once( __DIR__ . '/inc/common.php' );
  3. // Get the video id from URL.
  4. // Such as "C0DPdy98e4c"
  5. $video_id = @$_GET['v'];
  6. $templates = new League\Plates\Engine( 'themes/' . $config['theme'] );
  7. if ( strlen( $video_id ) == 11 ) {
  8. $video = new \Vioscope\Video( $video_id );
  9. echo $templates->render( 'video', array( 'info' => $video->info, 'config' => $config ) );
  10. } else {
  11. echo $templates->render( 'video', array(
  12. 'error' => 'No valid video id provided'
  13. ) );
  14. }