aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-29 14:51:41 -0800
committerfriendica <info@friendica.com>2015-01-29 14:51:41 -0800
commitff68ea608786a698ad46637ef13854ac1b1e6beb (patch)
tree5e9bec7525754dda60c8c08bc00802160efa202c /mod
parenta2cdd1499c968c31ae1b95933231f80be5fc639b (diff)
downloadvolse-hubzilla-ff68ea608786a698ad46637ef13854ac1b1e6beb.tar.gz
volse-hubzilla-ff68ea608786a698ad46637ef13854ac1b1e6beb.tar.bz2
volse-hubzilla-ff68ea608786a698ad46637ef13854ac1b1e6beb.zip
more message restrict conversions
Diffstat (limited to 'mod')
-rw-r--r--mod/display.php4
-rw-r--r--mod/editlayout.php2
-rw-r--r--mod/editwebpage.php2
-rw-r--r--mod/home.php4
-rw-r--r--mod/impel.php6
-rw-r--r--mod/item.php9
-rw-r--r--mod/layouts.php2
-rwxr-xr-xmod/like.php12
-rw-r--r--mod/page.php8
-rw-r--r--mod/webpages.php2
10 files changed, 25 insertions, 26 deletions
diff --git a/mod/display.php b/mod/display.php
index 740050e41..b61931169 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -77,7 +77,7 @@ function display_content(&$a, $update = 0, $load = false) {
$target_item = null;
- $r = q("select id, uid, mid, parent_mid, item_restrict from item where mid like '%s' limit 1",
+ $r = q("select id, uid, mid, parent_mid, item_type, item_deleted from item where mid like '%s' limit 1",
dbesc($item_hash . '%')
);
@@ -87,7 +87,7 @@ function display_content(&$a, $update = 0, $load = false) {
$r = null;
- if($target_item['item_restrict'] & ITEM_WEBPAGE) {
+ if($target_item['item_type'] == ITEM_TYPE_WEBPAGE) {
$x = q("select * from channel where channel_id = %d limit 1",
intval($target_item['uid'])
);
diff --git a/mod/editlayout.php b/mod/editlayout.php
index d76aa484d..bd5063aee 100644
--- a/mod/editlayout.php
+++ b/mod/editlayout.php
@@ -135,7 +135,7 @@ function editlayout_content(&$a) {
$o .= replace_macros($tpl,array(
'$return_path' => $rp,
'$action' => 'item',
- '$webpage' => ITEM_PDL,
+ '$webpage' => ITEM_TYPE_PDL,
'$share' => t('Edit'),
'$upload' => t('Upload photo'),
'$attach' => t('Attach file'),
diff --git a/mod/editwebpage.php b/mod/editwebpage.php
index d7969fb2d..4cedcd65f 100644
--- a/mod/editwebpage.php
+++ b/mod/editwebpage.php
@@ -166,7 +166,7 @@ function editwebpage_content(&$a) {
$o .= replace_macros($tpl,array(
'$return_path' => $rp,
- '$webpage' => ITEM_WEBPAGE,
+ '$webpage' => ITEM_TYPE_WEBPAGE,
'$placeholdpagetitle' => t('Page link title'),
'$pagetitle' => $page_title,
diff --git a/mod/home.php b/mod/home.php
index 648a8ff4f..13b5b2905 100644
--- a/mod/home.php
+++ b/mod/home.php
@@ -74,10 +74,10 @@ function home_content(&$a, $update = 0, $load = false) {
$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_type = %d limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
- intval(ITEM_WEBPAGE)
+ intval(ITEM_TYPE_WEBPAGE)
);
if($r) {
diff --git a/mod/impel.php b/mod/impel.php
index 60e80ff9f..927cb11c6 100644
--- a/mod/impel.php
+++ b/mod/impel.php
@@ -28,17 +28,17 @@ function impel_init(&$a) {
switch($j['type']) {
case 'webpage':
- $arr['item_restrict'] = ITEM_WEBPAGE;
+ $arr['item_type'] = ITEM_TYPE_WEBPAGE;
$namespace = 'WEBPAGE';
$installed_type = t('webpage');
break;
case 'block':
- $arr['item_restrict'] = ITEM_BUILDBLOCK;
+ $arr['item_type'] = ITEM_TYPE_BLOCK;
$namespace = 'BUILDBLOCK';
$installed_type = t('block');
break;
case 'layout':
- $arr['item_restrict'] = ITEM_PDL;
+ $arr['item_type'] = ITEM_TYPE_PDL;
$namespace = 'PDL';
$installed_type = t('layout');
break;
diff --git a/mod/item.php b/mod/item.php
index 294ee641f..e983b63ef 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -839,9 +839,8 @@ function item_post(&$a) {
// This way we don't see every picture in your new photo album posted to your wall at once.
// They will show up as people comment on them.
- if($parent_item['item_restrict'] & ITEM_HIDDEN) {
- $r = q("UPDATE `item` SET `item_restrict` = %d WHERE `id` = %d",
- intval($parent_item['item_restrict'] - ITEM_HIDDEN),
+ if(intval($parent_item['item_hidden'])) {
+ $r = q("UPDATE item SET item_hidden = 0 WHERE id = %d",
intval($parent_item['id'])
);
}
@@ -1047,8 +1046,8 @@ 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)>0 and i.item_deleted = 0 and i.uid= %d ",
- intval(ITEM_WEBPAGE),
+ and i.parent=i.id and i.item_type = %d and i.item_deleted = 0 and i.uid= %d ",
+ intval(ITEM_TYPE_WEBPAGE),
intval($channel_id)
);
}
diff --git a/mod/layouts.php b/mod/layouts.php
index aaf5db0ef..712cfc4cb 100644
--- a/mod/layouts.php
+++ b/mod/layouts.php
@@ -119,7 +119,7 @@ function layouts_content(&$a) {
// This lets you post pages at other people's channels.
$x = array(
- 'webpage' => ITEM_PDL,
+ 'webpage' => ITEM_TYPE_PDL,
'is_owner' => true,
'nickname' => $a->profile['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
diff --git a/mod/like.php b/mod/like.php
index 968f9c81e..6316b38f9 100755
--- a/mod/like.php
+++ b/mod/like.php
@@ -229,9 +229,10 @@ function like_content(&$a) {
// get the item. Allow linked photos (which are normally hidden) to be liked
- $r = q("SELECT * FROM item WHERE id = %d and (item_restrict = 0 or item_restrict = %d) LIMIT 1",
- intval($item_id),
- intval(ITEM_HIDDEN)
+ $r = q("SELECT * FROM item WHERE id = %d
+ and item_blocked = 0 and item_moderated = 0 and item_spam = 0
+ and item_deleted = 0 and item_unpublished = 0 and item_delayed_publish = 0 LIMIT 1",
+ intval($item_id)
);
if(! $item_id || (! $r)) {
@@ -339,9 +340,8 @@ function like_content(&$a) {
// if this was a linked photo and was hidden, unhide it.
- if($item['item_restrict'] & ITEM_HIDDEN) {
- $r = q("update item set item_restrict = (item_restrict ^ %d) where id = %d",
- intval(ITEM_HIDDEN),
+ if(intval($item['item_hidden'])) {
+ $r = q("update item set item_hidden = 0 where id = %d",
intval($item['id'])
);
}
diff --git a/mod/page.php b/mod/page.php
index e8f17ebda..1830b964b 100644
--- a/mod/page.php
+++ b/mod/page.php
@@ -56,10 +56,10 @@ function page_init(&$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_type = %d $sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
- intval(ITEM_WEBPAGE)
+ intval(ITEM_TYPE_WEBPAGE)
);
if(! $r) {
@@ -68,10 +68,10 @@ function page_init(&$a) {
$x = 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 $revision limit 1",
+ item_type = %d $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
- intval(ITEM_WEBPAGE)
+ intval(ITEM_TYPE_WEBPAGE)
);
if($x) {
// Yes, it's there. You just aren't allowed to see it.
diff --git a/mod/webpages.php b/mod/webpages.php
index baddebec8..48dfe4920 100644
--- a/mod/webpages.php
+++ b/mod/webpages.php
@@ -106,7 +106,7 @@ function webpages_content(&$a) {
$o = profile_tabs($a,true);
$x = array(
- 'webpage' => ITEM_WEBPAGE,
+ 'webpage' => ITEM_TYPE_WEBPAGE,
'is_owner' => true,
'nickname' => $a->profile['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),