aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-07 04:36:47 -0700
committerfriendica <info@friendica.com>2013-09-07 04:36:47 -0700
commitfe5f470c62a45191ed261808aa41400234dd306d (patch)
treee897422f4618914005b91db791ea1a5a926e4c00 /mod
parent320a8a5e27f38ac62417a1325db14140d8c5b8b3 (diff)
downloadvolse-hubzilla-fe5f470c62a45191ed261808aa41400234dd306d.tar.gz
volse-hubzilla-fe5f470c62a45191ed261808aa41400234dd306d.tar.bz2
volse-hubzilla-fe5f470c62a45191ed261808aa41400234dd306d.zip
mod/page - display most recent revision by default, or numbered revision specified by rev URL parameter
Diffstat (limited to 'mod')
-rw-r--r--mod/page.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/mod/page.php b/mod/page.php
index d91f8d866..452341cb1 100644
--- a/mod/page.php
+++ b/mod/page.php
@@ -48,9 +48,15 @@ function page_content(&$a) {
return;
}
+ if($_REQUEST['rev'])
+ $revision = " and revision = " . intval($_REQUEST['rev']) . " ";
+ else
+ $revision = " order by revision desc ";
+
+
$r = q("select item.* from item left join item_id on item.id = item_id.iid
where item.uid = %d and sid = '%s' and service = 'WEBPAGE' and
- item_restrict = %d limit 1",
+ item_restrict = %d $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
intval(ITEM_WEBPAGE)