Continued rewriting:
- use dba::is_result() everywhere (where I found the old, bad way) - converted some spaces -> tabs for code - converted some CRLF -> LF as mixures of both is not good Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
@@ -39,7 +39,7 @@ function poco_load($cid,$uid = 0,$zcid = 0,$url = null) {
|
||||
$r = q("select `poco`, `uid` from `contact` where `id` = %d limit 1",
|
||||
intval($cid)
|
||||
);
|
||||
if(count($r)) {
|
||||
if(dba::is_result($r)) {
|
||||
$url = $r[0]['poco'];
|
||||
$uid = $r[0]['uid'];
|
||||
}
|
||||
@@ -205,14 +205,14 @@ function poco_check($profile_url, $name, $network, $profile_photo, $about, $loca
|
||||
$r = q("SELECT `network` FROM `contact` WHERE `nurl` = '%s' AND `network` != '' AND `network` != '%s' LIMIT 1",
|
||||
dbesc(normalise_link($profile_url)), dbesc(NETWORK_STATUSNET)
|
||||
);
|
||||
if(count($r))
|
||||
if(dba::is_result($r))
|
||||
$network = $r[0]["network"];
|
||||
|
||||
if (($network == "") OR ($network == NETWORK_OSTATUS)) {
|
||||
$r = q("SELECT `network`, `url` FROM `contact` WHERE `alias` IN ('%s', '%s') AND `network` != '' AND `network` != '%s' LIMIT 1",
|
||||
dbesc($profile_url), dbesc(normalise_link($profile_url)), dbesc(NETWORK_STATUSNET)
|
||||
);
|
||||
if(count($r)) {
|
||||
if(dba::is_result($r)) {
|
||||
$network = $r[0]["network"];
|
||||
//$profile_url = $r[0]["url"];
|
||||
}
|
||||
@@ -948,7 +948,7 @@ function count_common_friends($uid,$cid) {
|
||||
);
|
||||
|
||||
// logger("count_common_friends: $uid $cid {$r[0]['total']}");
|
||||
if(count($r))
|
||||
if(dba::is_result($r))
|
||||
return $r[0]['total'];
|
||||
return 0;
|
||||
|
||||
@@ -994,7 +994,7 @@ function count_common_friends_zcid($uid,$zcid) {
|
||||
intval($uid)
|
||||
);
|
||||
|
||||
if(count($r))
|
||||
if(dba::is_result($r))
|
||||
return $r[0]['total'];
|
||||
return 0;
|
||||
|
||||
@@ -1033,7 +1033,7 @@ function count_all_friends($uid,$cid) {
|
||||
intval($uid)
|
||||
);
|
||||
|
||||
if(count($r))
|
||||
if(dba::is_result($r))
|
||||
return $r[0]['total'];
|
||||
return 0;
|
||||
|
||||
@@ -1162,7 +1162,7 @@ function update_suggestions() {
|
||||
dbesc(NETWORK_DFRN), dbesc(NETWORK_DIASPORA)
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
if(dba::is_result($r)) {
|
||||
foreach($r as $rr) {
|
||||
$base = substr($rr['poco'],0,strrpos($rr['poco'],'/'));
|
||||
if(! in_array($base,$done))
|
||||
|
||||
Reference in New Issue
Block a user