From a535a9e7e017629178b45acc2e96e1d674a0d6fc Mon Sep 17 00:00:00 2001 From: Nicolas BERNSTEIN Date: Fri, 13 Apr 2012 19:17:17 +0200 Subject: Added : ATOM feed for blog ; abilty to comment posts. --- tpl/blog/atom_feed.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tpl/blog/atom_feed.php (limited to 'tpl/blog/atom_feed.php') diff --git a/tpl/blog/atom_feed.php b/tpl/blog/atom_feed.php new file mode 100644 index 0000000..20dc0ea --- /dev/null +++ b/tpl/blog/atom_feed.php @@ -0,0 +1,37 @@ +'."\n"; +echo ''."\n"; +echo '' . $blog_title . ''."\n"; +echo '' . $blog_base_url . "blog". "\n"; +echo '' . "\n"; + + +function beginning($text, $len = 500) { + $text = preg_replace('#<.+>#isU', ' ', $text); + if (strlen($text) > $len) { + $text = substr($text, 0, $len)."..."; + } + return $text; +} + +foreach ($posts as $post) { + echo "\n\n"; + echo '' . $post['title'] . "\n"; + echo '' . @date("c", $post['date_ts']) . "\n"; + echo '' . $blog_base_url . "view-blog-" . $post['id'] . "\n"; + foreach (explode(', ', $post['tags']) as $tag) { + echo '' . "\n"; + } + echo '' . "\n"; + echo '' . "\n"; + echo '\n"; + echo "".$post['owner']."\n"; + echo "\n"; +} + +echo ''; + +die(); + -- cgit v1.2.3