if (x($_SESSION,'return_url')) {
goaway('' . $_SESSION['return_url']);
- }
- else {
+ } else {
goaway('contacts');
}
$ffi_keyword_blacklist = escape_tags(trim($_POST['ffi_keyword_blacklist']));
$priority = intval($_POST['poll']);
- if($priority > 5 || $priority < 0)
+
+ if ($priority > 5 || $priority < 0) {
$priority = 0;
+ }
$info = escape_tags(trim($_POST['info']));
intval($contact_id),
intval(local_user())
);
- if($r)
+ if ($r) {
info( t('Contact updated.') . EOL);
- else
+ } else {
notice( t('Failed to update contact record.') . EOL);
+ }
- $r = q("select * from contact where id = %d and uid = %d limit 1",
+ $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($contact_id),
intval(local_user())
);
- if($r && dbm::is_result($r))
+
+ if (dbm::is_result($r)) {
$a->data['contact'] = $r[0];
+ }
return;
}
}
- 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"]));
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())
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;
}
// );
//}
- if($r)
+ if ($r) {
info( t('Conversation removed.') . EOL );
+ }
}
//goaway(App::get_baseurl(true) . '/message' );
goaway($_SESSION['return_url']);
intval($a->argv[2]),
intval(local_user())
);
- if($r)
+ if ($r) {
info(t('Profile deleted.').EOL);
+ }
goaway('profiles');
return; // NOTREACHED
intval(local_user())
);
- if($r)
+ if ($r) {
info( t('Profile updated.') . EOL);
+ }
- if($namechanged && $is_default) {
+ if ($namechanged && $is_default) {
$r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
dbesc($name),
dbesc(datetime_convert()),
);
}
- if($is_default) {
+ if ($is_default) {
$location = formatted_location(array("locality" => $locality, "region" => $region, "country-name" => $country_name));
q("UPDATE `contact` SET `about` = '%s', `location` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `self` AND `uid` = %d",
dbesc($password),
intval(local_user())
);
- if($r) {
+ if ($r) {
info( t('Password changed.') . EOL);
} else {
notice( t('Password update failed. Please try again.') . EOL);
dbesc($language),
intval(local_user())
);
- if($r)
+ if ($r) {
info( t('Settings updated.') . EOL);
+ }
// clear session language
unset($_SESSION['language']);
);
- if($name_change) {
+ if ($name_change) {
q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `self`",
dbesc($username),
dbesc(datetime_convert()),
if($width > 640 || $height > 640) {
$ph->scaleImage(640);
$r = $ph->store($page_owner_uid, $visitor, $hash, $filename, t('Wall Photos'), 1, 0, $defperm);
- if($r)
+ if ($r)
$smallest = 1;
}
- if($width > 320 || $height > 320) {
+ if ($width > 320 || $height > 320) {
$ph->scaleImage(320);
$r = $ph->store($page_owner_uid, $visitor, $hash, $filename, t('Wall Photos'), 2, 0, $defperm);
- if($r AND ($smallest == 0))
+ if ($r AND ($smallest == 0))
$smallest = 2;
}
if (!$desktopmode) {
$r = q("SELECT `id`, `datasize`, `width`, `height`, `type` FROM `photo` WHERE `resource-id` = '%s' ORDER BY `width` DESC LIMIT 1", $hash);
- if (!$r){
+ if (!dbm::is_result($r)) {
if ($r_json) {
echo json_encode(array('error'=>''));
killme();