normal.phtml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. $this->partial('aside_feed');
  3. $this->partial('nav_menu');
  4. if (!empty($this->entries)) {
  5. $display_today = true;
  6. $display_yesterday = true;
  7. $display_others = true;
  8. $hidePosts = !FreshRSS_Context::$conf->display_posts;
  9. $lazyload = FreshRSS_Context::$conf->lazyload;
  10. $content_width = FreshRSS_Context::$conf->content_width;
  11. $today = @strtotime('today');
  12. ?>
  13. <div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php
  14. ?><div id="new-article">
  15. <a href="<?php echo Minz_Url::display(Minz_Request::currentRequest()); ?>"><?php echo _t('new_article'); ?></a>
  16. </div><?php
  17. foreach ($this->entries as $item) {
  18. $this->entry = Minz_ExtensionManager::callHook('entry_before_display', $item);
  19. if (is_null($this->entry)) {
  20. continue;
  21. }
  22. if ($display_today && $this->entry->isDay(FreshRSS_Days::TODAY, $today)) {
  23. ?><div class="day" id="day_today"><?php
  24. echo _t('today');
  25. ?><span class="date"> — <?php echo timestamptodate(time(), false); ?></span><?php
  26. ?><span class="name"><?php echo FreshRSS_Context::$name; ?></span><?php
  27. ?></div><?php
  28. $display_today = false;
  29. }
  30. if ($display_yesterday && $this->entry->isDay(FreshRSS_Days::YESTERDAY, $today)) {
  31. ?><div class="day" id="day_yesterday"><?php
  32. echo _t('yesterday');
  33. ?><span class="date"> — <?php echo timestamptodate(time() - 86400, false); ?></span><?php
  34. ?><span class="name"><?php echo FreshRSS_Context::$name; ?></span><?php
  35. ?></div><?php
  36. $display_yesterday = false;
  37. }
  38. if ($display_others && $this->entry->isDay(FreshRSS_Days::BEFORE_YESTERDAY, $today)) {
  39. ?><div class="day" id="day_before_yesterday"><?php
  40. echo _t('before_yesterday');
  41. ?><span class="name"><?php echo FreshRSS_Context::$name; ?></span><?php
  42. ?></div><?php
  43. $display_others = false;
  44. }
  45. ?><div class="flux<?php echo !$this->entry->isRead() ? ' not_read' : ''; ?><?php echo $this->entry->isFavorite() ? ' favorite' : ''; ?>" id="flux_<?php echo $this->entry->id(); ?>"><?php
  46. $this->renderHelper('index/normal/entry_header');
  47. ?><div class="flux_content">
  48. <div class="content <?php echo $content_width; ?>">
  49. <h1 class="title"><a target="_blank" href="<?php echo $this->entry->link(); ?>"><?php echo $this->entry->title(); ?></a></h1>
  50. <?php
  51. $author = $this->entry->author();
  52. echo $author != '' ? '<div class="author">' . _t('by_author', $author) . '</div>' : '',
  53. $lazyload && $hidePosts ? lazyimg($this->entry->content()) : $this->entry->content();
  54. ?>
  55. </div><?php
  56. $this->renderHelper('index/normal/entry_bottom');
  57. ?></div>
  58. </div><?php
  59. }
  60. $this->renderHelper('pagination');
  61. ?></div>
  62. <?php $this->partial('nav_entries'); ?>
  63. <?php } else { ?>
  64. <div id="stream" class="prompt alert alert-warn normal">
  65. <h2><?php echo _t('no_feed_to_display'); ?></h2>
  66. <a href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('think_to_add'); ?></a><br /><br />
  67. </div>
  68. <?php } ?>