/[web]/planet/common/custom/views/archive/index.tpl.php
ViewVC logotype

Contents of /planet/common/custom/views/archive/index.tpl.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1619 - (show annotations) (download)
Mon Aug 13 10:45:23 2012 UTC (11 years, 7 months ago) by dams
File size: 4264 byte(s)
- Import moonmoon
- Create repo per langs

1 <?php
2 $count = 0;
3 $today = Array();
4 $week = Array();
5 $month = Array();
6 $older = Array();
7 $now = time();
8
9 foreach ($items as $item) {
10 $age = ($now - $item->get_date('U')) / (60*60*24);
11 if ($age < 1) {
12 $today[] = $item;
13 } elseif ($age < 7) {
14 $week[] = $item;
15 } elseif ($age < 30) {
16 $month[] = $item;
17 } else {
18 $older[] = $item;
19 }
20 }
21
22 header('Content-type: text/html; charset=UTF-8');
23 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
24 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
25 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$conf['locale']?>" lang="<?=$conf['locale']?>">
26 <head>
27 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
28 <meta http-equiv="Content-Script-Type" content="text/javascript" />
29 <meta http-equiv="Content-Style-Type" content="text/css" />
30
31 <title><?php echo $PlanetConfig->getName(); ?></title>
32 <?php include(dirname(__FILE__).'/head.tpl.php'); ?>
33 </head>
34
35 <body>
36 <div id="page">
37 <?php include(dirname(__FILE__).'/top.tpl.php'); ?>
38
39 <div id="content">
40 <?php if (0 == count($items)) :?>
41 <div class="article">
42 <h2 class="article-title">
43 <?=_g('No article')?>
44 </h2>
45 <p class="article-content"><?=_g('No news, good news.')?></p>
46 </div>
47 <?php endif; ?>
48 <?php if (count($today)): ?>
49 <div class="article">
50 <h2><?=_g('Today')?></h2>
51 <ul>
52 <?php foreach ($today as $item): ?>
53 <?php $feed = $item->get_feed(); ?>
54 <li>
55 <a href="<?php echo $feed->getWebsite() ?>" class="source"><?php echo $feed->getName() ?></a> :
56 <a href="<?php echo $item->get_permalink(); ?>" title="<?=_g('Go to original place')?>"><?php echo $item->get_title(); ?></a>
57 </li>
58 <?php endforeach; ?>
59 </ul>
60 </div>
61 <?php endif; ?>
62
63 <?php if (count($week)): ?>
64 <div class="article">
65 <h2><?=_g('This week')?></h2>
66 <ul>
67 <?php foreach ($week as $item): ?>
68 <?php $feed = $item->get_feed(); ?>
69 <li>
70 <a href="<?php echo $feed->getWebsite() ?>" class="source"><?php echo $feed->getName() ?></a> :
71 <a href="<?php echo $item->get_permalink(); ?>" title="<?=_g('Go to original place')?>"><?php echo $item->get_title(); ?></a>
72 </li>
73 <?php endforeach; ?>
74 </ul>
75 </div>
76 <?php endif; ?>
77
78 <?php if (count($month)): ?>
79 <div class="article">
80 <h2><?=_g('This month')?></h2>
81 <ul>
82 <?php foreach ($month as $item): ?>
83 <?php $feed = $item->get_feed(); ?>
84 <li>
85 <a href="<?php echo $feed->getWebsite() ?>" class="source"><?php echo $feed->getName() ?></a> :
86 <a href="<?php echo $item->get_permalink(); ?>" title="<?=_g('Go to original place')?>"><?php echo $item->get_title(); ?></a>
87 </li>
88 <?php endforeach; ?>
89 </ul>
90 </div>
91 <?php endif; ?>
92
93 <?php if (count($older)): ?>
94 <div class="article">
95 <h2><?=_g('Older items')?></h2>
96 <ul>
97 <?php foreach ($older as $item): ?>
98 <?php $feed = $item->get_feed(); ?>
99 <li>
100 <a href="<?php echo $feed->getWebsite() ?>" class="source"><?php echo $feed->getName() ?></a> :
101 <a href="<?php echo $item->get_permalink(); ?>" title="Go to original place"><?php echo $item->get_title(); ?></a>
102 </li>
103 <?php endforeach; ?>
104 </ul>
105 </div>
106 <?php endif; ?>
107 </div>
108
109 <?php include_once(dirname(__FILE__).'/sidebar.tpl.php'); ?>
110
111 <?php include(dirname(__FILE__).'/footer.tpl.php'); ?>
112 </div>
113 </body>
114 </html>

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.30