diff options
author | friendica <info@friendica.com> | 2012-09-04 03:34:36 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-09-04 03:34:36 -0700 |
commit | 9c875a8ab58ff6da12bb34e141b92eb4d1c6c847 (patch) | |
tree | 4a6288e69fcdad9ffdbe719104d74664f7fc4e3f /mod/item.php | |
parent | 2df083efb10c1282b33900b588c0d39987f3c9b2 (diff) | |
download | volse-hubzilla-9c875a8ab58ff6da12bb34e141b92eb4d1c6c847.tar.gz volse-hubzilla-9c875a8ab58ff6da12bb34e141b92eb4d1c6c847.tar.bz2 volse-hubzilla-9c875a8ab58ff6da12bb34e141b92eb4d1c6c847.zip |
this should get local posts almost working
Diffstat (limited to 'mod/item.php')
-rw-r--r-- | mod/item.php | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/mod/item.php b/mod/item.php index 742953eb6..c7de5f304 100644 --- a/mod/item.php +++ b/mod/item.php @@ -175,11 +175,12 @@ function item_post(&$a) { $user = null; - $r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", + $r = q("SELECT entity.*, account.* FROM entity left join account on entity.entity_account_id = account.account_id + where entity.entity_id = %d LIMIT 1", intval($profile_uid) ); if(count($r)) - $user = $r[0]; + $entity = $r[0]; if($orig_post) { $str_group_allow = $orig_post['allow_gid']; @@ -207,10 +208,10 @@ function item_post(&$a) { && (! array_key_exists('group_allow',$_REQUEST)) && (! array_key_exists('contact_deny',$_REQUEST)) && (! array_key_exists('group_deny',$_REQUEST))) { - $str_group_allow = $user['allow_gid']; - $str_contact_allow = $user['allow_cid']; - $str_group_deny = $user['deny_gid']; - $str_contact_deny = $user['deny_cid']; + $str_group_allow = $entity['entity_allow_gid']; + $str_contact_allow = $entity['entity_allow_cid']; + $str_group_deny = $entity['entity_deny_gid']; + $str_contact_deny = $entity['entity_deny_cid']; } else { @@ -529,6 +530,7 @@ function item_post(&$a) { $uri = item_new_uri($a->get_hostname(),$profile_uid); // Fallback so that we alway have a thr-parent + if(!$thr_parent) $thr_parent = $uri; @@ -577,7 +579,7 @@ function item_post(&$a) { $datarray['parent'] = $parent; $datarray['self'] = $self; -// $datarray['prvnets'] = $user['prvnets']; + if($orig_post) $datarray['edit'] = true; @@ -743,11 +745,11 @@ function item_post(&$a) { if($contact_record != $author) { notification(array( 'type' => NOTIFY_COMMENT, - 'notify_flags' => $user['notify-flags'], - 'language' => $user['language'], - 'to_name' => $user['username'], - 'to_email' => $user['email'], - 'uid' => $user['uid'], + 'notify_flags' => $entity['entity_notifyflags'], + 'language' => $entity['account_language'], + 'to_name' => $entity['entity_name'], + 'to_email' => $entity['account_email'], + 'uid' => $entity['entity_id'], 'item' => $datarray, 'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id, 'source_name' => $datarray['author-name'], @@ -768,11 +770,11 @@ function item_post(&$a) { if($contact_record != $author) { notification(array( 'type' => NOTIFY_WALL, - 'notify_flags' => $user['notify-flags'], - 'language' => $user['language'], - 'to_name' => $user['username'], - 'to_email' => $user['email'], - 'uid' => $user['uid'], + 'notify_flags' => $entity['entity_notifyflags'], + 'language' => $entity['account_language'], + 'to_name' => $entity['entity_name'], + 'to_email' => $entity['account_email'], + 'uid' => $entity['entity_id'], 'item' => $datarray, 'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id, 'source_name' => $datarray['author-name'], @@ -793,7 +795,7 @@ function item_post(&$a) { WHERE `id` = %d LIMIT 1", intval($parent), dbesc(($parent == $post_id) ? $uri : $parent_item['uri']), - dbesc($a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id), + dbesc($a->get_baseurl() . '/display/' . $entity['entity_address'] . '/' . $post_id), dbesc(datetime_convert()), intval($post_id) ); @@ -824,7 +826,7 @@ function item_post(&$a) { ); $datarray['id'] = $post_id; - $datarray['plink'] = $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id; + $datarray['plink'] = $a->get_baseurl() . '/display/' . $entity['entity_address'] . '/' . $post_id; call_hooks('post_local_end', $datarray); |