From fe5f470c62a45191ed261808aa41400234dd306d Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 7 Sep 2013 04:36:47 -0700 Subject: mod/page - display most recent revision by default, or numbered revision specified by rev URL parameter --- mod/page.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3