added spaces + some curly braces + some usage of dbm::is_result()

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-04-04 19:47:45 +02:00 committed by Roland Häder
parent cdff732044
commit 299c0122f6
No known key found for this signature in database
GPG Key ID: B72F8185C6C7BD78
8 changed files with 112 additions and 102 deletions

View File

@ -271,6 +271,7 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
if ($creator != "") {
$item["author-name"] = $creator;
}
/// @TODO ?
// <category>Ausland</category>
// <media:thumbnail width="152" height="76" url="http://www.taz.de/picture/667875/192/14388767.jpg"/>
@ -293,8 +294,9 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
$type = $attributes->textContent;
}
}
if(strlen($item["attach"]))
if (strlen($item["attach"])) {
$item["attach"] .= ',';
}
$attachments[] = array("link" => $href, "type" => $type, "length" => $length);

View File

@ -33,11 +33,13 @@ function gprobe_run(&$argv, &$argc){
$arr = probe_url($url);
if (is_null($result))
if (is_null($result)) {
Cache::set("gprobe:".$urlparts["host"], $arr);
}
if (!in_array($arr["network"], array(NETWORK_FEED, NETWORK_PHANTOM)))
if (!in_array($arr["network"], array(NETWORK_FEED, NETWORK_PHANTOM))) {
update_gcontact($arr);
}
$r = q("SELECT `id`, `url`, `network` FROM `gcontact` WHERE `nurl` = '%s' ORDER BY `id` LIMIT 1",
dbesc(normalise_link($url))

View File

@ -347,9 +347,10 @@ function groups_containing($uid,$c) {
$ret = array();
if (dbm::is_result($r)) {
foreach($r as $rr)
foreach ($r as $rr) {
$ret[] = $rr['gid'];
}
}
return $ret;
}

View File

@ -205,15 +205,17 @@ function profile_sidebar($profile, $block = 0) {
// This function can also use contact information in $profile
$is_contact = x($profile, 'cid');
if((! is_array($profile)) && (! count($profile)))
if ((! is_array($profile)) && (! count($profile))) {
return $o;
}
$profile['picdate'] = urlencode($profile['picdate']);
if (($profile['network'] != "") AND ($profile['network'] != NETWORK_DFRN)) {
$profile['network_name'] = format_network_name($profile['network'], $profile['url']);
} else
} else {
$profile['network_name'] = "";
}
call_hooks('profile_sidebar_enter', $profile);
@ -630,9 +632,7 @@ function advanced_profile(App $a) {
if ($a->profile['gender']) $profile['gender'] = array( t('Gender:'), $a->profile['gender'] );
if (($a->profile['dob']) && ($a->profile['dob'] > '0001-01-01')) {
$year_bd_format = t('j F, Y');
$short_bd_format = t('j F');
@ -881,16 +881,20 @@ function zrl_init(App $a) {
}
function zrl($s,$force = false) {
if(! strlen($s))
if (! strlen($s)) {
return $s;
if((! strpos($s,'/profile/')) && (! $force))
}
if ((! strpos($s,'/profile/')) && (! $force)) {
return $s;
if($force && substr($s,-1,1) !== '/')
}
if ($force && substr($s,-1,1) !== '/') {
$s = $s . '/';
}
$achar = strpos($s,'?') ? '&' : '?';
$mine = get_my_url();
if($mine and ! link_compare($mine,$s))
if ($mine and ! link_compare($mine,$s)) {
return $s . $achar . 'zrl=' . urlencode($mine);
}
return $s;
}
@ -911,9 +915,10 @@ function zrl($s,$force = false) {
function get_theme_uid() {
$uid = (($_REQUEST['puid']) ? intval($_REQUEST['puid']) : 0);
if (local_user()) {
if((get_pconfig(local_user(),'system','always_my_theme')) || (! $uid))
if ((get_pconfig(local_user(),'system','always_my_theme')) || (! $uid)) {
return local_user();
}
}
return $uid;
}