Merge pull request #3375 from Quix0r/rewrites/coding-convention-split2-3-2

Coding convention applied split 2-3-2 (of 2-14-2)
This commit is contained in:
Hypolite Petovan 2017-04-22 09:11:18 -04:00 committed by GitHub
commit 0f67934e05
10 changed files with 137 additions and 129 deletions

View file

@ -590,7 +590,7 @@ function update_contact_birthdays() {
// This only handles foreign or alien networks where a birthday has been provided.
// In-network birthdays are handled within local_delivery
$r = q("SELECT * FROM contact WHERE `bd` != '' AND `bd` > '0001-01-01' AND SUBSTRING(`bd`,1,4) != `bdyear` ");
$r = q("SELECT * FROM `contact` WHERE `bd` != '' AND `bd` > '0001-01-01' AND SUBSTRING(`bd`, 1, 4) != `bdyear` ");
if (dbm::is_result($r)) {
foreach ($r as $rr) {
@ -598,14 +598,12 @@ function update_contact_birthdays() {
$nextbd = datetime_convert('UTC','UTC','now','Y') . substr($rr['bd'], 4);
/**
*
/*
* Add new birthday event for this person
*
* $bdtext is just a readable placeholder in case the event is shared
* with others. We will replace it during presentation to our $importer
* to contain a sparkle link and perhaps a photo.
*
*/
// Check for duplicates
@ -638,7 +636,6 @@ function update_contact_birthdays() {
// update bdyear
q("UPDATE `contact` SET `bdyear` = '%s', `bd` = '%s' WHERE `uid` = %d AND `id` = %d",
dbesc(substr($nextbd,0,4)),
dbesc($nextbd),

View file

@ -82,6 +82,7 @@ function format_event_html($ev, $simple = false) {
}
/*
@TODO old-lost code found?
function parse_event($h) {
require_once('include/Scrape.php');

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;
}