} else {
$r = q("SELECT `contact`.`avatar-date` AS picdate FROM `contact` WHERE `contact`.`thumb` like '%%/%s'",
$common_filename);
- if(! dbm::is_result($r)){
+ if (! dbm::is_result($r)) {
$this->cached_profile_image[$avatar_image] = $avatar_image;
} else {
$this->cached_profile_picdate[$common_filename] = "?rev=".urlencode($r[0]['picdate']);
dbesc($owner_nick)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
killme();
+ }
$owner = $r[0];
$owner_id = $owner['uid'];
intval($owner_id)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
killme();
+ }
$contact = $r[0];
require_once('include/security.php');
intval($uid)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
$result['message'] .= t('Unable to retrieve contact information.') . EOL;
return $result;
}
return true; // You might question this, but
// we indicate success because the group member was in fact created
// -- It was just created at another time
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
$r = q("INSERT INTO `group_member` (`uid`, `gid`, `contact-id`)
VALUES( %d, %d, %d ) ",
intval($uid),
intval($gid),
intval($member)
- );
+ );
+ }
return $r;
}
intval($item['contact-id']),
intval($item['uid'])
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
return false;
+ }
if(! $r[0]['self'])
$remote_owner = $r[0];
}
);
$got_lock = true;
}
- elseif(! dbm::is_result($r)) { // the Boolean value for count($r) should be equivalent to the Boolean value of $r
+ elseif (! dbm::is_result($r)) {
+ /// @TODO the Boolean value for count($r) should be equivalent to the Boolean value of $r
q("INSERT INTO `locks` (`name`, `created`, `locked`) VALUES ('%s', '%s', 1)",
dbesc($fn_name),
dbesc(datetime_convert())
intval($uid)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
return;
+ }
$owner = $r[0];
$r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` INNER JOIN `user` on `contact`.`uid` = `user`.`uid` WHERE `user`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
intval($importer_uid)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
return;
+ }
$importer = $r[0];
dbesc($nurl)
);
- if((! dbm::is_result($r)) || $r[0]['id'] == remote_user())
+ if ((! dbm::is_result($r)) || $r[0]['id'] == remote_user()) {
return;
-
+ }
$r = q("SELECT * FROM contact WHERE nick = '%s'
AND network = '%s' AND uid = %d AND url LIKE '%%%s%%' LIMIT 1",
dbesc($baseurl)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
return;
+ }
$cid = $r[0]['id'];
intval($gcid),
intval($zcid)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
q("INSERT INTO `glink` (`cid`,`uid`,`gcid`,`zcid`, `updated`) VALUES (%d,%d,%d,%d, '%s') ",
intval($cid),
intval($uid),
intval($item),
intval($uid)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
return false;
+ }
q("UPDATE `item` SET `file` = '%s' WHERE `id` = %d AND `uid` = %d",
dbesc(str_replace($pattern,'',$r[0]['file'])),
//$r = q("select file from item where uid = %d and deleted = 0 " . file_tag_file_query('item',$file,(($cat) ? 'category' : 'file')),
//);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
$saved = get_pconfig($uid,'system','filetags');
set_pconfig($uid,'system','filetags',str_replace($pattern,'',$saved));
-
}
+
return true;
}
$r = all_friends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
$o .= t('No friends to display.');
return $o;
}
$r = q("SELECT * FROM `attach` WHERE `id` = %d LIMIT 1",
intval($item_id)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('Item was not found.'). EOL);
return;
}
dbesc($item_id)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('Permission denied.') . EOL);
return;
}
$r = common_friends_zcid($uid, $zcid, $a->pager['start'], $a->pager['itemspage']);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
return $o;
}
$r = community_getitems($a->pager['start'], $a->pager['itemspage']);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
info( t('No results.') . EOL);
return $o;
}
intval($a->argv[1]),
intval(local_user())
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
killme();
}
intval(local_user()),
intval($contact_id)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
$contact_id = 0;
}
}
intval($profile_id),
intval(local_user())
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('Could not locate selected profile.') . EOL);
return;
}
intval($group),
intval($_SESSION['uid'])
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
if($update)
killme();
notice( t('No such group') . EOL );
intval(local_user()),
intval($contact_id)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
$contact_id = 0;
}
}
);
}
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
return;
+ }
$contact = $r[0];
);
}
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('Contact not found.') . EOL);
return;
}
dbesc(NETWORK_DFRN)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('No potential page delegates located.') . EOL);
return;
}
intval($uid)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
logger('Contact not found in DB.');
notice( t('Contact not found.') . EOL );
notice( t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL );
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
dbesc($node));
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
$message = sprintf(t('No user record found for \'%s\' '), $node);
xml_status(3,$message); // failure
// NOTREACHED
dbesc($dfrn_pubkey),
intval($dfrn_record)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
$message = t('Unable to set your contact credentials on our system.');
xml_status(3,$message);
}
dbesc($dfrn_id),
dbesc($challenge)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
logger('dfrn_notify: could not match challenge to dfrn_id ' . $dfrn_id . ' challenge=' . $challenge);
xml_status(3);
}
dbesc($a->argv[1])
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
logger('dfrn_notify: contact not found for dfrn_id ' . $dfrn_id);
xml_status(3);
//NOTREACHED
dbesc($a->argv[1])
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
$status = 1;
+ }
logger("Remote rino version: ".$rino_remote." for ".$r[0]["url"], LOGGER_DEBUG);
$r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1",
dbesc($sec)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
xml_status(3, 'No ticket');
// NOTREACHED
}
$r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1",
dbesc($sec)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
xml_status(3, 'No ticket');
// NOTREACHED
}
dbesc($challenge)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
killme();
+ }
$type = $r[0]['type'];
$last_update = $r[0]['last_update'];
$r = q("SELECT * FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1");
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
killme();
+ }
$contact = $r[0];
$owner_uid = $r[0]['uid'];
intval($uid)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('This account has not been configured for email. Request failed.') . EOL);
return;
}
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval($a->profile['uid'])
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
$mail_disabled = 1;
+ }
}
// "coming soon" is disabled for now
intval($contact_id),
intval(local_user())
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('Contact not found.') . EOL);
return;
}
intval($contact_id),
intval(local_user())
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('Contact not found.') . EOL);
return;
}
intval($a->argv[1]),
intval(local_user())
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('Group not found.') . EOL );
goaway(App::get_baseurl() . '/contacts');
return; // NOTREACHED
intval($a->argv[1]),
intval(local_user())
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('Group not found.') . EOL );
goaway(App::get_baseurl() . '/contacts');
}
intval(local_user()),
intval($message_id)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
killme();
+ }
if(! intval($r[0]['ignored']))
$ignored = 1;
}
}
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('Unable to locate original post.') . EOL);
if(x($_REQUEST,'return'))
goaway($return_path);
intval($profile_uid)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
continue;
+ }
$r = q("UPDATE `photo` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s'
WHERE `resource-id` = '%s' AND `uid` = %d AND `album` = '%s' ",
dbesc($type),
intval($item_id)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
killme();
+ }
$item = $r[0];
call_hooks('lockview_content', $item);
dbesc($loginame)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('No valid account found.') . EOL);
goaway(z_root());
}
$r = q("SELECT * FROM `user` WHERE `pwdreset` = '%s' LIMIT 1",
dbesc($hash)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
$o = t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed.");
return $o;
}
);
}
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
return;
+ }
unset($_SESSION['authenticated']);
unset($_SESSION['uid']);
$r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
intval(local_user())
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
return;
+ }
if(! $r[0]['pub_keywords'] && (! $r[0]['prv_keywords'])) {
notice( t('No keywords to match. Please add keywords to your default profile.') . EOL);
return;
$r = get_messages(local_user(), $a->pager['start'], $a->pager['itemspage']);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
info( t('No messages.') . EOL);
return $o;
}
dbesc($nick)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
killme();
+ }
$lines = explode("\n",$r[0]['spubkey']);
unset($lines[0]);
intval(local_user()),
dbesc($search)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
q("INSERT INTO `search` ( `uid`,`term` ) VALUES ( %d, '%s') ",
intval(local_user()),
dbesc($search)
intval($group),
intval($_SESSION['uid'])
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
if($update)
killme();
notice( t('No such group') . EOL );
intval($uid)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
logger('poke: no contact ' . $contact_id);
return;
}
AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
dbesc($nickname)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
http_status_exit(500);
+ }
$importer = $r[0];
}
intval($a->argv[2]),
intval(local_user())
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('Profile not found.') . EOL);
goaway('profiles');
return; // NOTREACHED
intval($a->argv[1]),
intval(local_user())
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('Profile not found.') . EOL);
killme();
return;
intval($a->argv[1]),
intval(local_user())
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('Profile not found.') . EOL);
return;
}
intval($a->argv[1]),
intval(local_user())
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('Invalid profile identifier.') . EOL );
return;
}
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
dbesc($nick)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
logger('pubsub: local account not found: ' . $nick);
hub_return(false, '');
}
intval($contact_id),
intval($owner['uid'])
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
logger('pubsub: contact '.$contact_id.' not found.');
hub_return(false, '');
}
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
dbesc($nick)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
hub_post_return();
+ }
$importer = $r[0];
dbesc(NETWORK_FEED)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
logger('pubsub: no contact record for "'.$nick.' ('.$contact_id.')" - ignored. '.$xml);
hub_post_return();
}
$r = q("SELECT * FROM `user` WHERE `guid` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
dbesc($guid)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
http_status_exit(500);
+ }
$importer = $r[0];
}
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
dbesc($nick)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
http_status_exit(500);
+ }
$importer = $r[0];
dbesc(normalise_link($author_link)),
intval($importer['uid'])
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
logger('mod-salmon: Author unknown to us.');
if(get_pconfig($importer['uid'],'system','ostatus_autofriend')) {
$result = new_contact($importer['uid'],$author_link);
intval(local_user()),
dbesc($search)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
q("INSERT INTO `search` (`uid`,`term`) VALUES ( %d, '%s')",
intval(local_user()),
dbesc($search)
intval($a->pager['start']), intval($a->pager['itemspage']));
}
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
info( t('No results.') . EOL);
return $o;
}
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval(local_user())
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
q("INSERT INTO `mailacct` (`uid`) VALUES (%d)",
intval(local_user())
);
$settings_addons = "";
$r = q("SELECT * FROM `hook` WHERE `hook` = 'plugin_settings' ");
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
$settings_addons = t('No Plugin settings configured');
+ }
call_hooks('plugin_settings', $settings_addons);
intval(local_user()),
intval($message_id)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
killme();
+ }
if(! intval($r[0]['starred']))
$starred = 1;
intval($item['contact-id']),
intval($item['uid'])
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
return;
+ }
if(! $r[0]['self'])
$remote_owner = $r[0];
}
$r = suggestion_query(local_user());
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
$o .= t('No suggestions available. If this is a new site, please try again in 24 hours.');
return $o;
}
intval(local_user())
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
+ }
$arr = explode(',', $r[0]['tag']);
for($x = 0; $x < count($arr); $x ++) {
intval(local_user())
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
+ }
$arr = explode(',', $r[0]['tag']);
dbesc($nick)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
return;
+ }
$a->data['user'] = $r[0];
$a->profile_uid = $r[0]['uid'];
$r = q("SELECT `user`.*, `contact`.`id` FROM `user` LEFT JOIN `contact` on `user`.`uid` = `contact`.`uid` WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 and `contact`.`self` = 1 LIMIT 1",
dbesc($nick)
);
- if(! dbm::is_result($r)){
+ if (! dbm::is_result($r)) {
if ($r_json) {
echo json_encode(array('error'=>t('Invalid request.')));
killme();
dbesc($hash)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
$msg = t('File upload failed.');
if ($r_json) {
echo json_encode(array('error'=>$msg));
dbesc($nick)
);
- if(! dbm::is_result($r)){
+ if (! dbm::is_result($r)) {
if ($r_json) {
echo json_encode(array('error'=>t('Invalid request.')));
killme();
dbesc($recipient)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
logger('wallmessage: no recipient');
return;
}
dbesc($recipient)
);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
notice( t('No recipient.') . EOL);
logger('wallmessage: no recipient');
return;
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
dbesc($name)
);
- if(! dbm::is_result($r))
+ if (! dbm::is_result($r)) {
killme();
+ }
$salmon_key = salmon_key($r[0]['spubkey']);