diff options
author | Damien Lallement <dams@mageia.org> | 2012-08-13 10:45:23 +0000 |
---|---|---|
committer | Damien Lallement <dams@mageia.org> | 2012-08-13 10:45:23 +0000 |
commit | ff32e499745367b816d10f25e63ff3328214c32f (patch) | |
tree | 238d19398f5951d69d32c8ed9a460f5193446981 /common/custom/views/archive | |
parent | 5bed2fb79d7b554dd90d2eb58422cfa649aebe08 (diff) | |
download | planet-ff32e499745367b816d10f25e63ff3328214c32f.tar planet-ff32e499745367b816d10f25e63ff3328214c32f.tar.gz planet-ff32e499745367b816d10f25e63ff3328214c32f.tar.bz2 planet-ff32e499745367b816d10f25e63ff3328214c32f.tar.xz planet-ff32e499745367b816d10f25e63ff3328214c32f.zip |
- Import moonmoon
- Create repo per langs
Diffstat (limited to 'common/custom/views/archive')
-rwxr-xr-x | common/custom/views/archive/footer.tpl.php | 3 | ||||
-rw-r--r-- | common/custom/views/archive/head.tpl.php | 6 | ||||
-rwxr-xr-x | common/custom/views/archive/index.tpl.php | 114 | ||||
-rwxr-xr-x | common/custom/views/archive/sidebar.tpl.php | 34 | ||||
-rw-r--r-- | common/custom/views/archive/top.tpl.php | 4 |
5 files changed, 161 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" /> <?=_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" /> <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 |