diff options
Diffstat (limited to 'custom/views')
-rw-r--r-- | custom/views/archive/footer.tpl.php | 3 | ||||
-rw-r--r-- | custom/views/archive/head.tpl.php | 6 | ||||
-rw-r--r-- | custom/views/archive/index.tpl.php | 116 | ||||
-rw-r--r-- | custom/views/archive/sidebar.tpl.php | 34 | ||||
-rw-r--r-- | custom/views/archive/top.tpl.php | 3 | ||||
-rw-r--r-- | custom/views/atom10/index.tpl.php | 29 | ||||
-rw-r--r-- | custom/views/default/footer.tpl.php | 3 | ||||
-rw-r--r-- | custom/views/default/head.tpl.php | 3 | ||||
-rw-r--r-- | custom/views/default/index.tpl.php | 75 | ||||
-rw-r--r-- | custom/views/default/sidebar.tpl.php | 34 | ||||
-rw-r--r-- | custom/views/default/top.tpl.php | 3 | ||||
-rw-r--r-- | custom/views/rss10/index.tpl.php | 49 |
12 files changed, 358 insertions, 0 deletions
diff --git a/custom/views/archive/footer.tpl.php b/custom/views/archive/footer.tpl.php new file mode 100644 index 0000000..5b27882 --- /dev/null +++ b/custom/views/archive/footer.tpl.php @@ -0,0 +1,3 @@ + <div id="footer"> + <p>Powered by <a href="http://moonmoon.org/">moonmoon</a> | <a href="./admin/">Administration</a></p> + </div>
\ No newline at end of file diff --git a/custom/views/archive/head.tpl.php b/custom/views/archive/head.tpl.php new file mode 100644 index 0000000..03f99ae --- /dev/null +++ b/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="?type=atom10" /> diff --git a/custom/views/archive/index.tpl.php b/custom/views/archive/index.tpl.php new file mode 100644 index 0000000..9a02c2f --- /dev/null +++ b/custom/views/archive/index.tpl.php @@ -0,0 +1,116 @@ +<?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="en" lang="en">
+<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"> + No article + </h2> + <p class="article-content">No news, good news.</p> + </div> + <?php endif; ?> + <?php if (count($today)): ?> + <div class="article"> + <h2>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="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>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="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>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="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>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>
+
+ <script src="app/js/mm.js" type="text/javascript"></script>
+</body>
+</html>
diff --git a/custom/views/archive/sidebar.tpl.php b/custom/views/archive/sidebar.tpl.php new file mode 100644 index 0000000..32b51a1 --- /dev/null +++ b/custom/views/archive/sidebar.tpl.php @@ -0,0 +1,34 @@ +<?php +$all_people = &$Planet->getPeople(); +usort($all_people, array('PlanetPerson', 'compare')); +?> +<div id="sidebar"> + <div id="sidebar-people"> + <h2>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="Feed"><img src="postload.php?url=<?php echo urlencode(htmlspecialchars($person->getFeed(), ENT_QUOTES, 'UTF-8')); ?>" alt="feed" height="12" width="12" /></a> + <a href="<?php echo $person->getWebsite(); ?>" title="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="feed" height="12" width="12" /> All feeds in OPML format</a> + </p> + </div> + + <div> + <h2>Syndicate</h2> + <ul> + <li><img src="custom/img/feed.png" alt="feed" height="12" width="12" /> <a href="?type=atom10">Feed (ATOM)</a></li> + </ul> + </div> + + <div> + <h2>Archives</h2> + <ul> + <li><a href="?type=archive">See all headlines</a></li> + </ul> + </div> +</div>
\ No newline at end of file diff --git a/custom/views/archive/top.tpl.php b/custom/views/archive/top.tpl.php new file mode 100644 index 0000000..9533c15 --- /dev/null +++ b/custom/views/archive/top.tpl.php @@ -0,0 +1,3 @@ + <div id="top"> + <h1><a href="./index.php"><?php echo $PlanetConfig->getName(); ?></a></h1> + </div>
\ No newline at end of file diff --git a/custom/views/atom10/index.tpl.php b/custom/views/atom10/index.tpl.php new file mode 100644 index 0000000..96b467a --- /dev/null +++ b/custom/views/atom10/index.tpl.php @@ -0,0 +1,29 @@ +<?php
+$limit = $PlanetConfig->getMaxDisplay();
+$count = 0; + +header('Content-Type: text/plain; charset=UTF-8'); +echo '<?xml version="1.0" encoding="UTF-8" ?>';
+?><feed xmlns="http://www.w3.org/2005/Atom">
+ <title><?php echo $PlanetConfig->getName(); ?></title>
+ <subtitle></subtitle>
+ <id><?php echo $PlanetConfig->getUrl(); ?></id>
+ <link rel="self" type="text/html" href="<?php echo $PlanetConfig->getUrl(); ?>?type=atom10" />
+ <link rel="alternate" type="text/html" href="<?php echo $PlanetConfig->getUrl(); ?>" />
+ <updated><?php echo date("Y-m-d\TH:i:s\Z") ?></updated>
+ <author><name>Author</name></author>
+
+ <?php $count = 0; ?>
+ <?php foreach ($items as $item): ?>
+ <entry xmlns="http://www.w3.org/2005/Atom">
+ <title type="html"><?php echo htmlspecialchars($item->get_feed()->getName()); ?> : <?php echo htmlspecialchars($item->get_title());?></title>
+ <id><?php echo htmlspecialchars($item->get_permalink());?></id>
+ <link rel="alternate" href="<?php echo htmlspecialchars($item->get_permalink());?>"/>
+ <published><?php echo $item->get_date('Y-m-d\\TH:i:s+00:00'); ?></published>
+ <author><name><?php echo ($item->get_author()? $item->get_author()->get_name() : 'anonymous'); ?></name></author>
+
+ <content type="html"><![CDATA[<?php echo $item->get_content();?>]]></content>
+ </entry>
+ <?php if (++$count == $limit) { break; } ?>
+ <?php endforeach; ?>
+</feed>
\ No newline at end of file diff --git a/custom/views/default/footer.tpl.php b/custom/views/default/footer.tpl.php new file mode 100644 index 0000000..5b27882 --- /dev/null +++ b/custom/views/default/footer.tpl.php @@ -0,0 +1,3 @@ + <div id="footer"> + <p>Powered by <a href="http://moonmoon.org/">moonmoon</a> | <a href="./admin/">Administration</a></p> + </div>
\ No newline at end of file diff --git a/custom/views/default/head.tpl.php b/custom/views/default/head.tpl.php new file mode 100644 index 0000000..6e204fe --- /dev/null +++ b/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="?type=atom10" /> diff --git a/custom/views/default/index.tpl.php b/custom/views/default/index.tpl.php new file mode 100644 index 0000000..70e23c4 --- /dev/null +++ b/custom/views/default/index.tpl.php @@ -0,0 +1,75 @@ +<?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="en" lang="en">
+<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"> + No article + </h2> + <p class="article-content">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>';
+ ?> + + | + + 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>
+
+ <script src="app/js/mm.js" type="text/javascript"></script>
+</body>
+</html>
diff --git a/custom/views/default/sidebar.tpl.php b/custom/views/default/sidebar.tpl.php new file mode 100644 index 0000000..07de920 --- /dev/null +++ b/custom/views/default/sidebar.tpl.php @@ -0,0 +1,34 @@ +<?php +$all_people = &$Planet->getPeople(); +usort($all_people, array('PlanetPerson', 'compare')); +?> +<div id="sidebar" class="aside"> + <div id="sidebar-people" class="section"> + <h2>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="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="Website"><?php echo htmlspecialchars($person->getName(), ENT_QUOTES, 'UTF-8'); ?></a> + </li> + <?php endforeach; ?> + </ul> + <p> + <img src="custom/img/opml.png" alt="feed" height="12" width="12" /> <a href="custom/people.opml">All feeds in OPML format</a> + </p> + </div> + + <div class="section"> + <h2>Syndicate</h2> + <ul> + <li><img src="custom/img/feed.png" alt="feed" height="12" width="12" /> <a href="?type=atom10">Feed (ATOM)</a></li> + </ul> + </div> + + <div class="section"> + <h2>Archives</h2> + <ul> + <li><a href="?type=archive">See all headlines</a></li> + </ul> + </div> +</div>
\ No newline at end of file diff --git a/custom/views/default/top.tpl.php b/custom/views/default/top.tpl.php new file mode 100644 index 0000000..e0ea5b9 --- /dev/null +++ b/custom/views/default/top.tpl.php @@ -0,0 +1,3 @@ + <div id="header"> + <h1 id="top"><a href="./index.php"><?php echo $PlanetConfig->getName(); ?></a></h1> + </div>
\ No newline at end of file diff --git a/custom/views/rss10/index.tpl.php b/custom/views/rss10/index.tpl.php new file mode 100644 index 0000000..7d07196 --- /dev/null +++ b/custom/views/rss10/index.tpl.php @@ -0,0 +1,49 @@ +<?php
+$limit = $PlanetConfig->getMaxDisplay();
+$count = 0; + +header('Content-Type: text/xml; charset=UTF-8'); +echo '<?xml version="1.0" encoding="UTF-8" ?>';
+?><rdf:RDF
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
+ xmlns:admin="http://webns.net/mvcb/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
+ xmlns="http://purl.org/rss/1.0/">
+
+ <channel rdf:about="<?php echo $PlanetConfig->getUrl(); ?>">
+ <title><?php echo $PlanetConfig->getName(); ?></title>
+ <description></description>
+ <link><?php echo $PlanetConfig->getUrl(); ?></link>
+ <dc:language></dc:language>
+ <dc:creator></dc:creator>
+ <dc:rights></dc:rights>
+ <dc:date><?php echo date('Y-m-d\\TH:i:s+00:00'); ?></dc:date>
+ <admin:generatorAgent rdf:resource="http://moonmoon.inertie.org/" />
+
+ <items>
+ <rdf:Seq>
+ <?php foreach ($items as $item): ?>
+ <rdf:li rdf:resource="<?php echo $item->get_permalink(); ?>"/>
+ <?php if (++$count == $limit) { break; } ?>
+ <?php endforeach; ?>
+ </rdf:Seq>
+ </items>
+ </channel>
+
+ <?php $count = 0; ?>
+ <?php foreach ($items as $item): ?>
+ <item rdf:about="<?php echo $item->get_permalink();?>">
+ <title><?php echo htmlspecialchars($item->get_feed()->getName()) ?> : <?php echo htmlspecialchars($item->get_title());?></title>
+ <link><?php echo htmlspecialchars($item->get_permalink());?></link>
+ <dc:date><?php echo date('Y-m-d\\TH:i:s+00:00',$item->get_date('U')); ?></dc:date>
+ <dc:creator><?php echo htmlspecialchars($item->get_author()? $item->get_author()->get_name() : 'anonymous') ?></dc:creator>
+ <description><?php echo htmlspecialchars($item->get_content()); ?></description>
+ <content:encoded><![CDATA[<?php echo $item->get_content();?>]]></content:encoded>
+ </item>
+ <?php if (++$count == $limit) { break; } ?>
+ <?php endforeach; ?>
+
+</rdf:RDF>
\ No newline at end of file |