1
0
Fork 0

more coding convention applied:

- added curly braces
- added spaces where needed
- $r only needs to be tested with dbm::is_result()
- made SQL keywords all uper-case

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-01-23 09:50:25 +01:00 committed by Roland Haeder
commit 63e4750b4a
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
6 changed files with 38 additions and 26 deletions

View file

@ -20,10 +20,11 @@ function crepair_init(App $a) {
}
}
if(! x($a->page,'aside'))
if (! x($a->page,'aside')) {
$a->page['aside'] = '';
}
if($contact_id) {
if ($contact_id) {
$a->data['contact'] = $r[0];
$contact = $r[0];
profile_load($a, "", 0, get_contact_details_by_url($contact["url"]));
@ -35,9 +36,12 @@ function crepair_post(App $a) {
return;
}
// Init $r here if $cid is not set
$r = false;
$cid = (($a->argc > 1) ? intval($a->argv[1]) : 0);
if($cid) {
if ($cid) {
$r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($cid),
intval(local_user())
@ -78,18 +82,18 @@ function crepair_post(App $a) {
local_user()
);
if($photo) {
if ($photo) {
logger('mod-crepair: updating photo from ' . $photo);
require_once("include/Photo.php");
update_contact_avatar($photo,local_user(),$contact['id']);
}
if($r)
if ($r) {
info( t('Contact settings applied.') . EOL);
else
} else {
notice( t('Contact update failed.') . EOL);
}
return;
}