diff options
author | Maurice Svay <maurice@svay.com> | 2010-02-16 15:23:41 +0000 |
---|---|---|
committer | Maurice Svay <maurice@svay.com> | 2010-02-16 15:23:41 +0000 |
commit | ec4326e4bab52c558d1f2564ab2fa0545f81b071 (patch) | |
tree | 2c7b9d1bd5a1ee72be2e40e4b45895877777aefe /custom | |
download | planet-ec4326e4bab52c558d1f2564ab2fa0545f81b071.tar planet-ec4326e4bab52c558d1f2564ab2fa0545f81b071.tar.gz planet-ec4326e4bab52c558d1f2564ab2fa0545f81b071.tar.bz2 planet-ec4326e4bab52c558d1f2564ab2fa0545f81b071.tar.xz planet-ec4326e4bab52c558d1f2564ab2fa0545f81b071.zip |
Initial commit
Diffstat (limited to 'custom')
-rw-r--r-- | custom/config.yml | 10 | ||||
-rw-r--r-- | custom/img/feed.png | bin | 0 -> 484 bytes | |||
-rw-r--r-- | custom/img/opml.png | bin | 0 -> 31542 bytes | |||
-rw-r--r-- | custom/people.opml | 10 | ||||
-rw-r--r-- | custom/style/dark.css | 125 | ||||
-rw-r--r-- | custom/style/default.css | 128 | ||||
-rw-r--r-- | custom/style/green.css | 132 | ||||
-rw-r--r-- | custom/style/light.css | 124 | ||||
-rw-r--r-- | custom/style/mobile.css | 8 | ||||
-rw-r--r-- | custom/views.php | 24 | ||||
-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 |
22 files changed, 919 insertions, 0 deletions
diff --git a/custom/config.yml b/custom/config.yml new file mode 100644 index 0000000..54b2e90 --- /dev/null +++ b/custom/config.yml @@ -0,0 +1,10 @@ +--- +url: http://example.com/ +name: Untitled +items: 10 +shuffle: 0 +refresh: 240 +cache: 10 +nohtml: 0 +postmaxlength: 0 +cachedir: ./cache diff --git a/custom/img/feed.png b/custom/img/feed.png Binary files differnew file mode 100644 index 0000000..f8cd243 --- /dev/null +++ b/custom/img/feed.png diff --git a/custom/img/opml.png b/custom/img/opml.png Binary files differnew file mode 100644 index 0000000..7a9d86f --- /dev/null +++ b/custom/img/opml.png diff --git a/custom/people.opml b/custom/people.opml new file mode 100644 index 0000000..2ea977c --- /dev/null +++ b/custom/people.opml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<opml version="1.1"> +<head> +<title>Untitled</title> +<dateCreated>2008-12-14T15:51:52+01:00</dateCreated> +<dateModified>2008-12-14T15:51:52+01:00</dateModified> +</head> +<body> +</body> +</opml>
\ No newline at end of file diff --git a/custom/style/dark.css b/custom/style/dark.css new file mode 100644 index 0000000..1ee004b --- /dev/null +++ b/custom/style/dark.css @@ -0,0 +1,125 @@ +html{ + font-family: Arial, sans-serif; + color: #FFF; + background: #333; + font-size: 62.5%; +} + +body{ + margin: 0; + padding: 0; + font-size: 1.1em; + line-height: 1.5em; +} + +a{ + color: #CCC; +} + +a:visited{ + color: #AAA; +} + +a:hover{ + color: #FFF; +} + +a img{ + border: none; +} + +pre, code{ + font-size: 1.2em; +} +/* Top +*******************************************************************************/ +#page{ + width: 640px; + margin: 0 auto; +} +/* Top +*******************************************************************************/ +#top{ + padding: 2%; + margin: 3em; + line-height: 2em; + color: #FFF; + text-align: center; +} + + #top h1{ + margin: 0; + letter-spacing: -1px; + font-family: Georgia, serif; + } + +/* Top +*******************************************************************************/ +#content{ + width: 66%; + padding: 0 2%; + margin: 0; + float: right; +} + +.post{ + margin-bottom: 3em; +} + +.post-title, .post-title a{ + font-family: Georgia, serif; + color: #CCC; + text-decoration: none; +} + +.post-title{ + padding-bottom: 0.5em; + border-bottom: 1px solid #444; +} + +.post-info{ + color: #999; + margin-top: -1em; +} + +.post-info a{ + color: #999; + text-decoration : none; +} + +/* Top +*******************************************************************************/ +#sidebar{ + width: 26%; + padding: 0 2%; + margin: 0; + float: left; +} + + #sidebar div{ + font-size: 0.8em; + } + + #sidebar h2{ + font-family: Georgia, serif; + color: #999; + } + + #sidebar a{ + text-decoration: none; + } + + #sidebar ul{ + margin: 0; + padding: 0; + list-style: none; + } + +/* Footer +*******************************************************************************/ +#footer{ + padding: 1ex 1em; + clear: both; + border-top: 1px solid #444; + color: #999; +}
\ No newline at end of file diff --git a/custom/style/default.css b/custom/style/default.css new file mode 100644 index 0000000..2095ff1 --- /dev/null +++ b/custom/style/default.css @@ -0,0 +1,128 @@ +html{
+ font-family: "Lucida Grande", "Segoe UI", sans-serif;
+ color: #111;
+ background: #EEE;
+ font-size: 62.5%;
+}
+
+body{
+ margin: 0;
+ padding: 0;
+ font-size: 1.3em;
+ line-height: 1.5em;
+}
+
+a{
+ color: #669;
+}
+
+a:visited{
+ color: #444;
+}
+
+a:hover{
+ color: #000;
+}
+
+a img{
+ border: none;
+}
+
+pre, code{ + max-height: 100%; + width: 100%;
+ font-size: 1.2em; + overflow: auto;
+}
+
+h1, h2{
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+}
+
+h2{
+ margin: 0;
+}
+
+#page {
+ width: 890px;
+ margin: 0 auto;
+}
+ +/* Header +*******************************************************************************/
+#top {
+ color: #FFF;
+ padding: 10px 30px;
+} + h1 a, + h1 a:visited { + color: #665; + text-decoration: none; + } + h1 a:hover { + color: #444; + }
+ +/* Content +*******************************************************************************/
+#content {
+ width: 590px;
+ float: left;
+}
+ +/* Sidebar +*******************************************************************************/
+#sidebar {
+ width: 300px;
+ float: left;
+}
+ #sidebar div {
+ padding: 1em 30px;
+ } + #sidebar h2 { + color: #665; + }
+ #sidebar ul {
+ list-style: none;
+ padding: 0;
+ margin: 1em 0;
+ }
+
+/* Article +*******************************************************************************/
+.article{
+ margin-bottom: 2em;
+ padding: 30px;
+ background: #FFF;
+ border: 1px solid #DDD;
+}
+
+ .article-title,
+ .article-title a{
+ color: #111;
+ text-decoration: none;
+ }
+
+ .article-info{
+ margin: 0 0 1em 0;
+ color: #999;
+ } + + .article-content { + font-family: Georgia, serif; + }
+
+ .article img{
+ max-width: 440px;
+ }
+
+ .article .collapsed{
+ display: none;
+ } + +/* Footer +*******************************************************************************/ +#footer { + clear: both; + padding: 0 30px; +}
\ No newline at end of file diff --git a/custom/style/green.css b/custom/style/green.css new file mode 100644 index 0000000..d665bd8 --- /dev/null +++ b/custom/style/green.css @@ -0,0 +1,132 @@ +html{ + font-family: "Lucida Grande", Tahoma, sans-serif; + color: #333; + background: #DFC; + font-size: 62.5%; +} + +body{ + margin: 0; + padding: 0; + font-size: 1.1em; + line-height: 1.5em; +} + +a{ + color: #669; +} + +a:visited{ + color: #444; +} + +a:hover{ + color: #000; +} + +a img{ + border: none; +} + +pre, code{ + font-size: 1.2em; +} +/* Top +*******************************************************************************/ +#page{ + width: 60em; + margin: 0 auto; + background: #FFF; +} +/* Top +*******************************************************************************/ +#top{ + padding: 1.5em; + margin: 0; + background: #99cc33; + color: #FFF; + + border-top: 3px solid #7A2; + + -moz-border-radius-bottomleft: 5px; + -moz-border-radius-bottomright: 5px; +} + + #top h1{ + margin: 0; + } + + #top h1 a{ + color: #FFF; + text-decoration: none; + } + +/* Top +*******************************************************************************/ +#content{ + width: 38em; + padding: 0 2em; + margin: 2em 0; + float: left; + overflow: hidden; +} + +.post{ + margin-bottom: 3em; +} + +.post-title, .post-title a{ + color: #77AA22; + text-decoration: none; +} + +.post-info{ + color: #666; + margin-top: -1em; +} + +.post-info a{ + color: #669; + text-decoration : none; +} + +/* Top +*******************************************************************************/ +#sidebar{ + width: 13em; + padding: 0 2em; + margin: 2em 0; + float: right; +} + + #sidebar div{ + font-size: 0.8em; + } + + #sidebar h2{ + color: #99CC33; + } + + #sidebar a{ + text-decoration: none; + border-bottom: 1px solid #DDD; + } + + #sidebar ul{ + margin: 0; + padding: 0; + list-style: none; + } + + #sidebar li{ + margin: 0.5ex 0; + } + +/* Footer +*******************************************************************************/ +#footer{ + padding: 1ex 1em; + clear: both; + border-top: 1px dotted #CCC; + color: #999; +}
\ No newline at end of file diff --git a/custom/style/light.css b/custom/style/light.css new file mode 100644 index 0000000..60826e4 --- /dev/null +++ b/custom/style/light.css @@ -0,0 +1,124 @@ +html{ + font-family: Arial, sans-serif; + color: #333; + background: #FFF; + font-size: 62.5%; +} + +body{ + margin: 0; + padding: 0; + font-size: 1.1em; + line-height: 1.5em; +} + +a{ + color: #669; +} + +a:visited{ + color: #444; +} + +a:hover{ + color: #000; +} + +a img{ + border: none; +} + +pre, code{ + font-size: 1.2em; +} +/* Top +*******************************************************************************/ +#page{ + margin: 0; + background: #FFF; +} +/* Top +*******************************************************************************/ +#top{ + padding: 2%; + margin: 0; + background: #CCC; + color: #FFF; + + border-top: 5px solid #999; +} + + #top h1{ + margin: 0; + letter-spacing: -1px; + } + +/* Top +*******************************************************************************/ +#content{ + width: 66%; + padding: 0 2%; + margin: 0; + float: left; +} + +.post{ + margin-bottom: 3em; +} + +.post-title, .post-title a{ + color: #666; + text-decoration: none; +} + +.post-title{ + padding-bottom: 0.5em; + border-bottom: 1px dotted #CCC; +} + +.post-info{ + color: #666; + margin-top: -1em; +} + +.post-info a{ + color: #666; + text-decoration : none; +} + +/* Top +*******************************************************************************/ +#sidebar{ + width: 26%; + padding: 0 2%; + margin: 0; + float: right; +} + + #sidebar div{ + font-size: 0.8em; + } + + #sidebar h2{ + color: #999; + } + + #sidebar a{ + text-decoration: none; + border-bottom: 1px solid #DDD; + } + + #sidebar ul{ + margin: 0; + padding: 0; + list-style: none; + } + +/* Footer +*******************************************************************************/ +#footer{ + padding: 1ex 1em; + clear: both; + border-top: 1px dotted #CCC; + color: #999; +}
\ No newline at end of file diff --git a/custom/style/mobile.css b/custom/style/mobile.css new file mode 100644 index 0000000..38b3cd2 --- /dev/null +++ b/custom/style/mobile.css @@ -0,0 +1,8 @@ +body { +margin:0; +padding:0; +background-color:#fff; +color:#111; +font:.6em/1.2em normal arial,helvetica,sans-serif; +} +h1{font-size: 1em;text-align:center;}
\ No newline at end of file diff --git a/custom/views.php b/custom/views.php new file mode 100644 index 0000000..6d48d59 --- /dev/null +++ b/custom/views.php @@ -0,0 +1,24 @@ +<?php +$views = array( + 'rss10' => array( + 'header' => 'Content-Type: text/xml; charset=UTF-8', + 'prolog' => '<?xml version="1.0" encoding="UTF-8" ?>'."\n", + 'template' => dirname(__FILE__).'/views/rss10/rss10.tpl.php' + ), + 'atom10' => array( + //'header' => 'Content-Type: text/xml; charset=UTF-8', + 'header' => 'Content-Type: text/plain; charset=UTF-8', + 'prolog' => '<?xml version="1.0" encoding="UTF-8" ?>'."\n", + 'template' => dirname(__FILE__).'/views/atom10/atom10.tpl.php' + ), + 'archive' => array( + 'header' => 'Content-type: text/html; charset=UTF-8', + 'prolog' => '', + 'template' => dirname(__FILE__).'/views/archive/archive.tpl.php' + ), + 'html' => array( + 'header' => 'Content-type: text/html; charset=UTF-8', + 'prolog' => '', + 'template' => dirname(__FILE__).'/views/default/index.tpl.php' + ) +);
\ No newline at end of file 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 |