view.html.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. $this->styles($this->html->style('view'));
  3. ?>
  4. <h2 class="ribbon full"><?= $anime->title ?></h2>
  5. <div class="triangle-ribbon"></div>
  6. <br class="cl">
  7. <aside id="img">
  8. <img src="<?=$anime->image ?>" alt="<?= $anime->title ?>">
  9. </aside>
  10. <section id="info"><p>
  11. <?php if(isset($anime->foreign_titles)):
  12. $str = '<b>Foreign titles:</b>';
  13. for ($i = 0; $i < count($anime->foreign_titles); $i++) {
  14. if ($i > 0) $str .= '<b>,</b>';
  15. $str .= ' ' . $anime->foreign_titles[$i];
  16. }
  17. $str .= '<br>';
  18. ?>
  19. <?= $str ?>
  20. <?php endif; ?>
  21. <?php if(isset($anime->alternative_titles)):
  22. $str = '<b>Alternative titles:</b>';
  23. for ($i = 0; $i < count($anime->alternative_titles); $i++) {
  24. if ($i > 0) $str .= '<b>,</b>';
  25. $str .= ' ' . $anime->alternative_titles[$i];
  26. }
  27. $str .= '<br>';
  28. ?>
  29. <?= $str ?>
  30. <?php endif; ?>
  31. <b>Type:</b> <?= $anime->view_type ?><br>
  32. <b>Episodes:</b> <?= $anime->episode_count ?><br>
  33. <b>Aired:</b> <?= $anime->aired ?><br>
  34. <b>Producers:</b> <?php
  35. $str = '';
  36. for ($i = 0; $i < count($anime->producers); $i++) {
  37. if ($i > 0) $str .= ',';
  38. $str .= ' <a href="/producer/view/' . $anime->producers[$i] . '">' . $anime->producers[$i] . '</a>';
  39. } ?><?= $str ?><br>
  40. <b>Genres:</b> <?php
  41. $str = '';
  42. for ($i = 0; $i < count($anime->genres); $i++) {
  43. if ($i > 0) $str .= ',';
  44. $str .= ' <a href="/genre/view/' . $anime->genres[$i] . '">' . $anime->genres[$i] . '</a>';
  45. } ?><?= $str ?><br>
  46. <b>Duration:</b> <?= $anime->episode_duration ?><br>
  47. <b>Rating:</b> <?= $anime->rated ?><br>
  48. <b>Related:</b> <?php
  49. $str = '';
  50. $keys = array_keys($related);
  51. for ($i = 0; $i < count($keys); $i++) {
  52. if ($i > 0) $str .= ',';
  53. $str .= ' <a href="/anime/view/' . $related[$keys[$i]] . '">' . $keys[$i] . '</a>';
  54. } ?><?= $str ?>
  55. </p>
  56. </section>
  57. <aside id="malstats">
  58. <h2>MAL Stats</h2>
  59. <p>
  60. <b>Score:</b> <?= $anime->mal_score ?><br>
  61. <b>Votes:</b> <?= $anime->mal_score_voted ?><br>
  62. <b>Ranked:</b> <?= $anime->mal_rank ?><br>
  63. <b>Popularity:</b> <?= $anime->mal_popularity ?><br>
  64. <b>Members:</b> <?= $anime->mal_score ?>
  65. </p>
  66. </aside>
  67. <?php if (count($anime->cast) > 1): // why is this 1? ?>
  68. <section id="cast">
  69. <p>
  70. <a href="/anime/cast/<?= $anime->special_id ?>" onclick="return toggleCast()">Cast &#x2193;</a>
  71. </p>
  72. <table>
  73. <?php for ($i = 0; $i < count($anime->cast); $i++): ?>
  74. <tr<? if ($i > 0) echo ' class="char"' ?>>
  75. <td colspan="3">
  76. <?= $anime->cast[$i]->character ?>
  77. </td>
  78. </tr>
  79. <?php if (isset($anime->cast[$i]->people)): ?>
  80. <?php foreach($anime->cast[$i]->people as $actor): ?>
  81. <tr>
  82. <td></td>
  83. <td><?= $actor->name ?></td>
  84. <td><?= $actor->language ?></td>
  85. </tr>
  86. <?php endforeach; ?>
  87. <?php endif; ?>
  88. <?php endfor; ?>
  89. </table>
  90. <br>
  91. <p id="castlink">
  92. <a href="" onclick="return toggleCast()">Cast &#x2191;</a>
  93. </p>
  94. </section>
  95. <?php endif; ?>
  96. <br class="cl">
  97. <h2 class="ribbon">Synopsis</h2>
  98. <div class="triangle-ribbon"></div>
  99. <br class="cl">
  100. <p><?= $anime->synopsis ?></p>