]> git.mxchange.org Git - friendica.git/commitdiff
Cleanup for #3010 - added spaces, thanks to @annando .
authorRoland Häder <roland@mxchange.org>
Wed, 14 Dec 2016 08:42:36 +0000 (09:42 +0100)
committerRoland Häder <roland@mxchange.org>
Wed, 14 Dec 2016 08:42:36 +0000 (09:42 +0100)
Signed-off-by: Roland Häder <roland@mxchange.org>
36 files changed:
include/Contact.php
include/ForumManager.php
include/NotificationsManager.php
include/Probe.php
include/acl_selectors.php
include/api.php
include/contact_selectors.php
include/contact_widgets.php
include/conversation.php
include/datetime.php
include/dbstructure.php
include/dfrn.php
include/diaspora.php
include/enotify.php
include/event.php
include/expire.php
include/fcontact.php
include/follow.php
include/gprobe.php
include/group.php
include/identity.php
include/items.php
include/like.php
include/lock.php
include/message.php
include/notifier.php
include/oauth.php
include/onepoll.php
include/plugin.php
include/queue_fn.php
include/security.php
include/session.php
include/socgraph.php
include/text.php
include/threads.php
include/user.php

index 03294f04072db906d0fb59234b58d4c4a1c778d1..871418bf57600d34f6fbd46a67228161f805b5c9 100644 (file)
@@ -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 '';
 }
index d01ece4d95377fb2f3643484d095fda8ebeb74ee..c2a20df29faf069bd0b3fc987b33e3d12b918e7f 100644 (file)
@@ -88,7 +88,7 @@ class ForumManager {
                $total = count($contacts);
                $visible_forums = 10;
 
-               if(dbm::is_result($contacts)) {
+               if (dbm::is_result($contacts)) {
 
                        $id = 0;
 
index 13a2534e1e42b6e36e5072fd40b1f75719a0d871..2adab59721e4cd48d88c482eea03f9ad3681997d 100644 (file)
@@ -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 (
index e0d0be2a8edfd322af99edda269e51ed36a0fd74..779476bce265337e222a2bfd5e5d862ff7e8e3d3 100644 (file)
@@ -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']);
index 6b0a822cc25ebf54102489831f2dcf8c525ae9dc..ed9c634c23a8073950eb6ae40e146444e8554737 100644 (file)
@@ -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",
index f627955cf458caedceba65254b98c4faafb1de71..1ec65762028f64a95e616a06d8d32176d6d1d64f 100644 (file)
                                dbesc(trim($user)),
                                dbesc($encrypted)
                        );
-                       if(dbm::is_result($r))
+                       if (dbm::is_result($r))
                                $record = $r[0];
                }
 
                        intval(api_user())
                );
 
-               if(!dbm::is_result($r))
+               if (!dbm::is_result($r))
                        return;
 
                $ids = array();
index 8a7dd5606113202a4e0d66a0589adf0db2e18aa9..0790e503ea3d24cef132442f8e949dac98e5333d 100644 (file)
@@ -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";
index e0a33eee08728fc7dbf7608fd7c30a8f4dd4862f..f66d23c518e5b16125d91c7d3381f92b17404ea2 100644 (file)
@@ -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'];
                        }
                }
index 08350ac89aa03da84422d76f6c5e31c6aa0c9439..567bf83e1bfdb2e7b0d2d0a38af11fc2b37f298e 100644 (file)
@@ -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'];
index d614818cecde6d125df2a289f665ff3135fb8b98..e88c274ab967449649311a592171af1f7be4a9a8 100644 (file)
@@ -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']);
index cd80a0865d31d0b822ce71dab07afe520f206459..c694014f68fae8b11b7d952bc538b1efac9b8f56 100644 (file)
@@ -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;
                        }
                }
index 27be0c32a24c7e74312054b9f8edb4a0514a61b5..3a8bf1224e83e9dec925f595deaa9656ef5d359f 100644 (file)
@@ -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"])
                                                );
index 453cc5cef8ba79517e5babdf264491bc0eba6be9..94c6ccfb8d201dfa55b7e1e766ca72dece17af88 100644 (file)
@@ -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];
index 1adc6e9e6517378f0b1d9bc026cd7a942b99ee4b..aa736492f8e3a9876917ee33d5ab672a89ef74a5 100644 (file)
@@ -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);
 
index 1f08da5fbed0614f249a9204be725ba327839321..6a292a2c074778c8d67039e4feba0d47b211e594 100644 (file)
@@ -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;
 }
 
index 5110713cdbef639c7ae2d449f28dc12efc9cc309..eca2b1c42ad9a7ee3962c047e8c67e7faeb22051 100644 (file)
@@ -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']);
index 037b5ead4a1f6125e002eef118d5bef4b8cf951f..b2706e51a0226e3cc13bfd6cafb4179a8c249fd6 100644 (file)
@@ -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'];
        }
 
index b775bf2002594a2cb8d46a3101ca63d466941711..f753206efcde106f36f06bb48d60bccbf0c1d174 100644 (file)
@@ -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);
index 42a8ef71355d1fc8a044c254de0e82ef6c42a762..7169aada3f7e38435d194f770c62f8186794b9da 100644 (file)
@@ -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']));
index 0cef2bf90057a782cbc01af36a937e20031d1cfb..2c903306864da2caa1ef4368212faffb6c016c43 100644 (file)
@@ -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'];
        }
index fb0f99dd67ade44dd8cc15799cfc91579a45477d..bf05a005160eb81d83e7a1012bf21052f98bba82 100644 (file)
@@ -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) {
index 459c993fda28d80734d13343c6b5b816c0d1aef0..da9147faddddd4da00cc2d7050b74cfe6c2d7dd2 100644 (file)
@@ -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);
        }
index ae2addb89d5556ec0ff8f88fc3d9cb12f42c110f..5b6d1b9e6e7fbf642b768396fee1fe305dea4232 100644 (file)
@@ -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
index 433363e4f113d9a220707d1874b44765d306ad01..0c7b6acaa4afbaa45c440fccb194399ea60539d2 100644 (file)
@@ -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));
index 041110440450df8fdf0729b23075a32cc386253d..ea2fcef3bcb213e24ed280b844f05c90507d3f91 100644 (file)
@@ -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) {
index 49c4bc619ee77244a501431d565958008e33255d..33eeee62fd5b9eaa6eea7f0091358f5d0ba56410 100644 (file)
@@ -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
index 761a7a42c8e442a508db33166e544822653436a0..a30232df4a89a89f990172ccfb018bab4bd73429 100644 (file)
@@ -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;
index 2f9bb35d36af17cd0a6cfd9b90a90a5eb7ce7652..2834036665bad1c3ef0a6d7629761726acd40711 100644 (file)
@@ -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'];
                                                }
 
index 3a92b621be56287849fff25b6dce6181bb0b2491..487ab575156d4812d6d959922496ac5f04efdb1a 100644 (file)
@@ -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'];
                }
        }
index df9ab6b4cbc950f048040486f68f926a27017d5f..3030acc28db92699b55f7fc566c6b81f1283da77 100644 (file)
@@ -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;
index 35a23b3af88a314682a1070e0fd8e7bd393562f4..fa698c1b1a62aeb48e5ea9953507eb3c6fec0e81 100644 (file)
@@ -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'];
        }
index 8aca6cb53d356c37d294e14d8d0e968f93c7021c..31024060f3c0c7c1f465a6cee6fde44af8a4c0bf 100644 (file)
@@ -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 {
index d4a7f5c94bdc457554930624f1c6668393f2fb2f..c7f0c7091af0ef2e060c6eaeb9cbaff2c221e2b5 100644 (file)
@@ -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"];
                }
@@ -976,7 +976,7 @@ function count_common_friends($uid,$cid) {
        );
 
 //     logger("count_common_friends: $uid $cid {$r[0]['total']}");
-       if(dbm::is_result($r))
+       if (dbm::is_result($r))
                return $r[0]['total'];
        return 0;
 
@@ -1022,7 +1022,7 @@ function count_common_friends_zcid($uid,$zcid) {
                intval($uid)
        );
 
-       if(dbm::is_result($r))
+       if (dbm::is_result($r))
                return $r[0]['total'];
        return 0;
 
@@ -1061,7 +1061,7 @@ function count_all_friends($uid,$cid) {
                intval($uid)
        );
 
-       if(dbm::is_result($r))
+       if (dbm::is_result($r))
                return $r[0]['total'];
        return 0;
 
@@ -1207,7 +1207,7 @@ function update_suggestions() {
                dbesc(NETWORK_DFRN), dbesc(NETWORK_DIASPORA)
        );
 
-       if(dbm::is_result($r)) {
+       if (dbm::is_result($r)) {
                foreach($r as $rr) {
                        $base = substr($rr['poco'],0,strrpos($rr['poco'],'/'));
                        if(! in_array($base,$done))
index 7161478971cefb707ea399c5a395217d64ff229b..5856226c3725ea3eac596c69bbf781afce18d8b7 100644 (file)
@@ -491,7 +491,7 @@ function item_new_uri($hostname,$uid, $guid = "") {
 
                $r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1",
                        dbesc($uri));
-               if(dbm::is_result($r))
+               if (dbm::is_result($r))
                        $dups = true;
        } while($dups == true);
        return $uri;
@@ -515,7 +515,7 @@ function photo_new_resource() {
                $r = q("SELECT `id` FROM `photo` WHERE `resource-id` = '%s' LIMIT 1",
                        dbesc($resource)
                );
-               if(dbm::is_result($r))
+               if (dbm::is_result($r))
                        $found = true;
        } while($found == true);
        return $resource;
@@ -882,7 +882,7 @@ function contact_block() {
                        dbesc(NETWORK_OSTATUS),
                        dbesc(NETWORK_DIASPORA)
        );
-       if(dbm::is_result($r)) {
+       if (dbm::is_result($r)) {
                $total = intval($r[0]['total']);
        }
        if(! $total) {
@@ -901,7 +901,7 @@ function contact_block() {
                                dbesc(NETWORK_DIASPORA),
                                intval($shown)
                );
-               if(dbm::is_result($r)) {
+               if (dbm::is_result($r)) {
                        $contacts = "";
                        foreach ($r AS $contact)
                                $contacts[] = $contact["id"];
@@ -909,7 +909,7 @@ function contact_block() {
                        $r = q("SELECT `id`, `uid`, `addr`, `url`, `name`, `thumb`, `network` FROM `contact` WHERE `id` IN (%s)",
                                dbesc(implode(",", $contacts)));
 
-                       if(dbm::is_result($r)) {
+                       if (dbm::is_result($r)) {
                                $contacts = sprintf( tt('%d Contact','%d Contacts', $total),$total);
                                $micropro = Array();
                                foreach($r as $rr) {
@@ -1932,7 +1932,7 @@ function file_tag_update_pconfig($uid,$file_old,$file_new,$type = 'file') {
                        //      intval($uid)
                        //);
 
-                       if(dbm::is_result($r)) {
+                       if (dbm::is_result($r)) {
                                unset($deleted_tags[$key]);
                        }
                        else {
@@ -1962,7 +1962,7 @@ function file_tag_save_file($uid,$item,$file) {
                intval($item),
                intval($uid)
        );
-       if(dbm::is_result($r)) {
+       if (dbm::is_result($r)) {
                if(! stristr($r[0]['file'],'[' . file_tag_encode($file) . ']'))
                        q("UPDATE `item` SET `file` = '%s' WHERE `id` = %d AND `uid` = %d",
                                dbesc($r[0]['file'] . '[' . file_tag_encode($file) . ']'),
index 2eb05a8a360da0ff46b54a4471b0dc0cae178968..48391174ecd683eaaf9d577f6e1d777d64d1d8c0 100644 (file)
@@ -174,7 +174,7 @@ function add_shadow_entry($itemid) {
 function update_thread_uri($itemuri, $uid) {
        $messages = q("SELECT `id` FROM `item` WHERE uri ='%s' AND uid=%d", dbesc($itemuri), intval($uid));
 
-       if(dbm::is_result($messages))
+       if (dbm::is_result($messages))
                foreach ($messages as $message)
                        update_thread($message["id"]);
 }
index 240a8aa503c5479181627c954051c976521ac140..7e97a1ddf2ff9d72ee6c0685bdd7a1f84ced9d9a 100644 (file)
@@ -130,7 +130,7 @@ function create_user($arr) {
                $r = q("SELECT * FROM `user` WHERE `email` = '%s' LIMIT 1",
                        dbesc($email)
                );
-               if(dbm::is_result($r))
+               if (dbm::is_result($r))
                        $result['message'] .= t('Cannot use that email.') . EOL;
        }
 
@@ -143,7 +143,7 @@ function create_user($arr) {
                WHERE `nickname` = '%s' LIMIT 1",
                dbesc($nickname)
        );
-       if(dbm::is_result($r))
+       if (dbm::is_result($r))
                $result['message'] .= t('Nickname is already registered. Please choose another.') . EOL;
 
        // Check deleted accounts that had this nickname. Doesn't matter to us,
@@ -153,7 +153,7 @@ function create_user($arr) {
                WHERE `username` = '%s' LIMIT 1",
                dbesc($nickname)
        );
-       if(dbm::is_result($r))
+       if (dbm::is_result($r))
                $result['message'] .= t('Nickname was once registered here and may not be re-used. Please choose another.') . EOL;
 
        if(strlen($result['message'])) {
@@ -222,7 +222,7 @@ function create_user($arr) {
                        dbesc($username),
                        dbesc($new_password_encoded)
                );
-               if(dbm::is_result($r)) {
+               if (dbm::is_result($r)) {
                        $u = $r[0];
                        $newuid = intval($r[0]['uid']);
                }
@@ -302,7 +302,7 @@ function create_user($arr) {
                        intval($newuid),
                        dbesc(t('Friends'))
                );
-               if(dbm::is_result($r)) {
+               if (dbm::is_result($r)) {
                        $def_gid = $r[0]['id'];
 
                        q("UPDATE `user` SET `def_gid` = %d WHERE `uid` = %d",