channel.php 783 B

1234567891011121314151617181920212223242526
  1. <?php
  2. require( __DIR__ . '/inc/common.php' );
  3. // Get the video id from URL.
  4. // Such as "UCHDm-DKoMyJxKVgwGmuTaQA"
  5. $channel_id = @$_GET['id'];
  6. $page = ( isset( $_GET['page'] ) && is_numeric( $_GET['page'] ) ) ? intval( $_GET['page'] ) : 1;
  7. $templates = new League\Plates\Engine( 'themes/' . $config['theme'] );
  8. if ( strlen( $channel_id ) == 24 ) {
  9. $channel = new \Vioscope\Channel( $channel_id, $page );
  10. echo $templates->render( 'channel', array(
  11. 'info' => array_merge( $channel->info, array(
  12. 'page' => $page,
  13. 'next_page_url' => $channel->get_change_page_url(true),
  14. 'previous_page_url' => $channel->get_change_page_url(false),
  15. ) ),
  16. 'config' => $config,
  17. ) );
  18. } else {
  19. echo $templates->render( 'channel', array(
  20. 'error' => 'No valid channel id provided'
  21. ) );
  22. }