diff options
author | root <root@diekershoff.homeunix.net> | 2010-12-08 06:54:13 +0100 |
---|---|---|
committer | root <root@diekershoff.homeunix.net> | 2010-12-08 06:54:13 +0100 |
commit | a96da925712184eec97f6ca01072b7c2bee92a7e (patch) | |
tree | c0a99dd7bbc6b479b040a8ef08cabee5f0f56e38 /mod/item.php | |
parent | af48dbec7f87a75a66f79887b6d2419b661e263d (diff) | |
parent | a42b9ea3dea5e1490dd4aa4852760354d569ea51 (diff) | |
download | volse-hubzilla-a96da925712184eec97f6ca01072b7c2bee92a7e.tar.gz volse-hubzilla-a96da925712184eec97f6ca01072b7c2bee92a7e.tar.bz2 volse-hubzilla-a96da925712184eec97f6ca01072b7c2bee92a7e.zip |
Merge branch 'master' of git://github.com/friendika/friendika
Diffstat (limited to 'mod/item.php')
-rw-r--r-- | mod/item.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mod/item.php b/mod/item.php index 504856d7d..ea88e6c31 100644 --- a/mod/item.php +++ b/mod/item.php @@ -53,6 +53,8 @@ function item_post(&$a) { $str_group_deny = perms2str($_POST['group_deny']); $str_contact_deny = perms2str($_POST['contact_deny']); + $private = ((strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) ? 1 : 0); + $title = notags(trim($_POST['title'])); $body = escape_tags(trim($_POST['body'])); $location = notags(trim($_POST['location'])); @@ -195,8 +197,8 @@ function item_post(&$a) { $r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`, `author-name`, `author-link`, `author-avatar`, `created`, `edited`, `changed`, `uri`, `title`, `body`, `location`, `coord`, - `tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`) - VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )", + `tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private` ) + VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d )", intval($profile_uid), dbesc($post_type), intval($wall), @@ -222,7 +224,8 @@ function item_post(&$a) { dbesc($str_contact_allow), dbesc($str_group_allow), dbesc($str_contact_deny), - dbesc($str_group_deny) + dbesc($str_group_deny), + intval($private) ); $r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1", dbesc($uri)); @@ -241,12 +244,13 @@ function item_post(&$a) { // Inherit ACL's from the parent item. // TODO merge with subsequent UPDATE operation and save a db write - $r = q("UPDATE `item` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s' + $r = q("UPDATE `item` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `private` = %d WHERE `id` = %d LIMIT 1", dbesc($parent_item['allow_cid']), dbesc($parent_item['allow_gid']), dbesc($parent_item['deny_cid']), dbesc($parent_item['deny_gid']), + intval($parent_item['private']), intval($post_id) ); |