summaryrefslogtreecommitdiffstats
path: root/common/custom/views
diff options
context:
space:
mode:
Diffstat (limited to 'common/custom/views')
-rwxr-xr-xcommon/custom/views/archive/footer.tpl.php3
-rw-r--r--common/custom/views/archive/head.tpl.php6
-rwxr-xr-xcommon/custom/views/archive/index.tpl.php114
-rwxr-xr-xcommon/custom/views/archive/sidebar.tpl.php34
-rw-r--r--common/custom/views/archive/top.tpl.php4
-rwxr-xr-xcommon/custom/views/default/footer.tpl.php3
-rw-r--r--common/custom/views/default/head.tpl.php3
-rwxr-xr-xcommon/custom/views/default/index.tpl.php73
-rwxr-xr-xcommon/custom/views/default/sidebar.tpl.php34
-rw-r--r--common/custom/views/default/top.tpl.php3
10 files changed, 277 insertions, 0 deletions
diff --git a/common/custom/views/archive/footer.tpl.php b/common/custom/views/archive/footer.tpl.php
new file mode 100755
index 0000000..bfc0210
--- /dev/null
+++ b/common/custom/views/archive/footer.tpl.php
@@ -0,0 +1,3 @@
+ <div id="footer">
+ <p><? echo str_replace('%s', 'href="http://moonmoon.org"', _g('Powered by <a %s>moonmoon</a>'))?> | <a href="./admin/"><?=_g('Administration')?></a></p>
+ </div>
diff --git a/common/custom/views/archive/head.tpl.php b/common/custom/views/archive/head.tpl.php
new file mode 100644
index 0000000..005a75d
--- /dev/null
+++ b/common/custom/views/archive/head.tpl.php
@@ -0,0 +1,6 @@
+ <link rel="stylesheet" media="screen" type="text/css" href="custom/style/default.css" title="Default" />
+ <link rel="stylesheet" media="screen" type="text/css" href="custom/style/green.css" title="Green" />
+ <link rel="stylesheet" media="screen" type="text/css" href="custom/style/light.css" title="Light" />
+ <link rel="stylesheet" media="screen" type="text/css" href="custom/style/dark.css" title="Dark" />
+
+ <link rel="alternate" type="application/atom+xml" title="ATOM" href="atom.php" />
diff --git a/common/custom/views/archive/index.tpl.php b/common/custom/views/archive/index.tpl.php
new file mode 100755
index 0000000..2bb8f36
--- /dev/null
+++ b/common/custom/views/archive/index.tpl.php
@@ -0,0 +1,114 @@
+<?php
+$count = 0;
+$today = Array();
+$week = Array();
+$month = Array();
+$older = Array();
+$now = time();
+
+foreach ($items as $item) {
+ $age = ($now - $item->get_date('U')) / (60*60*24);
+ if ($age < 1) {
+ $today[] = $item;
+ } elseif ($age < 7) {
+ $week[] = $item;
+ } elseif ($age < 30) {
+ $month[] = $item;
+ } else {
+ $older[] = $item;
+ }
+}
+
+header('Content-type: text/html; charset=UTF-8');
+?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$conf['locale']?>" lang="<?=$conf['locale']?>">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+
+ <title><?php echo $PlanetConfig->getName(); ?></title>
+ <?php include(dirname(__FILE__).'/head.tpl.php'); ?>
+</head>
+
+<body>
+ <div id="page">
+ <?php include(dirname(__FILE__).'/top.tpl.php'); ?>
+
+ <div id="content">
+ <?php if (0 == count($items)) :?>
+ <div class="article">
+ <h2 class="article-title">
+ <?=_g('No article')?>
+ </h2>
+ <p class="article-content"><?=_g('No news, good news.')?></p>
+ </div>
+ <?php endif; ?>
+ <?php if (count($today)): ?>
+ <div class="article">
+ <h2><?=_g('Today')?></h2>
+ <ul>
+ <?php foreach ($today as $item): ?>
+ <?php $feed = $item->get_feed(); ?>
+ <li>
+ <a href="<?php echo $feed->getWebsite() ?>" class="source"><?php echo $feed->getName() ?></a> :
+ <a href="<?php echo $item->get_permalink(); ?>" title="<?=_g('Go to original place')?>"><?php echo $item->get_title(); ?></a>
+ </li>
+ <?php endforeach; ?>
+ </ul>
+ </div>
+ <?php endif; ?>
+
+ <?php if (count($week)): ?>
+ <div class="article">
+ <h2><?=_g('This week')?></h2>
+ <ul>
+ <?php foreach ($week as $item): ?>
+ <?php $feed = $item->get_feed(); ?>
+ <li>
+ <a href="<?php echo $feed->getWebsite() ?>" class="source"><?php echo $feed->getName() ?></a> :
+ <a href="<?php echo $item->get_permalink(); ?>" title="<?=_g('Go to original place')?>"><?php echo $item->get_title(); ?></a>
+ </li>
+ <?php endforeach; ?>
+ </ul>
+ </div>
+ <?php endif; ?>
+
+ <?php if (count($month)): ?>
+ <div class="article">
+ <h2><?=_g('This month')?></h2>
+ <ul>
+ <?php foreach ($month as $item): ?>
+ <?php $feed = $item->get_feed(); ?>
+ <li>
+ <a href="<?php echo $feed->getWebsite() ?>" class="source"><?php echo $feed->getName() ?></a> :
+ <a href="<?php echo $item->get_permalink(); ?>" title="<?=_g('Go to original place')?>"><?php echo $item->get_title(); ?></a>
+ </li>
+ <?php endforeach; ?>
+ </ul>
+ </div>
+ <?php endif; ?>
+
+ <?php if (count($older)): ?>
+ <div class="article">
+ <h2><?=_g('Older items')?></h2>
+ <ul>
+ <?php foreach ($older as $item): ?>
+ <?php $feed = $item->get_feed(); ?>
+ <li>
+ <a href="<?php echo $feed->getWebsite() ?>" class="source"><?php echo $feed->getName() ?></a> :
+ <a href="<?php echo $item->get_permalink(); ?>" title="Go to original place"><?php echo $item->get_title(); ?></a>
+ </li>
+ <?php endforeach; ?>
+ </ul>
+ </div>
+ <?php endif; ?>
+ </div>
+
+ <?php include_once(dirname(__FILE__).'/sidebar.tpl.php'); ?>
+
+ <?php include(dirname(__FILE__).'/footer.tpl.php'); ?>
+ </div>
+</body>
+</html>
diff --git a/common/custom/views/archive/sidebar.tpl.php b/common/custom/views/archive/sidebar.tpl.php
new file mode 100755
index 0000000..e21f377
--- /dev/null
+++ b/common/custom/views/archive/sidebar.tpl.php
@@ -0,0 +1,34 @@
+<?php
+$all_people = &$Planet->getPeople();
+usort($all_people, array('PlanetFeed', 'compare'));
+?>
+<div id="sidebar">
+ <div id="sidebar-people">
+ <h2><?=_g('People')?> (<?php echo count($all_people); ?>)</h2>
+ <ul>
+ <?php foreach ($all_people as $person) : ?>
+ <li>
+ <a href="<?php echo htmlspecialchars($person->getFeed(), ENT_QUOTES, 'UTF-8'); ?>" title="<?=_g('Feed')?>"><img src="postload.php?url=<?php echo urlencode(htmlspecialchars($person->getFeed(), ENT_QUOTES, 'UTF-8')); ?>" alt="<?=_g('Feed')?>" height="12" width="12" /></a>
+ <a href="<?php echo $person->getWebsite(); ?>" title="<?=_g('Website')?>"><?php echo htmlspecialchars($person->getName(), ENT_QUOTES, 'UTF-8'); ?></a>
+ </li>
+ <?php endforeach; ?>
+ </ul>
+ <p>
+ <a href="custom/people.opml"><img src="custom/img/opml.png" alt="<?=_g('Feed')?>" height="12" width="12" />&nbsp;<?=_g('All feeds in OPML format')?></a>
+ </p>
+ </div>
+
+ <div>
+ <h2><?=_g('Syndicate')?></h2>
+ <ul>
+ <li><img src="custom/img/feed.png" alt="<?=_g('Feed')?>" height="12" width="12" />&nbsp;<a href="atom.php"><?=_g('Feed (ATOM)')?></a></li>
+ </ul>
+ </div>
+
+ <div>
+ <h2><?=_g('Archives')?></h2>
+ <ul>
+ <li><a href="?type=archive"><?=_g('See all headlines')?></a></li>
+ </ul>
+ </div>
+</div>
diff --git a/common/custom/views/archive/top.tpl.php b/common/custom/views/archive/top.tpl.php
new file mode 100644
index 0000000..7a818e1
--- /dev/null
+++ b/common/custom/views/archive/top.tpl.php
@@ -0,0 +1,4 @@
+ <div id="top">
+ <h1><a href="<?php echo $PlanetConfig->getUrl() ?>"><?php echo $PlanetConfig->getName(); ?></a></h1>
+ </div>
+ \ No newline at end of file
diff --git a/common/custom/views/default/footer.tpl.php b/common/custom/views/default/footer.tpl.php
new file mode 100755
index 0000000..bfc0210
--- /dev/null
+++ b/common/custom/views/default/footer.tpl.php
@@ -0,0 +1,3 @@
+ <div id="footer">
+ <p><? echo str_replace('%s', 'href="http://moonmoon.org"', _g('Powered by <a %s>moonmoon</a>'))?> | <a href="./admin/"><?=_g('Administration')?></a></p>
+ </div>
diff --git a/common/custom/views/default/head.tpl.php b/common/custom/views/default/head.tpl.php
new file mode 100644
index 0000000..5773aa6
--- /dev/null
+++ b/common/custom/views/default/head.tpl.php
@@ -0,0 +1,3 @@
+ <link rel="stylesheet" media="screen" type="text/css" href="custom/style/default.css" title="Default" />
+
+ <link rel="alternate" type="application/atom+xml" title="ATOM" href="atom.php" />
diff --git a/common/custom/views/default/index.tpl.php b/common/custom/views/default/index.tpl.php
new file mode 100755
index 0000000..1bf037a
--- /dev/null
+++ b/common/custom/views/default/index.tpl.php
@@ -0,0 +1,73 @@
+<?php
+$limit = $PlanetConfig->getMaxDisplay();
+$count = 0;
+
+header('Content-type: text/html; charset=UTF-8');
+?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$conf['locale']?>" lang="<?=$conf['locale']?>">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+
+ <title><?php echo $PlanetConfig->getName(); ?></title>
+ <?php include(dirname(__FILE__).'/head.tpl.php'); ?>
+</head>
+
+<body>
+ <script type="text/javascript">
+ document.body.className += 'js';
+ </script>
+ <div id="page">
+ <?php include(dirname(__FILE__).'/top.tpl.php'); ?>
+
+ <div id="content">
+ <?php if (0 == count($items)) : ?>
+ <div class="article">
+ <h2 class="article-title">
+ <?=_g('No article', 'note de trad')?>
+ </h2>
+ <p class="article-content"><?=_g('No news, good news.')?></p>
+ </div>
+ <?php else : ?>
+ <?php foreach ($items as $item): ?>
+ <?php
+ $arParsedUrl = parse_url($item->get_feed()->getWebsite());
+ $host = 'from-' . preg_replace('/[^a-zA-Z0-9]/i', '-', $arParsedUrl['host']);
+ ?>
+ <div class="article <?php echo $host; ?>">
+ <h2 class="article-title">
+ <a href="<?php echo $item->get_permalink(); ?>" title="Go to original place"><?php echo $item->get_title(); ?></a>
+ </h2>
+ <p class="article-info">
+
+ <?php echo ($item->get_author()? $item->get_author()->get_name() : 'Anonymous'); ?>,
+ <?php
+ $ago = time() - $item->get_date('U');
+ //echo '<span title="'.Duration::toString($ago).' ago" class="date">'.date('d/m/Y', $item->get_date('U')).'</span>';
+ echo '<span id="post'.$item->get_date('U').'" class="date">'.$item->get_date('d/m/Y').'</span>';
+ ?>
+
+ |
+
+ <?=_g('Source:')?> <?php
+ $feed = $item->get_feed();
+ echo '<a href="'.$feed->getWebsite().'" class="source">'.$feed->getName().'</a>';
+ ?>
+ </p>
+ <div class="article-content">
+ <?php echo $item->get_content(); ?>
+ </div>
+ </div>
+ <?php if (++$count == $limit) { break; } ?>
+ <?php endforeach; ?>
+ <?php endif; ?>
+ </div>
+
+ <?php include_once(dirname(__FILE__).'/sidebar.tpl.php'); ?>
+
+ <?php include(dirname(__FILE__).'/footer.tpl.php'); ?>
+ </div>
+</body>
+</html>
diff --git a/common/custom/views/default/sidebar.tpl.php b/common/custom/views/default/sidebar.tpl.php
new file mode 100755
index 0000000..830f3c6
--- /dev/null
+++ b/common/custom/views/default/sidebar.tpl.php
@@ -0,0 +1,34 @@
+<?php
+$all_people = &$Planet->getPeople();
+usort($all_people, array('PlanetFeed', 'compare'));
+?>
+<div id="sidebar" class="aside">
+ <div id="sidebar-people" class="section">
+ <h2><?php echo _g('People') . ' (' . count($all_people) . ')'?></h2>
+ <ul>
+ <?php foreach ($all_people as $person) : ?>
+ <li>
+ <a href="<?php echo htmlspecialchars($person->getFeed(), ENT_QUOTES, 'UTF-8'); ?>" title="<?=_g('Feed')?>"><img src="postload.php?url=<?php echo urlencode(htmlspecialchars($person->getFeed(), ENT_QUOTES, 'UTF-8')); ?>" alt="" height="12" width="12" /></a>
+ <a href="<?php echo $person->getWebsite(); ?>" title="<?=_g('Website')?>"><?php echo htmlspecialchars($person->getName(), ENT_QUOTES, 'UTF-8'); ?></a>
+ </li>
+ <?php endforeach; ?>
+ </ul>
+ <p>
+ <img src="custom/img/opml.png" alt="<?=_g('Feed')?>" height="12" width="12" /> <a href="custom/people.opml"><?=_g('All feeds in OPML format')?></a>
+ </p>
+ </div>
+
+ <div class="section">
+ <h2><?=_g('Syndicate')?></h2>
+ <ul>
+ <li><img src="custom/img/feed.png" alt="<?=_g('Feed')?>" height="12" width="12" />&nbsp;<a href="atom.php"><?=_g('Feed (ATOM)')?></a></li>
+ </ul>
+ </div>
+
+ <div class="section">
+ <h2><?=_g('Archives')?></h2>
+ <ul>
+ <li><a href="?type=archive"><?=_g('See all headlines')?></a></li>
+ </ul>
+ </div>
+</div>
diff --git a/common/custom/views/default/top.tpl.php b/common/custom/views/default/top.tpl.php
new file mode 100644
index 0000000..dd6206f
--- /dev/null
+++ b/common/custom/views/default/top.tpl.php
@@ -0,0 +1,3 @@
+ <div id="header">
+ <h1 id="top"><a href="<?php echo $PlanetConfig->getUrl() ?>"><?php echo $PlanetConfig->getName(); ?></a></h1>
+ </div> \ No newline at end of file