added spaces + some curly braces

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-01-26 16:01:56 +01:00 committed by Roland Haeder
parent 0cd241bcbe
commit 41a36606c6
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
60 changed files with 1018 additions and 930 deletions

View file

@ -35,8 +35,8 @@ function poco_load($cid,$uid = 0,$zcid = 0,$url = null) {
$a = get_app();
if($cid) {
if((! $url) || (! $uid)) {
if ($cid) {
if ((! $url) || (! $uid)) {
$r = q("select `poco`, `uid` from `contact` where `id` = %d limit 1",
intval($cid)
);
@ -45,11 +45,11 @@ function poco_load($cid,$uid = 0,$zcid = 0,$url = null) {
$uid = $r[0]['uid'];
}
}
if(! $uid)
if (! $uid)
return;
}
if(! $url)
if (! $url)
return;
$url = $url . (($uid) ? '/@me/@all?fields=displayName,urls,photos,updated,network,aboutMe,currentLocation,tags,gender,contactType,generation' : '?fields=displayName,urls,photos,updated,network,aboutMe,currentLocation,tags,gender,contactType,generation') ;
@ -62,14 +62,14 @@ function poco_load($cid,$uid = 0,$zcid = 0,$url = null) {
logger('poco_load: return code: ' . $a->get_curl_code(), LOGGER_DEBUG);
if(($a->get_curl_code() > 299) || (! $s))
if (($a->get_curl_code() > 299) || (! $s))
return;
$j = json_decode($s);
logger('poco_load: json: ' . print_r($j,true),LOGGER_DATA);
if(! isset($j->entry))
if (! isset($j->entry))
return;
$total = 0;
@ -340,7 +340,7 @@ function poco_check($profile_url, $name, $network, $profile_photo, $about, $loca
$gcid = update_gcontact($gcontact);
if(!$gcid)
if (!$gcid)
return $gcid;
$r = q("SELECT * FROM `glink` WHERE `cid` = %d AND `uid` = %d AND `gcid` = %d AND `zcid` = %d LIMIT 1",
@ -1076,10 +1076,10 @@ function poco_check_server($server_url, $network = "", $force = false) {
}
$lines = explode("\n",$serverret["header"]);
if(count($lines)) {
foreach($lines as $line) {
if (count($lines)) {
foreach ($lines as $line) {
$line = trim($line);
if(stristr($line,'X-Diaspora-Version:')) {
if (stristr($line,'X-Diaspora-Version:')) {
$platform = "Diaspora";
$version = trim(str_replace("X-Diaspora-Version:", "", $line));
$version = trim(str_replace("x-diaspora-version:", "", $version));
@ -1089,7 +1089,7 @@ function poco_check_server($server_url, $network = "", $force = false) {
$last_contact = datetime_convert();
}
if(stristr($line,'Server: Mastodon')) {
if (stristr($line,'Server: Mastodon')) {
$platform = "Mastodon";
$network = NETWORK_OSTATUS;
// Mastodon doesn't reveal version numbers
@ -1368,7 +1368,7 @@ function count_common_friends($uid,$cid) {
function common_friends($uid,$cid,$start = 0,$limit=9999,$shuffle = false) {
if($shuffle)
if ($shuffle)
$sql_extra = " order by rand() ";
else
$sql_extra = " order by `gcontact`.`name` asc ";
@ -1413,7 +1413,7 @@ function count_common_friends_zcid($uid,$zcid) {
function common_friends_zcid($uid,$zcid,$start = 0, $limit = 9999,$shuffle = false) {
if($shuffle)
if ($shuffle)
$sql_extra = " order by rand() ";
else
$sql_extra = " order by `gcontact`.`name` asc ";
@ -1594,7 +1594,7 @@ function update_suggestions() {
if (dbm::is_result($r)) {
foreach ($r as $rr) {
$base = substr($rr['poco'],0,strrpos($rr['poco'],'/'));
if(! in_array($base,$done))
if (! in_array($base,$done))
poco_load(0,0,0,$base);
}
}
@ -1632,7 +1632,7 @@ function poco_discover_federation() {
if ($last) {
$next = $last + (24 * 60 * 60);
if($next > time())
if ($next > time())
return;
}
@ -1818,31 +1818,31 @@ function poco_discover_server($data, $default_generation = 0) {
$updated = date("Y-m-d H:i:s", strtotime($entry->updated));
}
if(isset($entry->network)) {
if (isset($entry->network)) {
$network = $entry->network;
}
if(isset($entry->currentLocation)) {
if (isset($entry->currentLocation)) {
$location = $entry->currentLocation;
}
if(isset($entry->aboutMe)) {
if (isset($entry->aboutMe)) {
$about = html2bbcode($entry->aboutMe);
}
if(isset($entry->gender)) {
if (isset($entry->gender)) {
$gender = $entry->gender;
}
if(isset($entry->generation) AND ($entry->generation > 0)) {
if (isset($entry->generation) AND ($entry->generation > 0)) {
$generation = ++$entry->generation;
}
if(isset($entry->contactType) AND ($entry->contactType >= 0)) {
if (isset($entry->contactType) AND ($entry->contactType >= 0)) {
$contact_type = $entry->contactType;
}
if(isset($entry->tags)) {
if (isset($entry->tags)) {
foreach ($entry->tags as $tag) {
$keywords = implode(", ", $tag);
}