Browse Source

Cleanup for #3010 - added spaces, thanks to @annando .

Signed-off-by: Roland Häder <roland@mxchange.org>
pull/3010/head
Roland Häder 5 years ago
parent
commit
a905522eb5
  1. 2
      include/Contact.php
  2. 2
      include/ForumManager.php
  3. 24
      include/NotificationsManager.php
  4. 2
      include/Probe.php
  5. 10
      include/acl_selectors.php
  6. 4
      include/api.php
  7. 2
      include/contact_selectors.php
  8. 6
      include/contact_widgets.php
  9. 6
      include/conversation.php
  10. 2
      include/datetime.php
  11. 4
      include/dbstructure.php
  12. 28
      include/dfrn.php
  13. 4
      include/diaspora.php
  14. 2
      include/enotify.php
  15. 12
      include/event.php
  16. 2
      include/expire.php
  17. 6
      include/fcontact.php
  18. 10
      include/follow.php
  19. 2
      include/gprobe.php
  20. 18
      include/group.php
  21. 14
      include/identity.php
  22. 16
      include/items.php
  23. 6
      include/like.php
  24. 2
      include/lock.php
  25. 8
      include/message.php
  26. 10
      include/notifier.php
  27. 4
      include/oauth.php
  28. 6
      include/onepoll.php
  29. 10
      include/plugin.php
  30. 4
      include/queue_fn.php
  31. 16
      include/security.php
  32. 2
      include/session.php
  33. 14
      include/socgraph.php
  34. 14
      include/text.php
  35. 2
      include/threads.php
  36. 10
      include/user.php

2
include/Contact.php

@ -435,7 +435,7 @@ function random_profile() {
ORDER BY rand() LIMIT 1",
dbesc(NETWORK_DFRN));
if(dbm::is_result($r))
if (dbm::is_result($r))
return dirname($r[0]['url']);
return '';
}

2
include/ForumManager.php

@ -88,7 +88,7 @@ class ForumManager {
$total = count($contacts);
$visible_forums = 10;
if(dbm::is_result($contacts)) {
if (dbm::is_result($contacts)) {
$id = 0;

24
include/NotificationsManager.php

@ -88,7 +88,7 @@ class NotificationsManager {
intval(local_user())
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return $this->_set_extra($r);
return false;
@ -105,7 +105,7 @@ class NotificationsManager {
intval($id),
intval(local_user())
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
return $this->_set_extra($r)[0];
}
return null;
@ -358,7 +358,7 @@ class NotificationsManager {
intval(local_user())
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return $r[0]['total'];
return 0;
@ -401,7 +401,7 @@ class NotificationsManager {
intval($limit)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$notifs = $this->formatNotifs($r, $ident);
$arr = array (
@ -430,7 +430,7 @@ class NotificationsManager {
intval(local_user())
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return $r[0]['total'];
return 0;
@ -466,7 +466,7 @@ class NotificationsManager {
intval($limit)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$notifs = $this->formatNotifs($r, $ident);
$arr = array (
@ -520,7 +520,7 @@ class NotificationsManager {
intval(local_user())
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return $r[0]['total'];
return 0;
@ -564,7 +564,7 @@ class NotificationsManager {
intval($limit)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$notifs = $this->formatNotifs($r, $ident);
$arr = array (
@ -596,7 +596,7 @@ class NotificationsManager {
intval(local_user())
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return $r[0]['total'];
return 0;
@ -638,7 +638,7 @@ class NotificationsManager {
intval($limit)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$notifs = $this->formatNotifs($r, $ident);
$arr = array (
@ -668,7 +668,7 @@ class NotificationsManager {
intval($_SESSION['uid'])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return $r[0]['total'];
return 0;
@ -713,7 +713,7 @@ class NotificationsManager {
intval($limit)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$notifs = $this->formatIntros($r);
$arr = array (

2
include/Probe.php

@ -1084,7 +1084,7 @@ class Probe {
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1", intval($uid));
if(dbm::is_result($x) && dbm::is_result($r)) {
if (dbm::is_result($x) && dbm::is_result($r)) {
$mailbox = construct_mailbox_name($r[0]);
$password = '';
openssl_private_decrypt(hex2bin($r[0]['pass']), $password,$x[0]['prvkey']);

10
include/acl_selectors.php

@ -33,7 +33,7 @@ function group_select($selname,$selclass,$preselected = false,$size = 4) {
call_hooks($a->module . '_pre_' . $selname, $arr);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $rr) {
if((is_array($preselected)) && in_array($rr['id'], $preselected))
$selected = " selected=\"selected\" ";
@ -144,7 +144,7 @@ function contact_selector($selname, $selclass, $preselected = false, $options) {
call_hooks($a->module . '_pre_' . $selname, $arr);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $rr) {
if((is_array($preselected)) && in_array($rr['id'], $preselected))
$selected = " selected=\"selected\" ";
@ -220,7 +220,7 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
$receiverlist = array();
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $rr) {
if((is_array($preselected)) && in_array($rr['id'], $preselected))
$selected = " selected=\"selected\" ";
@ -314,7 +314,7 @@ function populate_acl($user = null, $show_jotnets = false) {
$r = q("SELECT `pubmail` 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;
@ -577,7 +577,7 @@ function acl_lookup(&$a, $out_type = 'json') {
$r = array();
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $g){
$contacts[] = array(
"type" => "c",

4
include/api.php

@ -208,7 +208,7 @@
dbesc(trim($user)),
dbesc($encrypted)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$record = $r[0];
}
@ -2755,7 +2755,7 @@
intval(api_user())
);
if(!dbm::is_result($r))
if (!dbm::is_result($r))
return;
$ids = array();

2
include/contact_selectors.php

@ -12,7 +12,7 @@ function contact_profile_assign($current,$foreign_net) {
$r = q("SELECT `id`, `profile-name` FROM `profile` WHERE `uid` = %d",
intval($_SESSION['uid']));
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $rr) {
$selected = (($rr['id'] == $current) ? " selected=\"selected\" " : "");
$o .= "<option value=\"{$rr['id']}\" $selected >{$rr['profile-name']}</option>\r\n";

6
include/contact_widgets.php

@ -93,7 +93,7 @@ function networks_widget($baseurl,$selected = '') {
);
$nets = array();
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
require_once('include/contact_selectors.php');
foreach($r as $rr) {
if($rr['network'])
@ -204,13 +204,13 @@ function common_friends_visitor_widget($profile_uid) {
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'];
}
}

6
include/conversation.php

@ -109,7 +109,7 @@ function localize_item(&$item){
$r = q("SELECT * from `item`,`contact` WHERE
`item`.`contact-id`=`contact`.`id` AND `item`.`uri`='%s';",
dbesc($item['parent-uri']));
if(!dbm::is_result($r)) return;
if (!dbm::is_result($r)) return;
$obj=$r[0];
$author = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
@ -245,7 +245,7 @@ function localize_item(&$item){
$r = q("SELECT * from `item`,`contact` WHERE
`item`.`contact-id`=`contact`.`id` AND `item`.`uri`='%s';",
dbesc($item['parent-uri']));
if(!dbm::is_result($r)) return;
if (!dbm::is_result($r)) return;
$obj=$r[0];
$author = '[url=' . zrl($item['author-link']) . ']' . $item['author-name'] . '[/url]';
@ -294,7 +294,7 @@ function localize_item(&$item){
dbesc($obj->id),
intval($item['uid'])
);
if(dbm::is_result($r) && $r[0]['plink']) {
if (dbm::is_result($r) && $r[0]['plink']) {
$target = $r[0];
$Bname = $target['author-name'];
$Blink = $target['author-link'];

2
include/datetime.php

@ -552,7 +552,7 @@ function update_contact_birthdays() {
// In-network birthdays are handled within local_delivery
$r = q("SELECT * FROM contact WHERE `bd` != '' AND `bd` != '0000-00-00' AND SUBSTRING(`bd`,1,4) != `bdyear` ");
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $rr) {
logger('update_contact_birthday: ' . $rr['bd']);

4
include/dbstructure.php

@ -188,7 +188,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
$sql3="";
if (!isset($database[$name])) {
$r = db_create_table($name, $structure["fields"], $charset, $verbose, $action, $structure['indexes']);
if(!dbm::is_result($r)) {
if (!dbm::is_result($r)) {
$errors .= t('Errors encountered creating database tables.').$name.EOL;
}
$is_new_table = True;
@ -265,7 +265,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
if ($action) {
$r = @$db->q($sql3);
if(dbm::is_result($r))
if (dbm::is_result($r))
$errors .= t('Errors encountered performing database changes.').$sql3.EOL;
}
}

28
include/dfrn.php

@ -1463,7 +1463,7 @@ class dfrn {
dbesc(normalise_link($suggest["url"])),
intval($suggest["uid"])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return false;
// Do we already have an fcontact record for this person?
@ -1474,7 +1474,7 @@ class dfrn {
dbesc($suggest["name"]),
dbesc($suggest["request"])
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$fid = $r[0]["id"];
// OK, we do. Do we already have an introduction for this person ?
@ -1482,7 +1482,7 @@ class dfrn {
intval($suggest["uid"]),
intval($fid)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return false;
}
if(!$fid)
@ -1497,7 +1497,7 @@ class dfrn {
dbesc($suggest["name"]),
dbesc($suggest["request"])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$fid = $r[0]["id"];
else
// database record did not get created. Quietly give up.
@ -1746,7 +1746,7 @@ class dfrn {
LIMIT 1",
dbesc($item["parent-uri"])
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$r = q("SELECT `item`.`forum_mode`, `item`.`wall` FROM `item`
INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uri` = '%s' AND (`item`.`parent-uri` = '%s' OR `item`.`thr-parent` = '%s')
@ -1758,7 +1758,7 @@ class dfrn {
dbesc($r[0]["parent-uri"]),
intval($importer["importer_uid"])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$is_a_remote_action = true;
}
@ -1898,7 +1898,7 @@ class dfrn {
dbesc($item["verb"]),
dbesc($item["parent-uri"])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return false;
$r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `author-link` = '%s' AND `verb` = '%s' AND `thr-parent` = '%s' AND NOT `deleted` LIMIT 1",
@ -1907,7 +1907,7 @@ class dfrn {
dbesc($item["verb"]),
dbesc($item["parent-uri"])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return false;
} else
$is_like = false;
@ -1923,7 +1923,7 @@ class dfrn {
intval($importer["importer_uid"])
);
if(!dbm::is_result($r))
if (!dbm::is_result($r))
return false;
// extract tag, if not duplicate, add to parent item
@ -2195,7 +2195,7 @@ class dfrn {
dbesc($item["uri"]),
intval($importer["uid"])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$ev["id"] = $r[0]["id"];
$event_id = event_store($ev);
@ -2216,7 +2216,7 @@ class dfrn {
}
// Update content if 'updated' changes
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
if (self::update_content($r[0], $item, $importer, $entrytype))
logger("Item ".$item["uri"]." was updated.", LOGGER_DEBUG);
else
@ -2238,7 +2238,7 @@ class dfrn {
intval($posted_id),
intval($importer["importer_uid"])
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$parent = $r[0]["parent"];
$parent_uri = $r[0]["parent-uri"];
}
@ -2326,7 +2326,7 @@ class dfrn {
intval($importer["uid"]),
intval($importer["id"])
);
if(!dbm::is_result($r)) {
if (!dbm::is_result($r)) {
logger("Item with uri ".$uri." from contact ".$importer["id"]." for user ".$importer["uid"]." wasn't found.", LOGGER_DEBUG);
return;
} else {
@ -2420,7 +2420,7 @@ class dfrn {
dbesc($item["parent-uri"]),
intval($importer["uid"])
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
q("UPDATE `item` SET `last-child` = 1 WHERE `id` = %d",
intval($r[0]["id"])
);

4
include/diaspora.php

@ -1278,7 +1278,7 @@ class diaspora {
$r = q("SELECT `id` FROM `mail` WHERE `uri` = '%s' LIMIT 1",
dbesc($message_uri)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
logger("duplicate message already delivered.", LOGGER_DEBUG);
return false;
}
@ -2925,7 +2925,7 @@ class diaspora {
$p = q("SELECT `guid`, `uri`, `parent-uri` FROM `item` WHERE `uri` = '%s' LIMIT 1",
dbesc($item["thr-parent"]));
if(!dbm::is_result($p))
if (!dbm::is_result($p))
return false;
$parent = $p[0];

2
include/enotify.php

@ -411,7 +411,7 @@ function notification($params) {
$hash = random_string();
$r = q("SELECT `id` FROM `notify` WHERE `hash` = '%s' LIMIT 1",
dbesc($hash));
if(dbm::is_result($r))
if (dbm::is_result($r))
$dups = true;
} while($dups == true);

12
include/event.php

@ -312,7 +312,7 @@ function event_store($arr) {
intval($arr['id']),
intval($arr['uid'])
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$object = '<object><type>' . xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . xmlify($arr['uri']) . '</id>';
$object .= '<content>' . xmlify(format_event_bbcode($arr)) . '</content>';
$object .= '</object>' . "\n";
@ -365,7 +365,7 @@ function event_store($arr) {
dbesc($arr['uri']),
intval($arr['uid'])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$event = $r[0];
$item_arr = array();
@ -407,7 +407,7 @@ function event_store($arr) {
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
intval($arr['uid'])
);
//if(dbm::is_result($r))
//if (dbm::is_result($r))
// $plink = $a->get_baseurl() . '/display/' . $r[0]['nickname'] . '/' . $item_id;
@ -515,7 +515,7 @@ function event_by_id($owner_uid = 0, $event_params, $sql_extra = '') {
intval($event_params["event_id"])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return $r;
}
@ -557,7 +557,7 @@ function events_by_date($owner_uid = 0, $event_params, $sql_extra = '') {
dbesc($event_params["adjust_finish"])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return $r;
}
@ -750,7 +750,7 @@ function events_by_uid($uid = 0, $sql_extra = '') {
);
}
if(dbm::is_result($r))
if (dbm::is_result($r))
return $r;
}

2
include/expire.php

@ -39,7 +39,7 @@ function expire_run(&$argv, &$argc){
logger('expire: start');
$r = q("SELECT `uid`,`username`,`expire` FROM `user` WHERE `expire` != 0");
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $rr) {
logger('Expire: ' . $rr['username'] . ' interval: ' . $rr['expire'], LOGGER_DEBUG);
item_expire($rr['uid'],$rr['expire']);

6
include/fcontact.php

@ -10,7 +10,7 @@ function fcontact_store($url,$name,$photo) {
dbesc($nurl)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return $r[0]['id'];
$r = q("INSERT INTO `fcontact` ( `url`, `name`, `photo` ) VALUES ( '%s', '%s', '%s' ) ",
@ -19,11 +19,11 @@ function fcontact_store($url,$name,$photo) {
dbesc($photo)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$r = q("SELECT `id` FROM `fcontact` WHERE `url` = '%s' LIMIT 1",
dbesc($nurl)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return $r[0]['id'];
}

10
include/follow.php

@ -173,12 +173,12 @@ function new_contact($uid,$url,$interactive = false) {
dbesc($ret['network'])
);
if(!dbm::is_result($r))
if (!dbm::is_result($r))
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' AND `network` = '%s' LIMIT 1",
intval($uid), dbesc(normalise_link($url)), dbesc($ret['network'])
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
// update contact
if($r[0]['rel'] == CONTACT_IS_FOLLOWER || ($network === NETWORK_DIASPORA && $r[0]['rel'] == CONTACT_IS_SHARING)) {
q("UPDATE `contact` SET `rel` = %d , `subhub` = %d, `readonly` = 0 WHERE `id` = %d AND `uid` = %d",
@ -196,7 +196,7 @@ function new_contact($uid,$url,$interactive = false) {
$r = q("select count(*) as total from contact where uid = %d and pending = 0 and self = 0",
intval($uid)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$total_contacts = $r[0]['total'];
if(! service_class_allows($uid,'total_contacts',$total_contacts)) {
@ -208,7 +208,7 @@ function new_contact($uid,$url,$interactive = false) {
intval($uid),
dbesc($network)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$total_network = $r[0]['total'];
if(! service_class_allows($uid,'total_contacts_' . $network,$total_network)) {
@ -295,7 +295,7 @@ function new_contact($uid,$url,$interactive = false) {
intval($uid)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
if(($contact['network'] == NETWORK_OSTATUS) && (strlen($contact['notify']))) {
require_once('include/salmon.php');
slapper($r[0],$contact['notify'],$slap);

2
include/gprobe.php

@ -64,7 +64,7 @@ function gprobe_run(&$argv, &$argc){
dbesc(normalise_link($url))
);
}
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
// Check for accessibility and do a poco discovery
if (poco_last_updated($r[0]['url'], true) AND ($r[0]["network"] == NETWORK_DFRN))
poco_load(0,0,$r[0]['id'], str_replace('/profile/','/poco/',$r[0]['url']));

18
include/group.php

@ -44,7 +44,7 @@ function group_rmv($uid,$name) {
intval($uid),
dbesc($name)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$group_id = $r[0]['id'];
if(! $group_id)
return false;
@ -106,7 +106,7 @@ function group_byname($uid,$name) {
intval($uid),
dbesc($name)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return $r[0]['id'];
return false;
}
@ -139,7 +139,7 @@ function group_add_member($uid,$name,$member,$gid = 0) {
intval($gid),
intval($member)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
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
@ -164,7 +164,7 @@ function group_get_members($gid) {
intval($gid),
intval(local_user())
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$ret = $r;
}
return $ret;
@ -181,7 +181,7 @@ function group_public_members($gid) {
intval(local_user()),
dbesc(NETWORK_OSTATUS)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$ret = count($r);
}
return $ret;
@ -197,7 +197,7 @@ function mini_group_select($uid,$gid = 0, $label = "") {
intval($uid)
);
$grps[] = array('name' => '', 'id' => '0', 'selected' => '');
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $rr) {
$grps[] = array('name' => $rr['name'], 'id' => $rr['id'], 'selected' => (($gid == $rr['id']) ? 'true' : ''));
}
@ -255,7 +255,7 @@ function group_side($every="contacts",$each="group",$editmode = "standard", $gro
$member_of = groups_containing(local_user(),$cid);
}
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $rr) {
$selected = (($group_id == $rr['id']) ? ' group-selected' : '');
@ -316,7 +316,7 @@ function expand_groups($a,$check_dead = false, $use_gcontact = false) {
$ret = array();
if(dbm::is_result($r))
if (dbm::is_result($r))
foreach($r as $rr)
$ret[] = $rr['contact-id'];
if($check_dead AND !$use_gcontact) {
@ -345,7 +345,7 @@ function groups_containing($uid,$c) {
);
$ret = array();
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $rr)
$ret[] = $rr['gid'];
}

14
include/identity.php

@ -138,7 +138,7 @@ function get_profiledata_by_nick($nickname, $uid = 0, $profile = 0) {
$r = q("SELECT `profile-id` FROM `contact` WHERE `id` = %d LIMIT 1",
intval($visitor['cid'])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$profile = $r[0]['profile-id'];
break;
}
@ -159,7 +159,7 @@ function get_profiledata_by_nick($nickname, $uid = 0, $profile = 0) {
intval($profile_int)
);
}
if(!dbm::is_result($r)) {
if (!dbm::is_result($r)) {
$r = q("SELECT `contact`.`id` AS `contact_id`, `profile`.`uid` AS `profile_uid`, `profile`.*,
`contact`.`avatar-date` AS picdate, `contact`.`addr`, `user`.*
FROM `profile`
@ -289,7 +289,7 @@ function profile_sidebar($profile, $block = 0) {
'entries' => array(),
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $rr) {
$profile['menu']['entries'][] = array(
@ -368,7 +368,7 @@ function profile_sidebar($profile, $block = 0) {
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))
$updated = date("c", strtotime($r[0]['updated']));
$r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `hidden` AND NOT `archive`
@ -378,7 +378,7 @@ function profile_sidebar($profile, $block = 0) {
dbesc(NETWORK_DIASPORA),
dbesc(NETWORK_OSTATUS)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$contacts = intval($r[0]['total']);
}
}
@ -460,7 +460,7 @@ function get_birthdays() {
dbesc(datetime_convert('UTC','UTC','now'))
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$total = 0;
$now = strtotime('now');
$cids = array();
@ -543,7 +543,7 @@ function get_events() {
dbesc(datetime_convert('UTC','UTC','now - 1 days'))
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$now = strtotime('now');
$istoday = false;
foreach($r as $rr) {

16
include/items.php

@ -451,7 +451,7 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
/* check for create date and expire time */
$uid = intval($arr['uid']);
$r = q("SELECT expire FROM user WHERE uid = %d", intval($uid));
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$expire_interval = $r[0]['expire'];
if ($expire_interval>0) {
$expire_date = new DateTime( '- '.$expire_interval.' days', new DateTimeZone('UTC'));
@ -580,7 +580,7 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
intval($arr['uid'])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$arr['network'] = $r[0]["network"];
// Fallback to friendica (why is it empty in some cases?)
@ -634,7 +634,7 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
$r = q("SELECT `guid` FROM `item` WHERE `guid` = '%s' AND `network` = '%s' AND `uid` = '%d' LIMIT 1",
dbesc($arr['guid']), dbesc($arr['network']), intval($arr['uid']));
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
logger('found item with guid '.$arr['guid'].' for user '.$arr['uid'].' on network '.$arr['network'], LOGGER_DEBUG);
return 0;
}
@ -662,7 +662,7 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
intval($arr['uid'])
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
// is the new message multi-level threaded?
// even though we don't support it now, preserve the info
@ -1531,7 +1531,7 @@ function new_follower($importer,$contact,$datarray,$item,$sharing = false) {
intval($importer['uid']),
dbesc($url)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$contact_record = $r[0];
update_contact_avatar($photo, $importer["uid"], $contact_record["id"], true);
}
@ -1542,7 +1542,7 @@ function new_follower($importer,$contact,$datarray,$item,$sharing = false) {
);
$a = get_app();
if(dbm::is_result($r) AND !in_array($r[0]['page-flags'], array(PAGE_SOAPBOX, PAGE_FREELOVE))) {
if (dbm::is_result($r) AND !in_array($r[0]['page-flags'], array(PAGE_SOAPBOX, PAGE_FREELOVE))) {
// create notification
$hash = random_string();
@ -2112,7 +2112,7 @@ function drop_item($id,$interactive = true) {
dbesc($item['parent-uri']),
intval($item['uid'])
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
q("UPDATE `item` SET `last-child` = 1 WHERE `id` = %d",
intval($r[0]['id'])
);
@ -2148,7 +2148,7 @@ function first_post_date($uid,$wall = false) {
intval($uid),
intval($wall ? 1 : 0)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
// logger('first_post_date: ' . $r[0]['id'] . ' ' . $r[0]['created'], LOGGER_DATA);
return substr(datetime_convert('',date_default_timezone_get(),$r[0]['created']),0,10);
}

6
include/like.php

@ -90,7 +90,7 @@ function do_like($item_id, $verb) {
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) {
@ -112,7 +112,7 @@ function do_like($item_id, $verb) {
intval($_SESSION['visitor_id']),
intval($owner_uid)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$contact = $r[0];
}
if(! $contact) {
@ -135,7 +135,7 @@ function do_like($item_id, $verb) {
dbesc($item_id), dbesc($item_id), dbesc($item['uri'])
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$like_item = $r[0];
// Already voted, undo it

2
include/lock.php

@ -56,7 +56,7 @@ function block_on_function_lock($fn_name, $wait_sec = 2, $timeout = 30) {
dbesc($fn_name)
);
if(dbm::is_result($r) && $r[0]['locked'])
if (dbm::is_result($r) && $r[0]['locked'])
sleep($wait_sec);
} while(dbm::is_result($r) && $r[0]['locked'] && ((time() - $start) < $timeout));

8
include/message.php

@ -41,7 +41,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){
dbesc($replyto),
dbesc($replyto)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$convid = $r[0]['convid'];
}
@ -74,7 +74,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){
dbesc($conv_guid),
intval(local_user())
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$convid = $r[0]['id'];
}
@ -113,7 +113,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){
dbesc($uri),
intval(local_user())
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$post_id = $r[0]['id'];
/**
@ -210,7 +210,7 @@ function send_wallmessage($recipient='', $body='', $subject='', $replyto=''){
dbesc($conv_guid),
intval($recipient['uid'])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$convid = $r[0]['id'];
if(! $convid) {

10
include/notifier.php

@ -321,7 +321,7 @@ function notifier_run(&$argv, &$argc){
intval($uid),
dbesc(NETWORK_DFRN)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
foreach($r as $rr)
$recipients_followup[] = $rr['id'];
}
@ -459,7 +459,7 @@ function notifier_run(&$argv, &$argc){
$r = q("SELECT * FROM `contact` WHERE `id` IN ($conversant_str) AND NOT `blocked` AND NOT `pending` AND NOT `archive`".$sql_extra);
if(dbm::is_result($r))
if (dbm::is_result($r))
$contacts = $r;
} else
@ -477,7 +477,7 @@ function notifier_run(&$argv, &$argc){
intval($uid),
dbesc(NETWORK_MAIL)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $rr)
$recipients[] = $rr['id'];
}
@ -505,7 +505,7 @@ function notifier_run(&$argv, &$argc){
// delivery loop
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $contact) {
if(!$contact['self']) {
@ -606,7 +606,7 @@ function notifier_run(&$argv, &$argc){
$r = array_merge($r2,$r1,$r0);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
logger('pubdeliver '.$target_item["guid"].': '.print_r($r,true), LOGGER_DEBUG);
// throw everything into the queue in case we get killed

4
include/oauth.php

@ -136,7 +136,7 @@ class FKOAuth1 extends OAuthServer {
$r = q("SELECT * FROM `user` WHERE uid=%d AND `blocked` = 0 AND `account_expired` = 0 AND `account_removed` = 0 AND `verified` = 1 LIMIT 1",
intval($uid)
);
if(dbm::is_result($r)){
if (dbm::is_result($r)){
$record = $r[0];
} else {
logger('FKOAuth1::loginUser failure: ' . print_r($_SERVER,true), LOGGER_DEBUG);
@ -162,7 +162,7 @@ class FKOAuth1 extends OAuthServer {
$r = q("SELECT * FROM `contact` WHERE `uid` = %s AND `self` = 1 LIMIT 1",
intval($_SESSION['uid']));
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$a->contact = $r[0];
$a->cid = $r[0]['id'];
$_SESSION['cid'] = $a->cid;

6
include/onepoll.php

@ -393,7 +393,7 @@ function onepoll_run(&$argv, &$argc){
dbesc($datarray['uri'])
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
logger("Mail: Seen before ".$msg_uid." for ".$mailconf[0]['user']." UID: ".$importer_uid." URI: ".$datarray['uri'],LOGGER_DEBUG);
// Only delete when mails aren't automatically moved or deleted
@ -446,7 +446,7 @@ function onepoll_run(&$argv, &$argc){
$r = q("SELECT `uri` , `parent-uri` FROM `item` USE INDEX (`uid_uri`) WHERE `uri` IN ($qstr) AND `uid` = %d LIMIT 1",
intval($importer_uid)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$datarray['parent-uri'] = $r[0]['parent-uri']; // Set the parent as the top-level item
// $datarray['parent-uri'] = $r[0]['uri'];
}
@ -479,7 +479,7 @@ function onepoll_run(&$argv, &$argc){
dbesc(protect_sprintf($datarray['title'])),
intval($importer_uid),
dbesc(NETWORK_MAIL));
if(dbm::is_result($r))
if (dbm::is_result($r))
$datarray['parent-uri'] = $r[0]['parent-uri'];
}

10
include/plugin.php

@ -79,7 +79,7 @@ function reload_plugins() {
if(strlen($plugins)) {
$r = q("SELECT * FROM `addon` WHERE `installed` = 1");
if(dbm::is_result($r))
if (dbm::is_result($r))
$installed = $r;
else
$installed = array();
@ -150,7 +150,7 @@ function register_hook($hook,$file,$function,$priority=0) {
dbesc($file),
dbesc($function)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return true;
$r = q("INSERT INTO `hook` (`hook`, `file`, `function`, `priority`) VALUES ( '%s', '%s', '%s', '%s' ) ",
@ -187,7 +187,7 @@ function load_hooks() {
$a = get_app();
$a->hooks = array();
$r = q("SELECT * FROM `hook` WHERE 1 ORDER BY `priority` DESC, `file`");
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $rr) {
if(! array_key_exists($rr['hook'],$a->hooks))
$a->hooks[$rr['hook']] = array();
@ -473,7 +473,7 @@ function service_class_allows($uid,$property,$usage = false) {
$r = q("SELECT `service_class` FROM `user` WHERE `uid` = %d LIMIT 1",
intval($uid)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$service_class = $r[0]['service_class'];
}
}
@ -503,7 +503,7 @@ function service_class_fetch($uid,$property) {
$r = q("SELECT `service_class` FROM `user` WHERE `uid` = %d LIMIT 1",
intval($uid)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$service_class = $r[0]['service_class'];
}
}

4
include/queue_fn.php

@ -28,7 +28,7 @@ function was_recently_delayed($cid) {
and last > UTC_TIMESTAMP() - interval 15 minute limit 1",
intval($cid)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
return true;
// Are there queue entries that were recently added?
@ -55,7 +55,7 @@ function add_to_queue($cid,$network,$msg,$batch = false) {
WHERE `queue`.`cid` = %d AND `contact`.`self` = 0 ",
intval($cid)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
if($batch && ($r[0]['total'] > $batch_queue)) {
logger('add_to_queue: too many queued items for batch server ' . $cid . ' - discarding message');
return;

16
include/security.php

@ -42,7 +42,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
$r = q("select * from user where uid = %d limit 1",
intval($_SESSION['submanage'])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$master_record = $r[0];
}
@ -50,7 +50,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
dbesc($master_record['password']),
dbesc($master_record['email'])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$a->identities = $r;
else
$a->identities = array();
@ -60,7 +60,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
and `manage`.`uid` = %d",
intval($master_record['uid'])
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$a->identities = array_merge($a->identities,$r);
if($login_initial)
@ -70,7 +70,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
intval($_SESSION['uid']));
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$a->contact = $r[0];
$a->cid = $r[0]['id'];
$_SESSION['cid'] = $a->cid;
@ -156,7 +156,7 @@ function can_write_wall(&$a,$owner) {
intval(PAGE_COMMUNITY)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$verified = 2;
return true;
}
@ -210,7 +210,7 @@ function permissions_sql($owner_id,$remote_verified = false,$groups = null) {
intval($remote_user),
intval($owner_id)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$remote_verified = true;
$groups = init_groups_visitor($remote_user);
}
@ -292,7 +292,7 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null)
intval($remote_user),
intval($owner_id)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$remote_verified = true;
$groups = init_groups_visitor($remote_user);
}
@ -403,7 +403,7 @@ function init_groups_visitor($contact_id) {
WHERE `contact-id` = %d ",
intval($contact_id)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
foreach($r as $rr)
$groups[] = $rr['gid'];
}

2
include/session.php

@ -30,7 +30,7 @@ function ref_session_read($id) {
$r = q("SELECT `data` FROM `session` WHERE `sid`= '%s'", dbesc($id));
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$session_exists = true;
return $r[0]['data'];
} else {

14
include/socgraph.php

@ -40,7 +40,7 @@ function poco_load($cid,$uid = 0,$zcid = 0,$url = null) {
$r = q("select `poco`, `uid` from `contact` where `id` = %d limit 1",
intval($cid)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$url = $r[0]['poco'];
$uid = $r[0]['uid'];
}
@ -213,14 +213,14 @@ function poco_check($profile_url, $name, $network, $profile_photo, $about, $loca
$r = q("SELECT `network` FROM `contact` WHERE `nurl` = '%s' AND `network` != '' AND `network` != '%s' LIMIT 1",
dbesc(normalise_link($profile_url)), dbesc(NETWORK_STATUSNET)
);
if(dbm::is_result($r))
if (dbm::is_result($r))
$network = $r[0]["network"];
if (($network == "") OR ($network == NETWORK_OSTATUS)) {
$r = q("SELECT `network`, `url` FROM `contact` WHERE `alias` IN ('%s', '%s') AND `network` != '' AND `network` != '%s' LIMIT 1",
dbesc($profile_url), dbesc(normalise_link($profile_url)), dbesc(NETWORK_STATUSNET)
);
if(dbm::is_result($r)) {
if (dbm::is_result($r)) {
$network = $r[0]["network"];
//$profile_url = $r[0]["url"];
}