From 4e92ab575b933b67601092036a4ce8ac3557d7d2 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 25 Oct 2012 07:48:26 +0200 Subject: [PATCH] part of #6: atom feed for recently updated pastes --- README.rst | 1 + data/templates/feed-updated.htm | 24 ++++++++++++++++++++++++ data/templates/list.htm | 1 + www/.htaccess | 1 + www/feed-updated.php | 19 +++++++++++++++++++ 5 files changed, 46 insertions(+) create mode 100644 data/templates/feed-updated.htm create mode 100644 www/feed-updated.php diff --git a/README.rst b/README.rst index 255de2a..ede03d0 100644 --- a/README.rst +++ b/README.rst @@ -284,6 +284,7 @@ If you use nginx, place the following lines into your ``server`` block: rewrite ^/new$ /new.php; rewrite ^/feed/new$ /feed-new.php; + rewrite ^/feed/updated$ /feed-updated.php; rewrite ^/list$ /list.php; rewrite ^/list/([0-9]+)$ /list.php?page=$1; diff --git a/data/templates/feed-updated.htm b/data/templates/feed-updated.htm new file mode 100644 index 0000000..699dabd --- /dev/null +++ b/data/templates/feed-updated.htm @@ -0,0 +1,24 @@ + + + {{title}}: Updated pastes + + + {{url}} +{% set repo = pastes.repos.0 %} + {{repo.modate|date('c')}} + +{% for repo in pastes.repos %} + + {{repo.getLink('display', null, true)}} + {{repo.getTitle}} + {{repo.crdate|date('c')}} + {{repo.modate|date('c')}} + + + {% set owner=repo.getOwner() %} + {{owner.name}} + {{owner.email}} + + +{% endfor %} + \ No newline at end of file diff --git a/data/templates/list.htm b/data/templates/list.htm index ac3d664..c9768ff 100644 --- a/data/templates/list.htm +++ b/data/templates/list.htm @@ -3,6 +3,7 @@ {% block meta %} + {% endblock %} {% block content %} diff --git a/www/.htaccess b/www/.htaccess index d18aa34..f3dc267 100644 --- a/www/.htaccess +++ b/www/.htaccess @@ -17,6 +17,7 @@ RewriteRule ^fork-remote$ /fork-remote.php RewriteRule ^new$ /new.php RewriteRule ^feed/new$ /feed-new.php +RewriteRule ^feed/updated$ /feed-updated.php RewriteRule ^list$ /list.php RewriteRule ^list/([0-9]+)$ /list.php?page=$1 diff --git a/www/feed-updated.php b/www/feed-updated.php new file mode 100644 index 0000000..679a5d7 --- /dev/null +++ b/www/feed-updated.php @@ -0,0 +1,19 @@ + $db->getSearch()->listAll(0, 10, 'modate', 'desc'), + 'url' => Tools::fullUrl('/'), + 'feedurl' => Tools::fullUrl('/feed/updated'), + ) +); +?> -- 2.30.2