From 22e94d7d684005d01a900a23d02f8e9dd0f283d8 Mon Sep 17 00:00:00 2001 From: Christian Vogeley Date: Tue, 31 Dec 2013 16:03:25 +0100 Subject: Correct wrong service class check for webpages --- mod/item.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/item.php b/mod/item.php index 7f881d28d..d3e88fdfa 100644 --- a/mod/item.php +++ b/mod/item.php @@ -1135,8 +1135,9 @@ function item_check_service_class($channel_id,$iswebpage) { if ($iswebpage) { $r = q("select count(i.id) as total from item i right join channel c on (i.author_xchan=c.channel_hash and i.uid=c.channel_id ) - and i.parent=i.id and (i.item_restrict & %d) and i.uid= %d ", + and i.parent=i.id and (i.item_restrict & %d) and not (i.item_restrict & %d) and i.uid= %d ", intval(ITEM_WEBPAGE), + intval(ITEM_DELETED), intval($channel_id) ); } -- cgit v1.2.3 From 575f2b3280049eba2bbead023d8fe7fc345af0b1 Mon Sep 17 00:00:00 2001 From: Christian Vogeley Date: Tue, 31 Dec 2013 18:28:07 +0100 Subject: Fix page not found error after editing a webpage --- mod/page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/page.php b/mod/page.php index df17dbf52..125c0141f 100644 --- a/mod/page.php +++ b/mod/page.php @@ -58,7 +58,7 @@ function page_content(&$a) { $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 $sql_options $revision limit 1", + (item_restrict & %d) $sql_options $revision limit 1", intval($u[0]['channel_id']), dbesc($page_id), intval(ITEM_WEBPAGE) -- cgit v1.2.3 From aafc40069bf0955d935adb4632650c7c990063a7 Mon Sep 17 00:00:00 2001 From: Christian Vogeley Date: Wed, 1 Jan 2014 16:18:39 +0100 Subject: Confirm webpage deletion prompt --- mod/editpost.php | 1 + mod/editwebpage.php | 5 +++-- view/tpl/jot-header.tpl | 7 +++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mod/editpost.php b/mod/editpost.php index f012c47cd..7cc33d60d 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -50,6 +50,7 @@ function editpost_content(&$a) { '$geotag' => $geotag, '$nickname' => $channel['channel_address'], '$expireswhen' => t('Expires YYYY-MM-DD HH:MM'), + '$confirmdelete' => t('Delete item?'), )); diff --git a/mod/editwebpage.php b/mod/editwebpage.php index 85bd9e918..00659b4b7 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -112,7 +112,8 @@ function editwebpage_content(&$a) { '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$ispublic' => ' ', // t('Visible to everybody'), '$geotag' => $geotag, - '$nickname' => $a->user['nickname'] + '$nickname' => $a->user['nickname'], + '$confirmdelete' => t('Delete webpage?') )); @@ -185,7 +186,7 @@ function editwebpage_content(&$a) { $ob = get_observer_hash(); if(($itm[0]['author_xchan'] === $ob) || ($itm[0]['owner_xchan'] === $ob)) - $o .= '

' . t('Delete Webpage') . '
'; + $o .= '

' . t('Delete Webpage') . '
'; return $o; diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 09d035979..75239c179 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -306,16 +306,15 @@ function enableOnUser(){ - + -- cgit v1.2.3 From 87ff49544376f71cf0f10aef5123886a99b36239 Mon Sep 17 00:00:00 2001 From: Christian Vogeley Date: Fri, 3 Jan 2014 21:25:18 +0100 Subject: Revert "Fix page not found error after editing a webpage" This reverts commit 575f2b3280049eba2bbead023d8fe7fc345af0b1. --- mod/page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/page.php b/mod/page.php index 125c0141f..df17dbf52 100644 --- a/mod/page.php +++ b/mod/page.php @@ -58,7 +58,7 @@ function page_content(&$a) { $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) $sql_options $revision limit 1", + item_restrict = %d $sql_options $revision limit 1", intval($u[0]['channel_id']), dbesc($page_id), intval(ITEM_WEBPAGE) -- cgit v1.2.3