normal_view.phtml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <?php
  2. $this->partial ('aside_flux');
  3. $this->partial ('nav_menu');
  4. if (!empty($this->entries)) {
  5. ?>
  6. <div id="stream" class="normal<?php echo $this->conf->displayPosts () === 'no' ? ' hide_posts' : ''; ?>">
  7. <?php
  8. $display_today = true;
  9. $display_yesterday = true;
  10. $display_others = true;
  11. $logged = !login_is_conf ($this->conf) || is_logged ();
  12. $shaarli = $this->conf->sharing ('shaarli');
  13. $poche = $this->conf->sharing ('poche');
  14. $diaspora = $this->conf->sharing ('diaspora');
  15. $twitter = $this->conf->sharing ('twitter');
  16. $google_plus = $this->conf->sharing ('g+');
  17. $facebook = $this->conf->sharing ('facebook');
  18. $email = $this->conf->sharing ('email');
  19. $print = $this->conf->sharing ('print');
  20. ?>
  21. <?php foreach ($this->entries as $item) { ?>
  22. <?php if ($display_today && $item->isDay (FreshRSS_Days::TODAY)) { ?>
  23. <div class="day" id="day_today">
  24. <?php echo Minz_Translate::t ('today'); ?>
  25. <span class="date"> - <?php echo timestamptodate (time (), false); ?></span>
  26. <span class="name"><?php echo $this->currentName; ?></span>
  27. </div>
  28. <?php $display_today = false; } ?>
  29. <?php if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY)) { ?>
  30. <div class="day" id="day_yesterday">
  31. <?php echo Minz_Translate::t ('yesterday'); ?>
  32. <span class="date"> - <?php echo timestamptodate (time () - 86400, false); ?></span>
  33. <span class="name"><?php echo $this->currentName; ?></span>
  34. </div>
  35. <?php $display_yesterday = false; } ?>
  36. <?php if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY)) { ?>
  37. <div class="day" id="day_before_yesterday">
  38. <?php echo Minz_Translate::t ('before_yesterday'); ?>
  39. <span class="name"><?php echo $this->currentName; ?></span>
  40. </div>
  41. <?php $display_others = false; } ?>
  42. <div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>">
  43. <ul class="horizontal-list flux_header"><?php
  44. if (!login_is_conf ($this->conf) || is_logged ()) {
  45. if ($this->conf->toplineRead ()) {
  46. ?><li class="item manage"><?php
  47. ?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php
  48. echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
  49. ?></li><?php
  50. }
  51. if ($this->conf->toplineFavorite ()) {
  52. ?><li class="item manage"><?php
  53. ?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php
  54. echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
  55. ?></li><?php
  56. }
  57. }
  58. $feed = HelperCategory::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache
  59. if (empty($feed)) $feed = $item->feed (true);
  60. ?>
  61. <li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li>
  62. <li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li>
  63. <?php if ($this->conf->toplineDate ()) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
  64. <?php if ($this->conf->toplineLink ()) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?>
  65. </ul>
  66. <div class="flux_content">
  67. <div class="content">
  68. <h1 class="title"><?php echo $item->title (); ?></h1>
  69. <?php
  70. $author = $item->author ();
  71. echo $author != '' ? '<div class="author">' . Minz_Translate::t ('by_author', $author) . '</div>' : '';
  72. if($this->conf->lazyload() == 'yes') {
  73. echo lazyimg($item->content ());
  74. } else {
  75. echo $item->content();
  76. }
  77. ?>
  78. </div>
  79. <ul class="horizontal-list bottom"><?php
  80. if (!login_is_conf ($this->conf) || is_logged ()) {
  81. if ($this->conf->bottomlineRead ()) {
  82. ?><li class="item manage"><?php
  83. ?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php
  84. echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
  85. ?></li><?php
  86. }
  87. if ($this->conf->bottomlineFavorite ()) {
  88. ?><li class="item manage"><?php
  89. ?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php
  90. echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
  91. ?></li><?php
  92. }
  93. } ?>
  94. <li class="item">
  95. <?php
  96. if ($this->conf->bottomlineSharing () && (
  97. $shaarli || $poche || $diaspora || $twitter ||
  98. $google_plus || $facebook || $email
  99. )) {
  100. $link = urlencode ($item->link ());
  101. $title = urlencode ($item->title () . ' - ' . $feed->name ());
  102. ?>
  103. <div class="dropdown">
  104. <div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div>
  105. <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>">
  106. <?php echo FreshRSS_Themes::icon('share'); ?>
  107. <?php echo Minz_Translate::t ('share'); ?>
  108. </a>
  109. <ul class="dropdown-menu">
  110. <li class="dropdown-close"><a href="#close">❌</a></li>
  111. <?php if ($logged && $shaarli) { ?>
  112. <li class="item">
  113. <a target="_blank" href="<?php echo $shaarli . '?post=' . $link . '&amp;title=' . $title . '&amp;source=FreshRSS'; ?>">
  114. <?php echo Minz_Translate::t ('shaarli'); ?>
  115. </a>
  116. </li>
  117. <?php } if ($logged && $poche) { ?>
  118. <li class="item">
  119. <a target="_blank" href="<?php echo $poche . '?action=add&amp;url=' . base64_encode (urldecode($link)); ?>">
  120. <?php echo Minz_Translate::t ('poche'); ?>
  121. </a>
  122. </li>
  123. <?php } if ($logged && $diaspora) { ?>
  124. <li class="item">
  125. <a target="_blank" href="<?php echo $diaspora . '/bookmarklet?url=' . $link . '&amp;title=' . $title; ?>">
  126. <?php echo Minz_Translate::t ('diaspora'); ?>
  127. </a>
  128. </li>
  129. <?php } if ($twitter) { ?>
  130. <li class="item">
  131. <a target="_blank" href="https://twitter.com/share?url=<?php echo $link; ?>&amp;text=<?php echo $title; ?>">
  132. <?php echo Minz_Translate::t ('twitter'); ?>
  133. </a>
  134. </li>
  135. <?php } if ($google_plus) { ?>
  136. <li class="item">
  137. <a target="_blank" href="https://plus.google.com/share?url=<?php echo $link; ?>">
  138. <?php echo Minz_Translate::t ('g+'); ?>
  139. </a>
  140. </li>
  141. <?php } if ($facebook) { ?>
  142. <li class="item">
  143. <a target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo $link; ?>&amp;t=<?php echo $title; ?>">
  144. <?php echo Minz_Translate::t ('facebook'); ?>
  145. </a>
  146. </li>
  147. <?php } if ($email) { ?>
  148. <li class="item">
  149. <a href="mailto:?subject=<?php echo urldecode($title); ?>&amp;body=<?php echo $link; ?>">
  150. <?php echo Minz_Translate::t ('by_email'); ?>
  151. </a>
  152. </li>
  153. <?php } if ($print) { ?>
  154. <li class="item">
  155. <a href="#" class="print-article">
  156. <?php echo Minz_Translate::t ('print'); ?>
  157. </a>
  158. </li>
  159. <?php } ?>
  160. </ul>
  161. </div>
  162. <?php } ?>
  163. </li>
  164. <?php
  165. $tags = $this->conf->bottomlineTags () ? $item->tags() : null;
  166. if (!empty($tags)) {
  167. ?>
  168. <li class="item">
  169. <div class="dropdown">
  170. <div id="dropdown-tags-<?php echo $item->id ();?>" class="dropdown-target"></div>
  171. <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>">
  172. <?php echo FreshRSS_Themes::icon('tag'); ?>
  173. <?php echo Minz_Translate::t ('related_tags'); ?>
  174. </a>
  175. <ul class="dropdown-menu">
  176. <li class="dropdown-close"><a href="#close">❌</a></li>
  177. <?php foreach($tags as $tag) { ?>
  178. <li class="item"><a href="<?php echo _url ('index', 'index', 'search', urlencode ('#' . $tag)); ?>"><?php echo $tag; ?></a></li>
  179. <?php } ?>
  180. </ul>
  181. </div>
  182. </li>
  183. <?php } ?>
  184. <?php if ($this->conf->bottomlineDate ()) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
  185. <?php if ($this->conf->bottomlineLink ()) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?>
  186. </ul>
  187. </div>
  188. </div>
  189. <?php } ?>
  190. <?php $this->renderHelper('pagination'); ?>
  191. </div>
  192. <?php $this->partial ('nav_entries'); ?>
  193. <?php } else { ?>
  194. <div id="stream" class="alert alert-warn normal">
  195. <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span>
  196. </div>
  197. <?php } ?>