trending.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php $this->layout( 'layout', [
  2. 'body_class' => 'trending-page',
  3. 'info' => $info,
  4. 'config' => $config,
  5. ] ) ?>
  6. <?php if ( ! $error ) : ?>
  7. <h2 class="page-heading"><?=$this->e( $info['title'] )?></h2>
  8. <?php if ( count( $entries > 0 ) ) : ?>
  9. <div class="entries thumbnails">
  10. <?php foreach( $entries as $entry ) : ?>
  11. <?php if ( $entry['item_type'] == 'video' ) : ?>
  12. <div class="entry">
  13. <a title="<?=$this->e( $entry['description'] )?>" href="<?=$this->e( $entry['video_url'] )?>">
  14. <img src="<?=$this->e( $entry['thumbnail_url'] )?>" />
  15. </a>
  16. <p class="title">
  17. <a title="<?=$this->e( $entry['description'] )?>" href="<?=$this->e( $entry['video_url'] )?>"><?=$this->e( $entry['title'] )?></a>
  18. </p>
  19. <p class="author"><a href="<?=$this->e( $entry['author_url'] )?>"><?=$this->e( $entry['author_name'] )?></a></p>
  20. </a>
  21. </div>
  22. <?php elseif ( $entry['item_type'] == 'channel' ) : ?>
  23. <a class="entry" href="<?=$this->e( $entry['channel_url'] )?>">
  24. <img src="<?=$this->e( $entry['channel_thumbnail_url'] )?>" />
  25. <span class="title"><?=$this->e( $entry['channel_name'] )?></span>
  26. <span class="sub-count"><?=$this->e( $entry['subscriber_count'] )?></span>
  27. <span class="video-count"><?=$this->e( $entry['video_count'] )?> publishes</span>
  28. </a>
  29. <?php endif; ?>
  30. <?php endforeach; ?>
  31. </div>
  32. <?php else: ?>
  33. <div class="error msg">Error: 0 entries found</div>
  34. <?php endif; ?>
  35. <?php else : ?>
  36. <div class="error msg">Error: <?=$this->e($error)?></div>
  37. <?php endif; ?>