Continued rewriting:

- use dba::is_result() everywhere (where I found the old, bad way)
- converted some spaces -> tabs for code
- converted some CRLF -> LF as mixures of both is not good

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2016-05-01 14:24:44 +02:00
commit 3e701b90ac
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
93 changed files with 451 additions and 450 deletions

View file

@ -129,7 +129,7 @@ function item_post(&$a) {
intval($parent_item['contact-id']),
intval($uid)
);
if(count($r))
if(dba::is_result($r))
$parent_contact = $r[0];
// If the contact id doesn't fit with the contact, then set the contact to null
@ -140,7 +140,7 @@ function item_post(&$a) {
$r = q("SELECT * FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
dbesc(normalise_link($thrparent[0]["author-link"])));
if (count($r)) {
if (dba::is_result($r)) {
$parent_contact = $r[0];
$parent_contact["thumb"] = $parent_contact["photo"];
$parent_contact["micro"] = $parent_contact["photo"];
@ -219,7 +219,7 @@ function item_post(&$a) {
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
intval($profile_uid)
);
if(count($r))
if(dba::is_result($r))
$user = $r[0];
if($orig_post) {
@ -322,7 +322,7 @@ function item_post(&$a) {
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
intval(local_user())
);
if(count($r) && intval($r[0]['pubmail']))
if(dba::is_result($r) && intval($r[0]['pubmail']))
$pubmail_enabled = true;
}
}
@ -391,7 +391,7 @@ function item_post(&$a) {
}
}
if(count($r)) {
if(dba::is_result($r)) {
$author = $r[0];
$contact_id = $author['id'];
}
@ -405,7 +405,7 @@ function item_post(&$a) {
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
intval($profile_uid)
);
if(count($r))
if(dba::is_result($r))
$contact_record = $r[0];
}
@ -490,7 +490,7 @@ function item_post(&$a) {
intval($profile_uid),
intval($attach)
);
if(count($r)) {
if(dba::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),
@ -631,7 +631,7 @@ function item_post(&$a) {
intval($profile_uid),
intval($mtch)
);
if(count($r)) {
if(dba::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]';