From f7c6a6ff9071c120f5bd6efe51cdb934e0c30cc7 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 15 Aug 2012 22:33:37 -0700 Subject: item table rename parent-uri, target-type, object-type (more to come later) --- include/api.php | 8 ++-- include/conversation.php | 20 ++++---- include/delivery.php | 2 +- include/event.php | 4 +- include/items.php | 118 +++++++++++++++++++++++------------------------ include/message.php | 6 +-- include/notifier.php | 4 +- 7 files changed, 81 insertions(+), 81 deletions(-) (limited to 'include') diff --git a/include/api.php b/include/api.php index 456d984de..296fba1a7 100644 --- a/include/api.php +++ b/include/api.php @@ -1357,7 +1357,7 @@ 'contributors' => '', 'annotations' => '', 'entities' => '', - 'objecttype' => (($item['object-type']) ? $item['object-type'] : ACTIVITY_OBJ_NOTE), + 'objecttype' => (($item['obj_type']) ? $item['obj_type'] : ACTIVITY_OBJ_NOTE), 'verb' => (($item['verb']) ? $item['verb'] : ACTIVITY_POST), 'self' => $a->get_baseurl()."/api/statuses/show/".$item['id'].".".$type, 'edit' => $a->get_baseurl()."/api/statuses/show/".$item['id'].".".$type, @@ -1573,10 +1573,10 @@ $replyto = ''; $sub = ''; if (x($_REQUEST,'replyto')) { - $r = q('SELECT `parent-uri`, `title` FROM `mail` WHERE `uid`=%d AND `id`=%d', + $r = q('SELECT `parent_uri`, `title` FROM `mail` WHERE `uid`=%d AND `id`=%d', intval(local_user()), intval($_REQUEST['replyto'])); - $replyto = $r[0]['parent-uri']; + $replyto = $r[0]['parent_uri']; $sub = $r[0]['title']; } else { @@ -1628,7 +1628,7 @@ $sql_extra = "`from-url`='".dbesc( $profile_url )."'"; } elseif ($box=="conversation") { - $sql_extra = "`parent-uri`='".dbesc( $_GET["uri"] ) ."'"; + $sql_extra = "`parent_uri`='".dbesc( $_GET["uri"] ) ."'"; } elseif ($box=="all") { $sql_extra = "true"; diff --git a/include/conversation.php b/include/conversation.php index c41d00def..0d770ef40 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -93,7 +93,7 @@ function localize_item(&$item){ $r = q("SELECT * from `item`,`contact` WHERE `item`.`contact-id`=`contact`.`id` AND `item`.`uri`='%s';", - dbesc($item['parent-uri'])); + dbesc($item['parent_uri'])); if(count($r)==0) return; $obj=$r[0]; @@ -102,7 +102,7 @@ function localize_item(&$item){ switch($obj['verb']){ case ACTIVITY_POST: - switch ($obj['object-type']){ + switch ($obj['obj_type']){ case ACTIVITY_OBJ_EVENT: $post_type = t('event'); break; @@ -135,7 +135,7 @@ function localize_item(&$item){ } if ($item['verb']=== ACTIVITY_FRIEND){ - if ($item['object-type']=="" || $item['object-type']!== ACTIVITY_OBJ_PERSON) return; + if ($item['obj_type']=="" || $item['obj_type']!== ACTIVITY_OBJ_PERSON) return; $Aname = $item['author-name']; $Alink = $item['author-link']; @@ -167,7 +167,7 @@ function localize_item(&$item){ $verb = urldecode(substr($item['verb'],strpos($item['verb'],'#')+1)); if(! $verb) return; - if ($item['object-type']=="" || $item['object-type']!== ACTIVITY_OBJ_PERSON) return; + if ($item['obj_type']=="" || $item['obj_type']!== ACTIVITY_OBJ_PERSON) return; $Aname = $item['author-name']; $Alink = $item['author-link']; @@ -209,7 +209,7 @@ function localize_item(&$item){ if ($item['verb']===ACTIVITY_TAG){ $r = q("SELECT * from `item`,`contact` WHERE `item`.`contact-id`=`contact`.`id` AND `item`.`uri`='%s';", - dbesc($item['parent-uri'])); + dbesc($item['parent_uri'])); if(count($r)==0) return; $obj=$r[0]; @@ -218,7 +218,7 @@ function localize_item(&$item){ switch($obj['verb']){ case ACTIVITY_POST: - switch ($obj['object-type']){ + switch ($obj['obj_type']){ case ACTIVITY_OBJ_EVENT: $post_type = t('event'); break; @@ -245,7 +245,7 @@ function localize_item(&$item){ } if ($item['verb']=== ACTIVITY_FAVORITE){ - if ($item['object-type']== "") + if ($item['obj_type']== "") return; $Aname = $item['author-name']; @@ -1402,7 +1402,7 @@ function like_puller($a,$item,&$arr,$mode) { $url = zrl($url); if(! $item['thr-parent']) - $item['thr-parent'] = $item['parent-uri']; + $item['thr-parent'] = $item['parent_uri']; if(! ((isset($arr[$item['thr-parent'] . '-l'])) && (is_array($arr[$item['thr-parent'] . '-l'])))) $arr[$item['thr-parent'] . '-l'] = array(); @@ -1570,10 +1570,10 @@ function get_item_children($arr, $parent) { foreach($arr as $item) { if($item['id'] != $item['parent']) { if(get_config('system','thread_allow')) { - // Fallback to parent-uri if thr-parent is not set + // Fallback to parent_uri if thr-parent is not set $thr_parent = $item['thr-parent']; if($thr_parent == '') - $thr_parent = $item['parent-uri']; + $thr_parent = $item['parent_uri']; if($thr_parent == $parent['uri']) { $item['children'] = get_item_children($arr, $item); diff --git a/include/delivery.php b/include/delivery.php index 0d84b4626..f6ebe9ded 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -148,7 +148,7 @@ function delivery_run($argv, $argc){ $item['deleted'] = 1; } - if((count($items) == 1) && ($items[0]['uri'] === $items[0]['parent-uri'])) { + if((count($items) == 1) && ($items[0]['uri'] === $items[0]['parent_uri'])) { logger('delivery: top level post'); $top_level = true; } diff --git a/include/event.php b/include/event.php index 8aef0a263..ea3631331 100644 --- a/include/event.php +++ b/include/event.php @@ -352,7 +352,7 @@ function event_store($arr) { $item_arr['uid'] = $arr['uid']; $item_arr['contact-id'] = $arr['cid']; $item_arr['uri'] = $arr['uri']; - $item_arr['parent-uri'] = $arr['uri']; + $item_arr['parent_uri'] = $arr['uri']; $item_arr['type'] = 'activity'; $item_arr['wall'] = (($arr['cid']) ? 0 : 1); $item_arr['contact-id'] = $contact['id']; @@ -371,7 +371,7 @@ function event_store($arr) { $item_arr['last-child'] = 1; $item_arr['visible'] = 1; $item_arr['verb'] = ACTIVITY_POST; - $item_arr['object-type'] = ACTIVITY_OBJ_EVENT; + $item_arr['obj_type'] = ACTIVITY_OBJ_EVENT; $item_arr['origin'] = ((intval($arr['cid']) == 0) ? 1 : 0); $item_arr['body'] = format_event_bbcode($event); diff --git a/include/items.php b/include/items.php index 928cf3160..48f063ab7 100755 --- a/include/items.php +++ b/include/items.php @@ -224,7 +224,7 @@ function construct_activity_object($item) { if(! $r) return ''; if($r->type) - $o .= '' . xmlify($r->type) . '' . "\r\n"; + $o .= '' . xmlify($r->type) . '' . "\r\n"; if($r->id) $o .= '' . xmlify($r->id) . '' . "\r\n"; if($r->title) @@ -259,7 +259,7 @@ function construct_activity_target($item) { if(! $r) return ''; if($r->type) - $o .= '' . xmlify($r->type) . '' . "\r\n"; + $o .= '' . xmlify($r->type) . '' . "\r\n"; if($r->id) $o .= '' . xmlify($r->id) . '' . "\r\n"; if($r->title) @@ -420,13 +420,13 @@ function get_item_elements($j) { $arr['title'] = (($j->title) ? htmlentities($j->title, ENT_COMPAT,'UTF-8') : ''); $arr['app'] = (($j->app) ? htmlentities($j->app, ENT_COMPAT,'UTF-8') : ''); $arr['uri'] = (($j->uri) ? htmlentities($j->uri, ENT_COMPAT,'UTF-8') : ''); - $arr['puri'] = (($j->puri) ? htmlentities($j->puri, ENT_COMPAT,'UTF-8') : ''); + $arr['parent_uri'] = (($j->parent_uri) ? htmlentities($j->parent_uri, ENT_COMPAT,'UTF-8') : ''); $arr['plink'] = (($j->plink) ? htmlentities($j->plink, ENT_COMPAT,'UTF-8') : ''); $arr['location'] = (($j->location) ? htmlentities($j->location, ENT_COMPAT,'UTF-8') : ''); $arr['coord'] = (($j->coord) ? htmlentities($j->coord, ENT_COMPAT,'UTF-8') : ''); $arr['verb'] = (($j->verb) ? htmlentities($j->verb, ENT_COMPAT,'UTF-8') : ''); - $arr['objtype'] = (($j->objtype) ? htmlentities($j->objtype, ENT_COMPAT,'UTF-8') : ''); - $arr['tgttype'] = (($j->tgttype) ? htmlentities($j->tgttype, ENT_COMPAT,'UTF-8') : ''); + $arr['obj_type'] = (($j->objtype) ? htmlentities($j->objtype, ENT_COMPAT,'UTF-8') : ''); + $arr['tgt_type'] = (($j->tgttype) ? htmlentities($j->tgttype, ENT_COMPAT,'UTF-8') : ''); $arr['obj'] = $j->obj; $arr['tgt'] = $j->tgt; @@ -503,7 +503,7 @@ function get_atom_elements($feed,$item) { $rawactor = $item->get_item_tags(NAMESPACE_ACTIVITY, 'actor'); - if($rawactor && activity_match($rawactor[0]['child'][NAMESPACE_ACTIVITY]['object-type'][0]['data'],ACTIVITY_OBJ_PERSON)) { + if($rawactor && activity_match($rawactor[0]['child'][NAMESPACE_ACTIVITY]['obj_type'][0]['data'],ACTIVITY_OBJ_PERSON)) { $base = $rawactor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link']; if($base && count($base)) { foreach($base as $link) { @@ -535,7 +535,7 @@ function get_atom_elements($feed,$item) { $rawactor = $feed->get_feed_tags(NAMESPACE_ACTIVITY, 'subject'); - if($rawactor && activity_match($rawactor[0]['child'][NAMESPACE_ACTIVITY]['object-type'][0]['data'],ACTIVITY_OBJ_PERSON)) { + if($rawactor && activity_match($rawactor[0]['child'][NAMESPACE_ACTIVITY]['obj_type'][0]['data'],ACTIVITY_OBJ_PERSON)) { $base = $rawactor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link']; if($base && count($base)) { @@ -751,9 +751,9 @@ function get_atom_elements($feed,$item) { if($rawobj) { $res['object'] = '' . "\n"; $child = $rawobj[0]['child']; - if($child[NAMESPACE_ACTIVITY]['object-type'][0]['data']) { - $res['object-type'] = $child[NAMESPACE_ACTIVITY]['object-type'][0]['data']; - $res['object'] .= '' . $child[NAMESPACE_ACTIVITY]['object-type'][0]['data'] . '' . "\n"; + if($child[NAMESPACE_ACTIVITY]['obj_type'][0]['data']) { + $res['obj_type'] = $child[NAMESPACE_ACTIVITY]['obj_type'][0]['data']; + $res['object'] .= '' . $child[NAMESPACE_ACTIVITY]['obj_type'][0]['data'] . '' . "\n"; } if(x($child[SIMPLEPIE_NAMESPACE_ATOM_10], 'id') && $child[SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data']) $res['object'] .= '' . $child[SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data'] . '' . "\n"; @@ -790,8 +790,8 @@ function get_atom_elements($feed,$item) { if($rawobj) { $res['target'] = '' . "\n"; $child = $rawobj[0]['child']; - if($child[NAMESPACE_ACTIVITY]['object-type'][0]['data']) { - $res['target'] .= '' . $child[NAMESPACE_ACTIVITY]['object-type'][0]['data'] . '' . "\n"; + if($child[NAMESPACE_ACTIVITY]['obj_type'][0]['data']) { + $res['target'] .= '' . $child[NAMESPACE_ACTIVITY]['obj_type'][0]['data'] . '' . "\n"; } if(x($child[SIMPLEPIE_NAMESPACE_ATOM_10], 'id') && $child[SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data']) $res['target'] .= '' . $child[SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data'] . '' . "\n"; @@ -893,7 +893,7 @@ function item_store($arr,$force_parent = false) { if(x($arr, 'gravity')) $arr['gravity'] = intval($arr['gravity']); - elseif($arr['parent-uri'] === $arr['uri']) + elseif($arr['parent_uri'] === $arr['uri']) $arr['gravity'] = 0; elseif(activity_match($arr['verb'],ACTIVITY_POST)) $arr['gravity'] = 6; @@ -942,11 +942,11 @@ function item_store($arr,$force_parent = false) { $arr['coord'] = ((x($arr,'coord')) ? notags(trim($arr['coord'])) : ''); $arr['visible'] = ((x($arr,'visible') !== false) ? intval($arr['visible']) : 1 ); $arr['deleted'] = 0; - $arr['parent-uri'] = ((x($arr,'parent-uri')) ? notags(trim($arr['parent-uri'])) : ''); + $arr['parent_uri'] = ((x($arr,'parent_uri')) ? notags(trim($arr['parent_uri'])) : ''); $arr['verb'] = ((x($arr,'verb')) ? notags(trim($arr['verb'])) : ''); - $arr['object-type'] = ((x($arr,'object-type')) ? notags(trim($arr['object-type'])) : ''); + $arr['obj_type'] = ((x($arr,'obj_type')) ? notags(trim($arr['obj_type'])) : ''); $arr['object'] = ((x($arr,'object')) ? trim($arr['object']) : ''); - $arr['target-type'] = ((x($arr,'target-type')) ? notags(trim($arr['target-type'])) : ''); + $arr['tgt_type'] = ((x($arr,'tgt_type')) ? notags(trim($arr['tgt_type'])) : ''); $arr['target'] = ((x($arr,'target')) ? trim($arr['target']) : ''); $arr['plink'] = ((x($arr,'plink')) ? notags(trim($arr['plink'])) : ''); $arr['allow_cid'] = ((x($arr,'allow_cid')) ? trim($arr['allow_cid']) : ''); @@ -960,8 +960,8 @@ function item_store($arr,$force_parent = false) { $arr['origin'] = ((x($arr,'origin')) ? intval($arr['origin']) : 0 ); - $arr['thr-parent'] = $arr['parent-uri']; - if($arr['parent-uri'] === $arr['uri']) { + $arr['thr-parent'] = $arr['parent_uri']; + if($arr['parent_uri'] === $arr['uri']) { $parent_id = 0; $parent_deleted = 0; $allow_cid = $arr['allow_cid']; @@ -975,7 +975,7 @@ function item_store($arr,$force_parent = false) { // and anything else we need to inherit $r = q("SELECT * FROM `item` WHERE `uri` = '%s' AND `uid` = %d ORDER BY `id` ASC LIMIT 1", - dbesc($arr['parent-uri']), + dbesc($arr['parent_uri']), intval($arr['uid']) ); @@ -985,12 +985,12 @@ function item_store($arr,$force_parent = false) { // even though we don't support it now, preserve the info // and re-attach to the conversation parent. - if($r[0]['uri'] != $r[0]['parent-uri']) { - $arr['parent-uri'] = $r[0]['parent-uri']; - $z = q("SELECT * FROM `item` WHERE `uri` = '%s' AND `parent-uri` = '%s' AND `uid` = %d + if($r[0]['uri'] != $r[0]['parent_uri']) { + $arr['parent_uri'] = $r[0]['parent_uri']; + $z = q("SELECT * FROM `item` WHERE `uri` = '%s' AND `parent_uri` = '%s' AND `uid` = %d ORDER BY `id` ASC LIMIT 1", - dbesc($r[0]['parent-uri']), - dbesc($r[0]['parent-uri']), + dbesc($r[0]['parent_uri']), + dbesc($r[0]['parent_uri']), intval($arr['uid']) ); if($z && count($z)) @@ -1027,7 +1027,7 @@ function item_store($arr,$force_parent = false) { if($force_parent) { logger('item_store: $force_parent=true, reply converted to top-level post.'); $parent_id = 0; - $arr['parent-uri'] = $arr['uri']; + $arr['parent_uri'] = $arr['uri']; $arr['gravity'] = 0; } else { @@ -1097,7 +1097,7 @@ function item_store($arr,$force_parent = false) { ); } - if((! $parent_id) || ($arr['parent-uri'] === $arr['uri'])) + if((! $parent_id) || ($arr['parent_uri'] === $arr['uri'])) $parent_id = $current_post; if(strlen($allow_cid) || strlen($allow_gid) || strlen($deny_cid) || strlen($deny_gid)) @@ -1737,7 +1737,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) if(! $item['deleted']) logger('consume_feed: deleting item ' . $item['id'] . ' uri=' . $item['uri'], LOGGER_DEBUG); - if(($item['verb'] === ACTIVITY_TAG) && ($item['object-type'] === ACTIVITY_OBJ_TAGTERM)) { + if(($item['verb'] === ACTIVITY_TAG) && ($item['obj_type'] === ACTIVITY_OBJ_TAGTERM)) { $xo = parse_xml_string($item['object'],false); $xt = parse_xml_string($item['target'],false); if($xt->type === ACTIVITY_OBJ_NOTE) { @@ -1772,10 +1772,10 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) } } - if($item['uri'] == $item['parent-uri']) { + if($item['uri'] == $item['parent_uri']) { $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s', `body` = '', `title` = '' - WHERE `parent-uri` = '%s' AND `uid` = %d", + WHERE `parent_uri` = '%s' AND `uid` = %d", dbesc($when), dbesc(datetime_convert()), dbesc($item['uri']), @@ -1870,14 +1870,14 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) } - $datarray['parent-uri'] = $parent_uri; + $datarray['parent_uri'] = $parent_uri; $datarray['uid'] = $importer['uid']; $datarray['contact-id'] = $contact['id']; if((activity_match($datarray['verb'],ACTIVITY_LIKE)) || (activity_match($datarray['verb'],ACTIVITY_DISLIKE))) { $datarray['type'] = 'activity'; $datarray['gravity'] = GRAVITY_LIKE; // only one like or dislike per person - $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent-uri` = '%s' OR `thr-parent` = '%s') limit 1", + $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent_uri` = '%s' OR `thr-parent` = '%s') limit 1", intval($datarray['uid']), intval($datarray['contact-id']), dbesc($datarray['verb']), @@ -1888,7 +1888,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) continue; } - if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) { + if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['obj_type'] === ACTIVITY_OBJ_TAGTERM)) { $xo = parse_xml_string($datarray['object'],false); $xt = parse_xml_string($datarray['target'],false); @@ -1941,7 +1941,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) // special handling for events - if((x($datarray,'object-type')) && ($datarray['object-type'] === ACTIVITY_OBJ_EVENT)) { + if((x($datarray,'obj_type')) && ($datarray['obj_type'] === ACTIVITY_OBJ_EVENT)) { $ev = bbtoevent($datarray['body']); if(x($ev,'desc') && x($ev,'start')) { $ev['uid'] = $importer['uid']; @@ -2020,7 +2020,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) $datarray['wall'] = 1; } - $datarray['parent-uri'] = $item_id; + $datarray['parent_uri'] = $item_id; $datarray['uid'] = $importer['uid']; $datarray['contact-id'] = $contact['id']; @@ -2322,7 +2322,7 @@ function local_delivery($importer,$data) { $msg['seen'] = 0; $msg['replied'] = 0; $msg['uri'] = notags(unxmlify($base['id'][0]['data'])); - $msg['parent-uri'] = notags(unxmlify($base['in-reply-to'][0]['data'])); + $msg['parent_uri'] = notags(unxmlify($base['in-reply-to'][0]['data'])); $msg['created'] = datetime_convert(notags(unxmlify('UTC','UTC',$base['sentdate'][0]['data']))); dbesc_array($msg); @@ -2396,7 +2396,7 @@ function local_delivery($importer,$data) { intval($importer['importer_uid']) ); if(count($r)) { - $parent_uri = $r[0]['parent-uri']; + $parent_uri = $r[0]['parent_uri']; if($r[0]['id'] != $r[0]['parent']) $is_reply = true; } @@ -2420,7 +2420,7 @@ function local_delivery($importer,$data) { $r = q("select `item`.`id`, `item`.`uri`, `item`.`forum_mode`,`item`.`origin`,`item`.`wall`, `contact`.`name`, `contact`.`url`, `contact`.`thumb` from `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - WHERE `item`.`uri` = '%s' AND (`item`.`parent-uri` = '%s' or `item`.`thr-parent` = '%s') + WHERE `item`.`uri` = '%s' AND (`item`.`parent_uri` = '%s' or `item`.`thr-parent` = '%s') AND `item`.`uid` = %d $sql_extra LIMIT 1", @@ -2464,7 +2464,7 @@ function local_delivery($importer,$data) { logger('local_delivery: deleting item ' . $item['id'] . ' uri=' . $item['uri'], LOGGER_DEBUG); - if(($item['verb'] === ACTIVITY_TAG) && ($item['object-type'] === ACTIVITY_OBJ_TAGTERM)) { + if(($item['verb'] === ACTIVITY_TAG) && ($item['obj_type'] === ACTIVITY_OBJ_TAGTERM)) { $xo = parse_xml_string($item['object'],false); $xt = parse_xml_string($item['target'],false); @@ -2501,10 +2501,10 @@ function local_delivery($importer,$data) { } } - if($item['uri'] == $item['parent-uri']) { + if($item['uri'] == $item['parent_uri']) { $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s', `body` = '', `title` = '' - WHERE `parent-uri` = '%s' AND `uid` = %d", + WHERE `parent_uri` = '%s' AND `uid` = %d", dbesc($when), dbesc(datetime_convert()), dbesc($item['uri']), @@ -2562,7 +2562,7 @@ function local_delivery($importer,$data) { $r = q("select `item`.`id`, `item`.`uri`, `item`.`forum_mode`,`item`.`origin`,`item`.`wall`, `contact`.`name`, `contact`.`url`, `contact`.`thumb` from `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - WHERE `item`.`uri` = '%s' AND (`item`.`parent-uri` = '%s' or `item`.`thr-parent` = '%s') + WHERE `item`.`uri` = '%s' AND (`item`.`parent_uri` = '%s' or `item`.`thr-parent` = '%s') AND `item`.`uid` = %d $sql_extra LIMIT 1", @@ -2642,7 +2642,7 @@ function local_delivery($importer,$data) { $datarray['type'] = 'remote-comment'; $datarray['wall'] = 1; - $datarray['parent-uri'] = $parent_uri; + $datarray['parent_uri'] = $parent_uri; $datarray['uid'] = $importer['importer_uid']; $datarray['owner-name'] = $own[0]['name']; $datarray['owner-link'] = $own[0]['url']; @@ -2655,19 +2655,19 @@ function local_delivery($importer,$data) { $datarray['gravity'] = GRAVITY_LIKE; // only one like or dislike per person - $r = q("select id from item where uid = %d and `contact-id` = %d and verb = '%s' and (`thr-parent` = '%s' or `parent-uri` = '%s') and deleted = 0 limit 1", + $r = q("select id from item where uid = %d and `contact-id` = %d and verb = '%s' and (`thr-parent` = '%s' or `parent_uri` = '%s') and deleted = 0 limit 1", intval($datarray['uid']), intval($datarray['contact-id']), dbesc($datarray['verb']), - dbesc($datarray['parent-uri']), - dbesc($datarray['parent-uri']) + dbesc($datarray['parent_uri']), + dbesc($datarray['parent_uri']) ); if($r && count($r)) continue; } - if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) { + if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['obj_type'] === ACTIVITY_OBJ_TAGTERM)) { $xo = parse_xml_string($datarray['object'],false); $xt = parse_xml_string($datarray['target'],false); @@ -2717,13 +2717,13 @@ function local_delivery($importer,$data) { $parent = 0; if($posted_id) { - $r = q("SELECT `parent`, `parent-uri` FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1", + $r = q("SELECT `parent`, `parent_uri` FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($posted_id), intval($importer['importer_uid']) ); if(count($r)) { $parent = $r[0]['parent']; - $parent_uri = $r[0]['parent-uri']; + $parent_uri = $r[0]['parent_uri']; } if(! $is_like) { @@ -2807,14 +2807,14 @@ function local_delivery($importer,$data) { continue; } - $datarray['parent-uri'] = $parent_uri; + $datarray['parent_uri'] = $parent_uri; $datarray['uid'] = $importer['importer_uid']; $datarray['contact-id'] = $importer['id']; if(($datarray['verb'] == ACTIVITY_LIKE) || ($datarray['verb'] == ACTIVITY_DISLIKE)) { $datarray['type'] = 'activity'; $datarray['gravity'] = GRAVITY_LIKE; // only one like or dislike per person - $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent-uri` = '%s' OR `thr-parent` = '%s') limit 1", + $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent_uri` = '%s' OR `thr-parent` = '%s') limit 1", intval($datarray['uid']), intval($datarray['contact-id']), dbesc($datarray['verb']), @@ -2826,7 +2826,7 @@ function local_delivery($importer,$data) { } - if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) { + if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['obj_type'] === ACTIVITY_OBJ_TAGTERM)) { $xo = parse_xml_string($datarray['object'],false); $xt = parse_xml_string($datarray['target'],false); @@ -2857,7 +2857,7 @@ function local_delivery($importer,$data) { if(!x($datarray['type']) || $datarray['type'] != 'activity') { - $myconv = q("SELECT `author-link`, `author-avatar`, `parent` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `parent` != 0 AND `deleted` = 0", + $myconv = q("SELECT `author-link`, `author-avatar`, `parent` FROM `item` WHERE `parent_uri` = '%s' AND `uid` = %d AND `parent` != 0 AND `deleted` = 0", dbesc($parent_uri), intval($importer['importer_uid']) ); @@ -2918,7 +2918,7 @@ function local_delivery($importer,$data) { $item_id = $item->get_id(); $datarray = get_atom_elements($feed,$item); - if((x($datarray,'object-type')) && ($datarray['object-type'] === ACTIVITY_OBJ_EVENT)) { + if((x($datarray,'obj_type')) && ($datarray['obj_type'] === ACTIVITY_OBJ_EVENT)) { $ev = bbtoevent($datarray['body']); if(x($ev,'desc') && x($ev,'start')) { $ev['cid'] = $importer['id']; @@ -2970,7 +2970,7 @@ function local_delivery($importer,$data) { if($importer['remote_self']) $datarray['wall'] = 1; - $datarray['parent-uri'] = $item_id; + $datarray['parent_uri'] = $item_id; $datarray['uid'] = $importer['importer_uid']; $datarray['contact-id'] = $importer['id']; @@ -3250,8 +3250,8 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) { if(strlen($item['owner-name'])) $o .= atom_author('dfrn:owner',$item['owner-name'],$item['owner-link'],80,80,$item['owner-avatar']); - if(($item['parent'] != $item['id']) || ($item['parent-uri'] !== $item['uri']) || (($item['thr-parent'] !== '') && ($item['thr-parent'] !== $item['uri']))) { - $parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']); + if(($item['parent'] != $item['id']) || ($item['parent_uri'] !== $item['uri']) || (($item['thr-parent'] !== '') && ($item['thr-parent'] !== $item['uri']))) { + $parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent_uri']); $o .= '' . "\r\n"; } @@ -3659,12 +3659,12 @@ function drop_item($id,$interactive = true) { // If it's the parent of a comment thread, kill all the kids - if($item['uri'] == $item['parent-uri']) { + if($item['uri'] == $item['parent_uri']) { $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s', `body` = '' , `title` = '' - WHERE `parent-uri` = '%s' AND `uid` = %d ", + WHERE `parent_uri` = '%s' AND `uid` = %d ", dbesc(datetime_convert()), dbesc(datetime_convert()), - dbesc($item['parent-uri']), + dbesc($item['parent_uri']), intval($item['uid']) ); // ignore the result diff --git a/include/message.php b/include/message.php index 377d7c715..0f31b116a 100644 --- a/include/message.php +++ b/include/message.php @@ -36,7 +36,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){ if(strlen($replyto)) { $reply = true; - $r = q("select convid from mail where uid = %d and ( uri = '%s' or `parent-uri` = '%s' ) limit 1", + $r = q("select convid from mail where uid = %d and ( uri = '%s' or `parent_uri` = '%s' ) limit 1", intval(local_user()), dbesc($replyto), dbesc($replyto) @@ -88,7 +88,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){ $r = q("INSERT INTO `mail` ( `uid`, `guid`, `convid`, `from-name`, `from-photo`, `from-url`, - `contact-id`, `title`, `body`, `seen`, `reply`, `replied`, `uri`, `parent-uri`, `created`) + `contact-id`, `title`, `body`, `seen`, `reply`, `replied`, `uri`, `parent_uri`, `created`) VALUES ( %d, '%s', %d, '%s', '%s', '%s', %d, '%s', '%s', %d, %d, %d, '%s', '%s', '%s' )", intval(local_user()), dbesc(get_guid()), @@ -217,7 +217,7 @@ function send_wallmessage($recipient='', $body='', $subject='', $replyto=''){ } $r = q("INSERT INTO `mail` ( `uid`, `guid`, `convid`, `from-name`, `from-photo`, `from-url`, - `contact-id`, `title`, `body`, `seen`, `reply`, `replied`, `uri`, `parent-uri`, `created`, `unknown`) + `contact-id`, `title`, `body`, `seen`, `reply`, `replied`, `uri`, `parent_uri`, `created`, `unknown`) VALUES ( %d, '%s', %d, '%s', '%s', '%s', %d, '%s', '%s', %d, %d, %d, '%s', '%s', '%s', %d )", intval($recipient['uid']), dbesc(get_guid()), diff --git a/include/notifier.php b/include/notifier.php index e6523f147..27f178fe0 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -170,7 +170,7 @@ function notifier_run($argv, $argc){ $item['deleted'] = 1; } - if((count($items) == 1) && ($items[0]['id'] === $target_item['id']) && ($items[0]['uri'] === $items[0]['parent-uri'])) { + if((count($items) == 1) && ($items[0]['id'] === $target_item['id']) && ($items[0]['uri'] === $items[0]['parent_uri'])) { logger('notifier: top level post'); $top_level = true; } @@ -365,7 +365,7 @@ function notifier_run($argv, $argc){ '$subject' => xmlify($item['title']), '$created' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)), '$content' => xmlify($body), - '$parent_id' => xmlify($item['parent-uri']) + '$parent_id' => xmlify($item['parent_uri']) )); } elseif($fsuggest) { -- cgit v1.2.3