X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconversation.php;h=916a9e229e4bac1190889e5385087ed49e842cc0;hb=98b727029570b96febd0c5046b688cab1a9bb882;hp=eba2abdd41142dda2adcc6feb048a2f92abee115;hpb=cfea3cce7770fb518b408b84cc4ab7e8d6cb9116;p=friendica.git diff --git a/include/conversation.php b/include/conversation.php index eba2abdd41..916a9e229e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -109,7 +109,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'])); - if(count($r)==0) return; + if (!dbm::is_result($r)) return; $obj=$r[0]; $author = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]'; @@ -245,7 +245,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'])); - if(count($r)==0) return; + if (!dbm::is_result($r)) return; $obj=$r[0]; $author = '[url=' . zrl($item['author-link']) . ']' . $item['author-name'] . '[/url]'; @@ -294,7 +294,7 @@ function localize_item(&$item){ dbesc($obj->id), intval($item['uid']) ); - if(count($r) && $r[0]['plink']) { + if (dbm::is_result($r) && $r[0]['plink']) { $target = $r[0]; $Bname = $target['author-name']; $Blink = $target['author-link']; @@ -439,7 +439,7 @@ These Fields are not added below (yet). They are here to for bug search. function item_joins() { return "STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND - NOT `contact`.`blocked` AND NOT `contact`.`pending` + (NOT `contact`.`blocked` OR `contact`.`pending`) LEFT JOIN `contact` AS `author` ON `author`.`id`=`item`.`author-id` LEFT JOIN `contact` AS `owner` ON `owner`.`id`=`item`.`owner-id`"; } @@ -864,7 +864,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { } $o = replace_macros($page_template, array( - '$baseurl' => $a->get_baseurl($ssl_state), + '$baseurl' => App::get_baseurl($ssl_state), '$return_path' => $a->query_string, '$live_update' => $live_update_div, '$remove' => t('remove'), @@ -1064,6 +1064,9 @@ function builtin_activity_puller($item, &$conv_responses) { else $conv_responses[$mode][$item['thr-parent']] ++; + if((local_user()) && (local_user() == $item['uid']) && ($item['self'])) + $conv_responses[$mode][$item['thr-parent'] . '-self'] = 1; + $conv_responses[$mode][$item['thr-parent'] . '-l'][] = $url; // there can only be one activity verb per item so if we found anything, we can stop looking @@ -1180,7 +1183,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { $tpl = get_markup_template('jot-header.tpl'); $a->page['htmlhead'] .= replace_macros($tpl, array( '$newpost' => 'true', - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => App::get_baseurl(true), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$geotag' => $geotag, '$nickname' => $x['nickname'], @@ -1198,7 +1201,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { $tpl = get_markup_template('jot-end.tpl'); $a->page['end'] .= replace_macros($tpl, array( '$newpost' => 'true', - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => App::get_baseurl(true), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$geotag' => $geotag, '$nickname' => $x['nickname'], @@ -1264,7 +1267,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) { '$ptyp' => (($notes_cid) ? 'note' : 'wall'), '$content' => $x['content'], '$post_id' => $x['post_id'], - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => App::get_baseurl(true), '$defloc' => $x['default_location'], '$visitor' => $x['visitor'], '$pvisit' => (($notes_cid) ? 'none' : $x['visitor']), @@ -1443,6 +1446,7 @@ function get_responses($conv_responses,$response_verbs,$ob,$item) { $ret[$v] = array(); $ret[$v]['count'] = ((x($conv_responses[$v],$item['uri'])) ? $conv_responses[$v][$item['uri']] : ''); $ret[$v]['list'] = ((x($conv_responses[$v],$item['uri'])) ? $conv_responses[$v][$item['uri'] . '-l'] : ''); + $ret[$v]['self'] = ((x($conv_responses[$v],$item['uri'])) ? $conv_responses[$v][$item['uri'] . '-self'] : '0'); if(count($ret[$v]['list']) > MAX_LIKERS) { $ret[$v]['list_part'] = array_slice($ret[$v]['list'], 0, MAX_LIKERS); array_push($ret[$v]['list_part'], '