search.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php $this->layout( 'layout', [
  2. 'body_class' => 'search-page',
  3. 'info' => $info,
  4. 'config' => $config,
  5. ] ) ?>
  6. <?php if ( ! $error ) : ?>
  7. <h2 class="page-heading">Search for &quot;<?=$this->e( @$_GET['q'] )?>&quot;</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 video">
  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. <div class="entry channel">
  24. <a href="<?=$this->e( $entry['channel_url'] )?>">
  25. <img src="<?=$this->e( $entry['channel_thumbnail_url'] )?>" />
  26. </a>
  27. <p class="author">
  28. <a href="<?=$this->e( $entry['channel_url'] )?>"><?=$this->e( $entry['channel_name'] )?></a>
  29. </p>
  30. <p class="sub-count"><?=$this->e( $entry['subscriber_count'] )?></p>
  31. <p class="video-count"><?=$this->e( $entry['video_count'] )?> publishes</p>
  32. </div>
  33. <?php endif; ?>
  34. <?php endforeach; ?>
  35. </div>
  36. <div class="page-navigation">
  37. <div class="left element">
  38. <?php if ( $info['previous_page_url'] ) : ?>
  39. <a href="<?=$this->e( $info['previous_page_url'] )?>">&laquo; Previous page</a>
  40. <?php endif; ?>
  41. </div>
  42. <div class="right element">
  43. <?php if ( $info['next_page_url'] ) : ?>
  44. <a href="<?=$this->e( $info['next_page_url'] )?>">Next page &raquo;</a>
  45. <?php endif; ?>
  46. </div>
  47. </div>
  48. <?php endif; ?>
  49. <?php else : ?>
  50. <div class="error msg">Error: <?=$this->e($error)?></div>
  51. <?php endif; ?>