$failed = array();
$r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' ");
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr) {
$upd = intval(substr($rr['k'],7));
if($upd < 1139 || $rr['v'] === 'success')
intval($contact_id),
intval($a->profile['profile_uid'])
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$contact = $r[0];
$remote_contact = true;
}
$links = array();
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$r = sort_by_date($r);
foreach($r as $rr) {
$j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j'));
$events=array();
// transform the event in a usable array
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$r = sort_by_date($r);
$events = process_events($r);
dbesc(normalise_link(get_my_url())),
intval($profile_uid)
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$cid = $r[0]['id'];
else {
$r = q("SELECT `id` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
dbesc(normalise_link(get_my_url()))
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$zcid = $r[0]['id'];
}
}
AND `item`.`private` = 0 AND `item`.`wall` = 1"
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$a->set_pager_total($r[0]['total']);
if(! $r[0]['total']) {
intval($a->argv[2]),
intval(local_user())
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$change = intval($a->argv[2]);
}
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ",
intval($_SESSION['uid']));
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$a->set_pager_total($r[0]['total']);
$total = $r[0]['total'];
}
$contacts = array();
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach ($r as $rr) {
$contacts[] = _contact_detail_for_template($rr);
}
);
$str = '';
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
foreach($r as $rr)
$str .= '<' . $rr['id'] . '>';
if(strlen($str))
AND `blocked` = 0 AND `pending` = 0 LIMIT 1",
intval($cid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$sql_extra = " AND `item`.`parent` IN ( SELECT DISTINCT(`parent`) FROM `item` WHERE 1 $sql_options AND `contact-id` = " . intval($cid) . " and deleted = 0 ) ";
}
$parents_arr = array();
$parents_str = '';
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr)
if(! in_array($rr['item_id'],$parents_arr))
$parents_arr[] = $rr['item_id'];
$r = q("select `nickname` from user where uid = %d limit 1",
intval($id)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$r = q("select id from contact where uid = %d and nurl = '%s' limit 1",
intval(local_user()),
dbesc(normalise_link($a->get_baseurl() . '/profile/' . $r[0]['nickname']))
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
q("insert into manage ( uid, mid ) values ( %d , %d ) ",
intval($a->argv[2]),
intval(local_user())
dbesc($a->user['email']),
dbesc($a->user['password'])
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$full_managers = $r;
$delegates = array();
intval(local_user())
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$delegates = $r;
$uids = array();
$nicknames = array();
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr) {
$nicknames[] = "'" . dbesc(basename($rr['nurl'])) . "'";
}
$r = q("select `uid`, `username`, `nickname` from user where nickname in ( $nicks )");
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
foreach($r as $rr)
if(! in_array($rr['uid'],$uids))
$potentials[] = $rr;
$r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
intval($contact_id)
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$contact = $r[0];
else
$contact = null;
$r = q("SELECT * FROM `contact` WHERE `dfrn-id` = '%s' LIMIT 1",
dbesc($decrypted_dfrn_id)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$message = t('The ID provided by your system is a duplicate on our system. It should work if you try again.');
xml_status(1,$message); // Birthday paradox - duplicate dfrn-id
// NOTREACHED
$r = q("SELECT `photo` FROM `contact` WHERE `id` = %d LIMIT 1",
intval($dfrn_record));
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$photo = $r[0]['photo'];
else
$photo = $a->get_baseurl() . '/images/person-175.jpg';
intval($dfrn_record)
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$combined = $r[0];
if((dbm::is_result($r)) && ($r[0]['notify-flags'] & NOTIFY_CONFIRM)) {
dbesc($a->argv[1])
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$s = fetch_url($r[0]['poll'] . '?dfrn_id=' . $my_id . '&type=profile-check');
q("DELETE FROM `profile_check` WHERE `expire` < " . intval(time()));
$r = q("SELECT * FROM `profile_check` WHERE `dfrn_id` = '%s' ORDER BY `expire` DESC",
dbesc($dfrn_id));
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
xml_status(1);
return; // NOTREACHED
}
$reputation = 0;
$text = '';
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$reputation = $r[0]['rating'];
$text = $r[0]['reason'];
dbesc($nickname)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$challenge = '';
$encrypted_id = '';
dbesc(normalise_link($dfrn_url))
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
if(strlen($r[0]['dfrn-id'])) {
/*
dbesc($dfrn_url),
$parms['key'] // this was already escaped
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$def_gid = get_default_group(local_user(), $r[0]["network"]);
if(intval($def_gid))
group_add_member(local_user(), '', $r[0]['id'], $def_gid);
dbesc(datetime_convert('UTC','UTC','now - 24 hours')),
intval($uid)
);
- if(dbm::is_result($r) && count($r) > $maxreq) {
+ if (dbm::is_result($r) && count($r) > $maxreq) {
notice( sprintf( t('%s has received too many connection requests today.'), $a->profile['name']) . EOL);
notice( t('Spam protection measures have been invoked.') . EOL);
notice( t('Friends are advised to please try again in 24 hours.') . EOL);
AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 30 MINUTE ",
dbesc(NETWORK_MAIL2)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr) {
if(! $rr['rel']) {
q("DELETE FROM `contact` WHERE `id` = %d",
AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 3 DAY ",
dbesc(NETWORK_MAIL2)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr) {
if(! $rr['rel']) {
q("DELETE FROM `contact` WHERE `id` = %d",
dbesc($poll),
intval($uid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$contact_id = $r[0]['id'];
$def_gid = get_default_group($uid, $r[0]["network"]);
dbesc($url)
);
- if(dbm::is_result($ret)) {
+ if (dbm::is_result($ret)) {
if(strlen($ret[0]['issued-id'])) {
notice( t('You have already introduced yourself here.') . EOL );
return;
$parms['url'],
$parms['issued-id']
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$contact_record = $r[0];
update_contact_avatar($photo, $uid, $contact_record["id"], true);
}
dbesc($_GET['confirm_key'])
);
- if(dbm::is_result($intro)) {
+ if (dbm::is_result($intro)) {
$r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
WHERE `contact`.`id` = %d LIMIT 1",
$auto_confirm = false;
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
if(($r[0]['page-flags'] != PAGE_NORMAL) && ($r[0]['page-flags'] != PAGE_PRVGROUP))
$auto_confirm = true;
$r = $db->q("SELECT COUNT(*) AS `total` FROM `profile`
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra ");
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$a->set_pager_total($r[0]['total']);
$order = " ORDER BY `name` ASC ";
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
LEFT JOIN `contact` ON `contact`.`uid` = `user`.`uid`
WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 AND `contact`.`self` $sql_extra $order LIMIT ".$limit);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
if(in_array('small', $a->argv))
$photo = 'thumb';
intval($contact_id),
intval($a->profile['uid'])
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$contact = $r[0];
$remote_contact = true;
}
$r = qu("SELECT * FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1",
intval($a->profile['uid'])
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$a->page_contact = $r[0];
}
$is_owner = ((local_user()) && (local_user() == $a->profile['profile_uid']) ? true : false);
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
intval(local_user())
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$mail_enabled = true;
if(intval($r[0]['pubmail']))
$pubmail_enabled = true;
$links = array();
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$r = sort_by_date($r);
foreach($r as $rr) {
$j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j'));
$events=array();
// transform the event in a usable array
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$r = sort_by_date($r);
$events = process_events($r);
}
intval($event_id),
intval(local_user())
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$orig_event = $r[0];
}
$visible_plugins = array();
if(is_array($a->plugins) && count($a->plugins)) {
$r = q("select * from addon where hidden = 0");
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
foreach($r as $rr)
$visible_plugins[] = $rr['name'];
}
$visible_plugins = array();
if(is_array($a->plugins) && count($a->plugins)) {
$r = q("select * from addon where hidden = 0");
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
foreach($r as $rr)
$visible_plugins[] = $rr['name'];
}
intval($new_contact),
intval(local_user())
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$x = q("INSERT INTO `fsuggest` ( `uid`,`cid`,`name`,`url`,`request`,`photo`,`note`,`created`)
VALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')",
dbesc($hash),
intval(local_user())
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$fsuggest_id = $r[0]['id'];
q("UPDATE `fsuggest` SET `note` = '%s' WHERE `id` = %d AND `uid` = %d",
dbesc($note),
intval($a->argv[2]),
intval(local_user())
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$result = group_rmv(local_user(),$r[0]['name']);
if($result)
info( t('Group removed.') . EOL);
intval($a->argv[2]),
intval(local_user())
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$change = intval($a->argv[2]);
}
intval(local_user())
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
foreach($r as $member) {
if(! in_array($member['id'],$preselected)) {
if($db && $db->connected) {
$r = q("SELECT COUNT(*) as `total` FROM `user`");
- if(dbm::is_result($r) && $r[0]['total']) {
+ if (dbm::is_result($r) && $r[0]['total']) {
$tpl = get_markup_template('install.tpl');
return replace_macros($tpl, array(
'$title' => $install_title,
}
// if this isn't the real parent of the conversation, find it
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$parid = $r[0]['parent'];
$parent_uri = $r[0]['uri'];
if($r[0]['id'] != $r[0]['parent']) {
intval($parent_item['contact-id']),
intval($uid)
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$parent_contact = $r[0];
// If the contact id doesn't fit with the contact, then set the contact to null
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
intval($profile_uid)
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$user = $r[0];
if($orig_post) {
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
intval(local_user())
);
- if(dbm::is_result($r) && intval($r[0]['pubmail']))
+ if (dbm::is_result($r) && intval($r[0]['pubmail']))
$pubmail_enabled = true;
}
}
}
}
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$author = $r[0];
$contact_id = $author['id'];
}
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
intval($profile_uid)
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$contact_record = $r[0];
}
intval($profile_uid),
intval($attach)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$r = q("UPDATE `attach` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s'
WHERE `uid` = %d AND `id` = %d",
dbesc($str_contact_allow),
intval($profile_uid),
intval($mtch)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
if(strlen($attachments))
$attachments .= ',';
$attachments .= '[attach]href="' . $a->get_baseurl() . '/attach/' . $r[0]['id'] . '" length="' . $r[0]['filesize'] . '" type="' . $r[0]['filetype'] . '" title="' . (($r[0]['filename']) ? $r[0]['filename'] : '') . '"[/attach]';
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
dbesc(implode(', ', $allowed_groups))
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
foreach($r as $rr)
$l[] = '<b>' . $rr['name'] . '</b>';
}
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
dbesc(implode(', ',$allowed_users))
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
foreach($r as $rr)
$l[] = $rr['name'];
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
dbesc(implode(', ', $deny_groups))
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
foreach($r as $rr)
$l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
}
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
dbesc(implode(', ',$deny_users))
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
foreach($r as $rr)
$l[] = '<strike>' . $rr['name'] . '</strike>';
$r = q("select * from user where uid = %d limit 1",
intval($_SESSION['submanage'])
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$uid = intval($r[0]['uid']);
$orig_record = $r[0];
}
intval($a->argv[2]),
intval(local_user())
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$parent = $r[0]['parent-uri'];
$convid = $r[0]['convid'];
intval(local_user()),
intval($a->argv[2])
);
- if(!dbm::is_result($r)) {
+ if (!dbm::is_result($r)) {
$r = q("SELECT `name`, `url`, `id` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' LIMIT 1",
intval(local_user()),
dbesc(normalise_link(base64_decode($a->argv[2])))
);
}
- if(!dbm::is_result($r)) {
+ if (!dbm::is_result($r)) {
$r = q("SELECT `name`, `url`, `id` FROM `contact` WHERE `uid` = %d AND `addr` = '%s' LIMIT 1",
intval(local_user()),
dbesc(base64_decode($a->argv[2]))
);
}
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$prename = $r[0]['name'];
$preurl = $r[0]['url'];
$preid = $r[0]['id'];
intval(local_user()),
intval($a->argv[1])
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$contact_id = $r[0]['contact-id'];
$convid = $r[0]['convid'];
intval($parent),
intval($uid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$parent_uri = $r[0]['uri'];
$private = $r[0]['private'];
$allow_cid = $r[0]['allow_cid'];
dbesc($search)
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$total = $r[0]['total'];
$results = array();
intval($perpage)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr)
$results[] = array(
'name' => $rr['name'],
$saved = array();
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr) {
$saved[] = array(
'id' => $rr['id'],
);
$str = '';
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
foreach($r as $rr)
$str .= '<' . $rr['id'] . '>';
if(strlen($str))
AND (NOT `blocked` OR `pending`) LIMIT 1",
intval($cid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$sql_extra = " AND ".$sql_table.".`contact-id` = ".intval($cid);
$entries[0] = array(
intval($_SESSION['uid'])
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$a->set_pager_total($r[0]['total']);
}
}
$parents_str = '';
$date_offset = "";
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr)
if(! in_array($rr['item_id'],$parents_arr))
$parents_arr[] = $rr['item_id'];
require_once('include/Contact.php');
$r = contacts_not_grouped(local_user());
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$a->set_pager_total($r[0]['total']);
}
$r = contacts_not_grouped(local_user(),$a->pager['start'],$a->pager['itemspage']);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr) {
$contact_details = get_contact_details_by_url($rr['url'], local_user(), $rr);
if(is_array($a->profile) AND !$a->profile['hide-friends']) {
$r = q("SELECT `gcontact`.`updated` FROM `contact` INNER JOIN `gcontact` WHERE `gcontact`.`nurl` = `contact`.`nurl` AND `self` AND `uid` = %d LIMIT 1",
intval($a->profile['uid']));
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$json_info["updated"] = date("c", strtotime($r[0]['updated']));
$r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0
dbesc(NETWORK_DIASPORA),
dbesc(NETWORK_OSTATUS)
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$json_info["contacts"] = intval($r[0]['total']);
}
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$a->set_pager_total($r[0]['total']);
$a->set_pager_itemspage(40);
}
$parents_arr = array();
$parents_str = '';
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr)
$parents_arr[] = $rr['item_id'];
$parents_str = implode(', ', $parents_arr);
dbesc($parents_str)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$items = conv_sort($r,"`commented`");
$o .= conversation($a,$items,'notes',$update);
intval(local_user())
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$intro_id = $r[0]['id'];
$contact_id = $r[0]['contact-id'];
}
dbesc($authid), dbesc(normalise_openid($authid))
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
// successful OpenID login
intval($resolution),
intval($uid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$data = $r[0]['data'];
$mimetype = $r[0]['type'];
}
dbesc($photo),
intval($resolution)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$sql_extra = permissions_sql($r[0]['uid']);
$public = (dbm::is_result($r)) && ($r[0]['allow_cid'] == '') AND ($r[0]['allow_gid'] == '') AND ($r[0]['deny_cid'] == '') AND ($r[0]['deny_gid'] == '');
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$resolution = $r[0]['scale'];
$data = $r[0]['data'];
$mimetype = $r[0]['type'];
dbesc($album)
);
}
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr) {
$res[] = "'" . dbesc($rr['rid']) . "'" ;
}
$r = q("SELECT `parent-uri` FROM `item` WHERE `resource-id` IN ( $str_res ) AND `uid` = %d",
intval($page_owner_uid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr) {
q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
dbesc(datetime_convert()),
dbesc($a->argv[2])
);
}
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
q("DELETE FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'",
intval($page_owner_uid),
dbesc($r[0]['resource-id'])
dbesc($resource_id),
intval($page_owner_uid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$ph = new Photo($r[0]['data'], $r[0]['type']);
if ($ph->is_valid()) {
$rotate_deg = ( (intval($_POST['rotate']) == 1) ? 270 : 90 );
intval($page_owner_uid)
);
}
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$old_tag = $r[0]['tag'];
$old_inform = $r[0]['inform'];
}
intval($page_owner_uid)
);
}*/
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$newname = $r[0]['name'];
$profile = $r[0]['url'];
$notify = 'cid:' . $r[0]['id'];
intval($contact_id),
intval($owner_uid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$can_post = true;
$contact = $r[0];
$remote_contact = true;
intval($contact_id),
intval($owner_uid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$contact = $r[0];
$remote_contact = true;
}
intval($owner_uid),
dbesc($album)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$a->set_pager_total(count($r));
$a->set_pager_itemspage(20);
}
$photos = array();
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$twist = 'rotright';
foreach ($r as $rr) {
if ($twist == 'rotright')
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$a->set_pager_total($r[0]['total']);
// display comments
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach ($r as $item) {
builtin_activity_puller($item, $conv_responses);
dbesc('Contact Photos'),
dbesc( t('Contact Photos'))
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$a->set_pager_total(count($r));
$a->set_pager_itemspage(20);
}
intval($a->pager['itemspage'])
);
-
-
$photos = array();
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$twist = 'rotright';
foreach ($r as $rr) {
//hide profile photos to others
dbesc(NETWORK_STATUSNET)
);
}
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$totalResults = intval($r[0]['total']);
else
$totalResults = 0;
}
if(is_array($r)) {
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr) {
if (!isset($rr['generation'])) {
if ($global)
intval($parent),
intval($uid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$parent_uri = $r[0]['uri'];
$private = $r[0]['private'];
$allow_cid = $r[0]['allow_cid'];
intval($_GET['c']),
intval(local_user())
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$name = $r[0]['name'];
$id = $r[0]['id'];
}
$which = htmlspecialchars($a->argv[1]);
else {
$r = q("select nickname from user where blocked = 0 and account_expired = 0 and account_removed = 0 and verified = 1 order by rand() limit 1");
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
goaway($a->get_baseurl() . '/profile/' . $r[0]['nickname']);
}
else {
intval($contact_id),
intval($a->profile['profile_uid'])
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$contact = $r[0];
$remote_contact = true;
}
intval($a->profile['profile_uid'])
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$a->set_pager_total($r[0]['total']);
}
}
intval($_REQUEST['profile']),
intval(local_user())
);
- if(dbm::is_result($r) && (! intval($r[0]['is-default'])))
+ if (dbm::is_result($r) && (! intval($r[0]['is-default'])))
$is_default_profile = 0;
}
dbesc(local_user()),
intval($scale));
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$base_image = $r[0];
intval(local_user())
);
}
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$prf = $r[0]['url'];
$newname = $r[0]['name'];
}
"SELECT * FROM `profile` WHERE `uid` = %d AND `is-default`=1",
local_user()
);
- if(dbm::is_result($r)){
+ if (dbm::is_result($r)){
//Go to the default profile.
goaway('profiles/'.$r[0]['id']);
}
$r = q("SELECT * FROM `profile` WHERE `uid` = %d",
local_user());
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$tpl = get_markup_template('profile_entry.tpl');
foreach($r as $rr) {
intval($a->argv[2]),
intval(local_user())
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$change = intval($a->argv[2]);
}
);
$ingroup = array();
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
foreach($r as $member)
$ingroup[] = $member['id'];
$members = $r;
$ingroup = array();
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
foreach($r as $member)
$ingroup[] = $member['id'];
}
dbesc(NETWORK_DFRN)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
foreach($r as $member) {
if(! in_array($member['id'],$ingroup)) {
" AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
dbesc($nick));
- if(!dbm::is_result($r)) {
+ if (!dbm::is_result($r)) {
logger('pubsubhubbub: local account not found: ' . $nick);
http_status_exit(404);
}
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND NOT `blocked`".
" AND NOT `pending` AND `self` LIMIT 1",
intval($owner['uid']));
- if(!dbm::is_result($r)) {
+ if (!dbm::is_result($r)) {
logger('pubsubhubbub: contact not found.');
http_status_exit(404);
}
intval($limit)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr)
$results[] = array( 0, (int) $rr['id'], $rr['name'], '', '');
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr)
$results[] = array( (int) $rr['id'], 0, $rr['name'],$rr['url'],$rr['photo']);
$r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default` = 1",
intval($user[0]['uid'])
);
- if(dbm::is_result($r) && $r[0]['net-publish']) {
+ if (dbm::is_result($r) && $r[0]['net-publish']) {
$url = $a->get_baseurl() . '/profile/' . $user[0]['nickname'];
if($url && strlen(get_config('system','directory')))
proc_run(PRIORITY_LOW, "include/directory.php", $url);
// If so we can not accept this post.
//if((dbm::is_result($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == CONTACT_IS_FOLLOWER) || ($r[0]['blocked']))) {
- if(dbm::is_result($r) && $r[0]['blocked']) {
+ if (dbm::is_result($r) && $r[0]['blocked']) {
logger('mod-salmon: Ignoring this author.');
http_status_exit(202);
// NOTREACHED
intval(local_user())
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$saved = array();
foreach($r as $rr) {
$saved[] = array(
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval(local_user())
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$eacct = $r[0];
require_once('include/email.php');
$mb = construct_mailbox_name($eacct);
WHERE `contact`.`self` = 1 AND `contact`.`uid` = %d LIMIT 1",
intval($owner_uid)
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$owner = $r[0];
if(! $owner) {
intval($_SESSION['visitor_id']),
intval($owner_uid)
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$contact = $r[0];
}
if(! $contact) {
$r = q("select `nickname`,`blocktags` from user where uid = %d limit 1",
intval($owner_uid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$owner_nick = $r[0]['nickname'];
$blocktags = $r[0]['blocktags'];
}
$r = q("select * from contact where self = 1 and uid = %d limit 1",
intval(local_user())
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$contact = $r[0];
else {
logger('tagger: no contact_id');
$r = q("select `tag`,`id`,`uid` from item where `origin` = 1 AND `uri` = '%s' LIMIT 1",
dbesc($item['uri'])
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$x = q("SELECT `blocktags` FROM `user` WHERE `uid` = %d limit 1",
intval($r[0]['uid'])
);
function _uexport_multirow($query) {
$result = array();
$r = q($query);
-// if(dbm::is_result($r)) {
+// if (dbm::is_result($r)) {
if ($r){
foreach($r as $rr){
$p = array();
$r = q("SELECT count(*) as `total` FROM `item` WHERE `uid` = %d ",
intval(local_user())
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$total = $r[0]['total'];
// chunk the output to avoid exhausting memory
intval($x),
intval(500)
);
- /*if(dbm::is_result($r)) {
+ /*if (dbm::is_result($r)) {
foreach($r as $rr)
foreach($rr as $k => $v)
$item[][$k] = $v;
dbesc($video_id)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
q("DELETE FROM `attach` WHERE `uid` = %d AND `id` = '%s'",
intval(local_user()),
dbesc($video_id)
intval($contact_id),
intval($owner_uid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$can_post = true;
$contact = $r[0];
$remote_contact = true;
intval($contact_id),
intval($owner_uid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$contact = $r[0];
$remote_contact = true;
}
$sql_extra GROUP BY hash",
intval($a->data['user']['uid'])
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$a->set_pager_total(count($r));
$a->set_pager_itemspage(20);
}
$videos = array();
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
foreach($r as $rr) {
if($a->theme['template_engine'] === 'internal') {
$alt_e = template_escape($rr['filename']);
dbesc(NETWORK_DIASPORA),
dbesc(NETWORK_OSTATUS)
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
$a->set_pager_total($r[0]['total']);
$r = q("SELECT * FROM `contact`
intval($a->pager['start']),
intval($a->pager['itemspage'])
);
- if(!dbm::is_result($r)) {
+ if (!dbm::is_result($r)) {
info(t('No contacts.').EOL);
return $o;
}
dbesc($item_id)
);
- if(dbm::is_result($r))
+ if (dbm::is_result($r))
if(is_ajax()) {
echo str_replace("\n",'<br />',$r[0]['body']);
killme();
intval($contact_id),
intval($page_owner_uid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$can_post = true;
$visitor = $contact_id;
}
intval($contact_id),
intval($page_owner_uid)
);
- if(dbm::is_result($r)) {
+ if (dbm::is_result($r)) {
$can_post = true;
$visitor = $contact_id;
}