X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2FContact.php;h=9f0dd45c5bd9d2e76a85ee54d803e490b67631c2;hb=28b2e599fb6ee3ee9ca0f3e3791482686cdbb902;hp=b1f63cbdfd883c1938a7c3d359550f0322b50fd4;hpb=ca734f168caaa3a9fb66fd7ada6ecc26e1299ae6;p=friendica.git diff --git a/include/Contact.php b/include/Contact.php index b1f63cbdfd..9f0dd45c5b 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -85,7 +85,7 @@ function contact_remove($id) { function terminate_friendship($user,$self,$contact) { - /// @TODO Get rid of this, include/datetime.php should care about by itself + /// @TODO Get rid of this, include/datetime.php should care about it by itself $a = get_app(); require_once('include/datetime.php'); @@ -226,14 +226,14 @@ function get_contact_details_by_url($url, $uid = -1, $default = array()) { dbesc(normalise_link($url)), intval($uid)); // Fetch the data from the contact table with "uid=0" (which is filled automatically) - if (!$r) + if (!dbm::is_result($r)) $r = q("SELECT `id`, 0 AS `cid`, `id` AS `zid`, 0 AS `gid`, `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, `xmpp`, `keywords`, `gender`, `photo`, `thumb`, `micro`, `forum`, `prv`, (`forum` | `prv`) AS `community`, `contact-type`, `bd` AS `birthday`, 0 AS `self` FROM `contact` WHERE `nurl` = '%s' AND `uid` = 0", dbesc(normalise_link($url))); // Fetch the data from the gcontact table - if (!$r) + if (!dbm::is_result($r)) $r = q("SELECT 0 AS `id`, 0 AS `cid`, `id` AS `gid`, 0 AS `zid`, 0 AS `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, '' AS `xmpp`, `keywords`, `gender`, `photo`, `photo` AS `thumb`, `photo` AS `micro`, `community` AS `forum`, 0 AS `prv`, `community`, `contact-type`, `birthday`, 0 AS `self` FROM `gcontact` WHERE `nurl` = '%s'", @@ -636,7 +636,7 @@ function posts_from_gcontact($a, $gcontact_id) { $r = q("SELECT `item`.`uri`, `item`.*, `item`.`id` AS `item_id`, `author-name` AS `name`, `owner-avatar` AS `photo`, `owner-link` AS `url`, `owner-avatar` AS `thumb` - FROM `item` FORCE INDEX (`gcontactid_uid_created`) + FROM `item` WHERE `gcontact-id` = %d AND $sql AND NOT `deleted` AND NOT `moderated` AND `visible` ORDER BY `item`.`created` DESC LIMIT %d, %d",