From 25397cf07f7bcc5a2e5ae94fea5417ebb539a0ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaussoin=20Timoth=C3=A9e?= Date: Wed, 6 May 2015 21:07:59 +0200 Subject: [PATCH] - New blog feature : you can have a unique URL for a public Movim article - Add the version in about #1450928 --- app/models/postn/PostnDAO.php | 26 ++++++++++++++++++++++++++ app/widgets/About/About.php | 8 +++++++- app/widgets/About/about.tpl | 2 +- app/widgets/Blog/Blog.php | 8 ++++++-- app/widgets/Blog/blog.tpl | 24 +++++++++++++++++------- system/Route.php | 10 +++++----- 6 files changed, 62 insertions(+), 16 deletions(-) diff --git a/app/models/postn/PostnDAO.php b/app/models/postn/PostnDAO.php index a993f6051..d719bfb62 100755 --- a/app/models/postn/PostnDAO.php +++ b/app/models/postn/PostnDAO.php @@ -383,6 +383,32 @@ class PostnDAO extends SQL { return $this->run('ContactPostn'); } + function getPublicItem($origin, $node, $nodeid, $limitf = false, $limitr = false) { + $this->_sql = ' + select *, postn.aid, privacy.value as privacy from postn + left outer join contact on postn.aid = contact.jid + left outer join privacy on postn.nodeid = privacy.pkey + where postn.origin = :origin + and postn.node = :node + and privacy.value = 1 + and postn.nodeid = :nodeid + order by postn.published desc'; + + if($limitr) + $this->_sql = $this->_sql.' limit '.$limitr.' offset '.$limitf; + + $this->prepare( + 'Postn', + array( + 'origin' => $origin, + 'node' => $node, + 'nodeid' => $nodeid, + ) + ); + + return $this->run('ContactPostn'); + } + // TODO: fixme function getComments($posts) { $commentsid = ''; diff --git a/app/widgets/About/About.php b/app/widgets/About/About.php index e4f15a2eb..fe1b1f09c 100755 --- a/app/widgets/About/About.php +++ b/app/widgets/About/About.php @@ -15,6 +15,12 @@ class About extends WidgetBase { - function load() { + function load() + { + } + + function display() + { + $this->view->assign('version', APP_VERSION); } } diff --git a/app/widgets/About/about.tpl b/app/widgets/About/about.tpl index 8e1038952..8c610effc 100755 --- a/app/widgets/About/about.tpl +++ b/app/widgets/About/about.tpl @@ -1,5 +1,5 @@
-

{$c->__('page.about')}

+

Movim {$version} - {$c->__('page.about')}