]> git.mxchange.org Git - friendica.git/commitdiff
Coding convention applied:
authorRoland Häder <roland@mxchange.org>
Tue, 20 Dec 2016 09:10:33 +0000 (10:10 +0100)
committerRoland Häder <roland@mxchange.org>
Tue, 20 Dec 2016 09:19:33 +0000 (10:19 +0100)
- space between "if" and brace
- curly braces on conditional blocks

Signed-off-by: Roland Häder <roland@mxchange.org>
Conflicts:
include/lock.php

53 files changed:
boot.php
include/dfrn.php
include/follow.php
include/group.php
include/like.php
include/lock.php
include/notifier.php
include/onepoll.php
include/redir.php
include/socgraph.php
include/text.php
mod/allfriends.php
mod/attach.php
mod/common.php
mod/community.php
mod/contactgroup.php
mod/contacts.php
mod/content.php
mod/crepair.php
mod/delegate.php
mod/dfrn_confirm.php
mod/dfrn_notify.php
mod/dfrn_poll.php
mod/dfrn_request.php
mod/fsuggest.php
mod/group.php
mod/ignored.php
mod/item.php
mod/lockview.php
mod/lostpass.php
mod/manage.php
mod/match.php
mod/message.php
mod/modexp.php
mod/network.php
mod/poke.php
mod/post.php
mod/profiles.php
mod/profperm.php
mod/pubsub.php
mod/receive.php
mod/salmon.php
mod/search.php
mod/settings.php
mod/starred.php
mod/subthread.php
mod/suggest.php
mod/tagrm.php
mod/viewcontacts.php
mod/wall_attach.php
mod/wall_upload.php
mod/wallmessage.php
mod/xrd.php

index b282f8d48e0b64577860cfcad7da20c4d943a75d..c500468e5fadb5b028f564c95ad029500518c8f6 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1028,7 +1028,7 @@ class App {
                } else {
                        $r = q("SELECT `contact`.`avatar-date` AS picdate FROM `contact` WHERE `contact`.`thumb` like '%%/%s'",
                                $common_filename);
-                       if(! dbm::is_result($r)){
+                       if (! dbm::is_result($r)) {
                                $this->cached_profile_image[$avatar_image] = $avatar_image;
                        } else {
                                $this->cached_profile_picdate[$common_filename] = "?rev=".urlencode($r[0]['picdate']);
index 6451b8521bf326bac30fccdf00e3b19d8c8e28aa..689c5c28324b0a934739ef2fe79c33dd01af1588 100644 (file)
@@ -105,8 +105,9 @@ class dfrn {
                        dbesc($owner_nick)
                );
 
-               if(! dbm::is_result($r))
+               if (! dbm::is_result($r)) {
                        killme();
+               }
 
                $owner = $r[0];
                $owner_id = $owner['uid'];
@@ -139,8 +140,9 @@ class dfrn {
                                intval($owner_id)
                        );
 
-                       if(! dbm::is_result($r))
+                       if (! dbm::is_result($r)) {
                                killme();
+                       }
 
                        $contact = $r[0];
                        require_once('include/security.php');
index d7066bcb555fa4df86d16889bd1584f27f0ae084..e67beb84c2a6252e9437782285b7a26f22ddcbef 100644 (file)
@@ -254,7 +254,7 @@ function new_contact($uid,$url,$interactive = false) {
                intval($uid)
        );
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                $result['message'] .=  t('Unable to retrieve contact information.') . EOL;
                return $result;
        }
index 2c903306864da2caa1ef4368212faffb6c016c43..67712aae7c45924f3146762d8a03629c1a293940 100644 (file)
@@ -143,13 +143,14 @@ function group_add_member($uid,$name,$member,$gid = 0) {
                return true;    // You might question this, but
                                // we indicate success because the group member was in fact created
                                // -- It was just created at another time
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                $r = q("INSERT INTO `group_member` (`uid`, `gid`, `contact-id`)
                        VALUES( %d, %d, %d ) ",
                        intval($uid),
                        intval($gid),
                        intval($member)
-       );
+               );
+       }
        return $r;
 }
 
index 8239633e6a362261754332dc334c267203921b13..8223cf3626080ec9803ac0fb8f8819ffb13012da 100644 (file)
@@ -78,8 +78,9 @@ function do_like($item_id, $verb) {
                        intval($item['contact-id']),
                        intval($item['uid'])
                );
-               if(! dbm::is_result($r))
+               if (! dbm::is_result($r)) {
                        return false;
+               }
                if(! $r[0]['self'])
                        $remote_owner = $r[0];
        }
index d49fda343fffde651d38fca6e6931006b82e54ee..b3d488a3577fba08fe2bf01bf5ac44c689f3cf12 100644 (file)
@@ -23,7 +23,7 @@ function lock_function($fn_name, $block = true, $wait_sec = 2, $timeout = 30) {
                        );
                        $got_lock = true;
                }
-               elseif(! dbm::is_result($r)) {
+               elseif (! dbm::is_result($r)) {
                        /// @TODO the Boolean value for count($r) should be equivalent to the Boolean value of $r
                        q("INSERT INTO `locks` (`name`, `created`, `locked`) VALUES ('%s', '%s', 1)",
                                dbesc($fn_name),
index c4e7df47ace727370873d89493e1cbf2d4fed481..8823834c1d361ed1535afa6ae92d5b52708c07cc 100644 (file)
@@ -210,8 +210,9 @@ function notifier_run(&$argv, &$argc){
                intval($uid)
        );
 
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                return;
+       }
 
        $owner = $r[0];
 
index 2834036665bad1c3ef0a6d7629761726acd40711..d92cb915b6eb0ce96801086699f40c01fa542866 100644 (file)
@@ -143,8 +143,9 @@ function onepoll_run(&$argv, &$argc){
        $r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` INNER JOIN `user` on `contact`.`uid` = `user`.`uid` WHERE `user`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
                intval($importer_uid)
        );
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                return;
+       }
 
        $importer = $r[0];
 
index 8d65089de7556f201a96123621045f2ccda312f8..d8bb7643965963c7ebe195e04e564bcc22b4a947 100644 (file)
@@ -36,9 +36,9 @@ function auto_redir(&$a, $contact_nick) {
                dbesc($nurl)
                );
 
-               if((! dbm::is_result($r)) || $r[0]['id'] == remote_user())
+               if ((! dbm::is_result($r)) || $r[0]['id'] == remote_user()) {
                        return;
-
+               }
 
                $r = q("SELECT * FROM contact WHERE nick = '%s'
                        AND network = '%s' AND uid = %d  AND url LIKE '%%%s%%' LIMIT 1",
@@ -48,8 +48,9 @@ function auto_redir(&$a, $contact_nick) {
                       dbesc($baseurl)
                );
 
-               if(! dbm::is_result($r))
+               if (! dbm::is_result($r)) {
                        return;
+               }
 
                $cid = $r[0]['id'];
 
index c5fc31581eb0c0ab41c1c6cd834b80f8e05148b4..598eb3737326fe6fab4a6d98614126467f6d952c 100644 (file)
@@ -330,7 +330,7 @@ function poco_check($profile_url, $name, $network, $profile_photo, $about, $loca
                intval($gcid),
                intval($zcid)
        );
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                q("INSERT INTO `glink` (`cid`,`uid`,`gcid`,`zcid`, `updated`) VALUES (%d,%d,%d,%d, '%s') ",
                        intval($cid),
                        intval($uid),
index a2c474d32e206dd028855655afadf0096c533258..05801d024c6dcb7c1a59d07bde902fe6fe35a637 100644 (file)
@@ -2000,8 +2000,9 @@ function file_tag_unsave_file($uid,$item,$file,$cat = false) {
                intval($item),
                intval($uid)
        );
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                return false;
+       }
 
        q("UPDATE `item` SET `file` = '%s' WHERE `id` = %d AND `uid` = %d",
                dbesc(str_replace($pattern,'',$r[0]['file'])),
@@ -2020,11 +2021,11 @@ function file_tag_unsave_file($uid,$item,$file,$cat = false) {
        //$r = q("select file from item where uid = %d and deleted = 0 " . file_tag_file_query('item',$file,(($cat) ? 'category' : 'file')),
        //);
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                $saved = get_pconfig($uid,'system','filetags');
                set_pconfig($uid,'system','filetags',str_replace($pattern,'',$saved));
-
        }
+
        return true;
 }
 
index 1f2c043ced881b84cd1fc47aee0796ec635b2f95..e4f067eaf7d4cd1b0aef62fcf800895eee17c41d 100644 (file)
@@ -39,7 +39,7 @@ function allfriends_content(&$a) {
 
        $r = all_friends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']);
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                $o .= t('No friends to display.');
                return $o;
        }
index 274acfc2bed8af1f4e23af00eb267e6fa9925cfd..94cb75a386d2a7f6d7ae7681635a495d8f39d7ad 100644 (file)
@@ -16,7 +16,7 @@ function attach_init(&$a) {
        $r = q("SELECT * FROM `attach` WHERE `id` = %d LIMIT 1",
                intval($item_id)
        );
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                notice( t('Item was not found.'). EOL);
                return;
        }
@@ -29,7 +29,7 @@ function attach_init(&$a) {
                dbesc($item_id)
        );
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                notice( t('Permission denied.') . EOL);
                return;
        }
index 9f9379be57d989cc0dff050ab44eafe7ddb11995..9781d1607c4f38011ff0e0e081912e63ca51406b 100644 (file)
@@ -94,7 +94,7 @@ function common_content(&$a) {
                $r = common_friends_zcid($uid, $zcid, $a->pager['start'], $a->pager['itemspage']);
 
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                return $o;
        }
 
index 40d4016f338b2b6738c1abc6e3f7666d888e8b0f..c8f04d8bd619e67bea2afe626065c20b0c1e3a60 100644 (file)
@@ -71,7 +71,7 @@ function community_content(&$a, $update = 0) {
 
        $r = community_getitems($a->pager['start'], $a->pager['itemspage']);
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                info( t('No results.') . EOL);
                return $o;
        }
index 4456db2f5326a4ae5bdd7ba5a9dea9dba8fefa0e..0671ff42ae45d314f63d617f65a30565d7d7e06c 100644 (file)
@@ -24,7 +24,7 @@ function contactgroup_content(&$a) {
                        intval($a->argv[1]),
                        intval(local_user())
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        killme();
                }
 
index 37cc09cab6b968592299a6168475bf689b9f75a2..22e08b8c96037514c426d0415c081b20f03a352a 100644 (file)
@@ -19,7 +19,7 @@ function contacts_init(&$a) {
                        intval(local_user()),
                        intval($contact_id)
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        $contact_id = 0;
                }
        }
@@ -169,7 +169,7 @@ function contacts_post(&$a) {
                        intval($profile_id),
                        intval(local_user())
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        notice( t('Could not locate selected profile.') . EOL);
                        return;
                }
index bc98f7e51d3a5226648db0e8eca1afbe1f8628fa..332a35f006c472fd5ab4b26f40ce8cad2354e725 100644 (file)
@@ -113,7 +113,7 @@ function content_content(&$a, $update = 0) {
                        intval($group),
                        intval($_SESSION['uid'])
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        if($update)
                                killme();
                        notice( t('No such group') . EOL );
index b4275f6baa2d4f2a709c57a25de218b6265778c8..66faadb06a0483bf0fcc3503e773a58574efb673 100644 (file)
@@ -14,7 +14,7 @@ function crepair_init(&$a) {
                        intval(local_user()),
                        intval($contact_id)
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        $contact_id = 0;
                }
        }
@@ -43,8 +43,9 @@ function crepair_post(&$a) {
                );
        }
 
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                return;
+       }
 
        $contact = $r[0];
 
@@ -110,7 +111,7 @@ function crepair_content(&$a) {
                );
        }
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                notice( t('Contact not found.') . EOL);
                return;
        }
index 343e1e3038ab5d4b1417e3d3bfbdd167b3a428cd..0ba5dd39c1e53d36eda5f35caf4079aa0bfcdff0 100644 (file)
@@ -97,7 +97,7 @@ function delegate_content(&$a) {
                dbesc(NETWORK_DFRN)
        ); 
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                notice( t('No potential page delegates located.') . EOL);
                return;
        }
index 7097b0117a116bd7f3dac65d1c8a6fded8f56364..69d708f7fc3e9b99f540f300c7f3b38a0440a555 100644 (file)
@@ -121,7 +121,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                        intval($uid)
                );
 
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        logger('Contact not found in DB.');
                        notice( t('Contact not found.') . EOL );
                        notice( t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL );
@@ -553,7 +553,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
                        dbesc($node));
 
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        $message = sprintf(t('No user record found for \'%s\' '), $node);
                        xml_status(3,$message); // failure
                        // NOTREACHED
@@ -640,7 +640,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                        dbesc($dfrn_pubkey),
                        intval($dfrn_record)
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        $message = t('Unable to set your contact credentials on our system.');
                        xml_status(3,$message);
                }
index dfa2af18ce29985901409d3d3149879811a7b8e7..ca12211583d4b116d6a503772ab012878a30edaf 100644 (file)
@@ -42,7 +42,7 @@ function dfrn_notify_post(&$a) {
                dbesc($dfrn_id),
                dbesc($challenge)
        );
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                logger('dfrn_notify: could not match challenge to dfrn_id ' . $dfrn_id . ' challenge=' . $challenge);
                xml_status(3);
        }
@@ -88,7 +88,7 @@ function dfrn_notify_post(&$a) {
                dbesc($a->argv[1])
        );
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                logger('dfrn_notify: contact not found for dfrn_id ' . $dfrn_id);
                xml_status(3);
                //NOTREACHED
@@ -284,8 +284,9 @@ function dfrn_notify_content(&$a) {
                                dbesc($a->argv[1])
                );
 
-               if(! dbm::is_result($r))
+               if (! dbm::is_result($r)) {
                        $status = 1;
+               }
 
                logger("Remote rino version: ".$rino_remote." for ".$r[0]["url"], LOGGER_DEBUG);
 
index 7c3fced12fc397607149109a0fd4f1aa50949457..0c55af2a8959f26f86ca7e6cdba4d9b054794115 100644 (file)
@@ -126,7 +126,7 @@ function dfrn_poll_init(&$a) {
                        $r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1",
                                dbesc($sec)
                        );
-                       if(! dbm::is_result($r)) {
+                       if (! dbm::is_result($r)) {
                                xml_status(3, 'No ticket');
                                // NOTREACHED
                        }
@@ -223,7 +223,7 @@ function dfrn_poll_post(&$a) {
                        $r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1",
                                dbesc($sec)
                        );
-                       if(! dbm::is_result($r)) {
+                       if (! dbm::is_result($r)) {
                                xml_status(3, 'No ticket');
                                // NOTREACHED
                        }
@@ -284,8 +284,9 @@ function dfrn_poll_post(&$a) {
                dbesc($challenge)
        );
 
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                killme();
+       }
 
        $type = $r[0]['type'];
        $last_update = $r[0]['last_update'];
@@ -319,8 +320,9 @@ function dfrn_poll_post(&$a) {
        $r = q("SELECT * FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1");
 
 
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                killme();
+       }
 
        $contact = $r[0];
        $owner_uid = $r[0]['uid'];
index 24a1dc0725788fe1ec0347f0751411103650d7ca..7a8021784de9d3d0671ee5283dc7737aa72d5e63 100644 (file)
@@ -371,7 +371,7 @@ function dfrn_request_post(&$a) {
                                        intval($uid)
                                );
 
-                               if(! dbm::is_result($r)) {
+                               if (! dbm::is_result($r)) {
                                        notice( t('This account has not been configured for email. Request failed.') . EOL);
                                        return;
                                }
@@ -842,8 +842,9 @@ function dfrn_request_content(&$a) {
                        $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
                                intval($a->profile['uid'])
                        );
-                       if(! dbm::is_result($r))
+                       if (! dbm::is_result($r)) {
                                $mail_disabled = 1;
+                       }
                }
 
                // "coming soon" is disabled for now
index 1d56f4573625f175e1e4f9f24adb93bda97c6eb6..4370952ca1dd80997e270f7b2ff1c168659681c5 100644 (file)
@@ -16,7 +16,7 @@ function fsuggest_post(&$a) {
                intval($contact_id),
                intval(local_user())
        );
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                notice( t('Contact not found.') . EOL);
                return;
        }
@@ -88,7 +88,7 @@ function fsuggest_content(&$a) {
                intval($contact_id),
                intval(local_user())
        );
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                notice( t('Contact not found.') . EOL);
                return;
        }
index 33b819ed5d3c493793ffbc331b529e3a30192302..c4854a602d15fc95ce975e2066591b1f644f7279 100644 (file)
@@ -43,7 +43,7 @@ function group_post(&$a) {
                        intval($a->argv[1]),
                        intval(local_user())
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        notice( t('Group not found.') . EOL );
                        goaway(App::get_baseurl() . '/contacts');
                        return; // NOTREACHED
@@ -136,7 +136,7 @@ function group_content(&$a) {
                        intval($a->argv[1]),
                        intval(local_user())
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        notice( t('Group not found.') . EOL );
                        goaway(App::get_baseurl() . '/contacts');
                }
index eec204c7088474a269e57c45542b3173b9fdc29c..4aeeb21e6b98a38b1a5acadc069a298a119468de 100644 (file)
@@ -16,8 +16,9 @@ function ignored_init(&$a) {
                intval(local_user()),
                intval($message_id)
        );
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                killme();
+       }
 
        if(! intval($r[0]['ignored']))
                $ignored = 1;
index c741f16144e001ff595ea2142158daf95d024d8a..7bee5f3eaea52cd5f8adec1542dcbf011d301fb5 100644 (file)
@@ -112,7 +112,7 @@ function item_post(&$a) {
                        }
                }
 
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        notice( t('Unable to locate original post.') . EOL);
                        if(x($_REQUEST,'return'))
                                goaway($return_path);
@@ -464,8 +464,9 @@ function item_post(&$a) {
                                        intval($profile_uid)
                                );
 
-                               if(! dbm::is_result($r))
+                               if (! dbm::is_result($r)) {
                                        continue;
+                               }
 
                                $r = q("UPDATE `photo` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s'
                                        WHERE `resource-id` = '%s' AND `uid` = %d AND `album` = '%s' ",
index c806fc317550b4d8e1f82ef4ee40fddf178855f0..68b5d30cfeffd878f97034cdab626845c33c15e6 100644 (file)
@@ -21,8 +21,9 @@ function lockview_content(&$a) {
                dbesc($type),
                intval($item_id)
        );
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                killme();
+       }
        $item = $r[0];
 
        call_hooks('lockview_content', $item);
index 122024d26b7594c7d7e7a8f716356bbeed4c0f9e..92e64f7e2e49b235da8547976cb9e3e686e42425 100644 (file)
@@ -15,7 +15,7 @@ function lostpass_post(&$a) {
                dbesc($loginame)
        );
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                notice( t('No valid account found.') . EOL);
                goaway(z_root());
        }
@@ -87,7 +87,7 @@ function lostpass_content(&$a) {
                $r = q("SELECT * FROM `user` WHERE `pwdreset` = '%s' LIMIT 1",
                        dbesc($hash)
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        $o =  t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed.");
                        return $o;
                }
index 4a4f0a9e377f32e49754c6ea2855605bee09612c..2138595beefc914da535594ad14432cbb98ce068 100644 (file)
@@ -56,8 +56,9 @@ function manage_post(&$a) {
                );
        }
 
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                return;
+       }
 
        unset($_SESSION['authenticated']);
        unset($_SESSION['uid']);
index f7fe325b3868937786e2b2cc9fd9728c849babd4..69bf3c1101142f33bdd98c3ef40669d12f0d46c5 100644 (file)
@@ -27,8 +27,9 @@ function match_content(&$a) {
        $r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
                intval(local_user())
        );
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                return;
+       }
        if(! $r[0]['pub_keywords'] && (! $r[0]['prv_keywords'])) {
                notice( t('No keywords to match. Please add keywords to your default profile.') . EOL);
                return;
index 0a2c797b425f0a94961b1f43aa9fb3d05779dafc..b0d0ba95ca54d92d7503306e8b54e7c8871bda8b 100644 (file)
@@ -381,7 +381,7 @@ function message_content(&$a) {
 
                $r = get_messages(local_user(), $a->pager['start'], $a->pager['itemspage']);
 
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        info( t('No messages.') . EOL);
                        return $o;
                }
index d1dabb101b3834aec9d7ef9cbfe5f0d15e5e3920..3729e3236cc2460989031b62c83ca91963432514 100644 (file)
@@ -12,8 +12,9 @@ function modexp_init(&$a) {
                        dbesc($nick)
        );
 
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                killme();
+       }
 
        $lines = explode("\n",$r[0]['spubkey']);
        unset($lines[0]);
index 057ef791453e8b67f3057cc7fa867cfe67f125f4..c040a547a4b97a0a62ae7caa3640fd289db387ba 100644 (file)
@@ -126,7 +126,7 @@ function network_init(&$a) {
                        intval(local_user()),
                        dbesc($search)
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        q("INSERT INTO `search` ( `uid`,`term` ) VALUES ( %d, '%s') ",
                                intval(local_user()),
                                dbesc($search)
@@ -463,7 +463,7 @@ function network_content(&$a, $update = 0) {
                        intval($group),
                        intval($_SESSION['uid'])
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        if($update)
                                killme();
                        notice( t('No such group') . EOL );
index 0619a34e07535a2682466729d5d3c1ca3143aa8b..fea5c0c0d8ceda163f3616963e039e0dc12bfa23 100644 (file)
@@ -52,7 +52,7 @@ function poke_init(&$a) {
                intval($uid)
        );
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                logger('poke: no contact ' . $contact_id);
                return;
        }
index 76282d29a5390bf706d59957dc9e40769f7830cb..a8d345ecb6c7af48e85454db79314259eb5e66e9 100644 (file)
@@ -23,8 +23,9 @@ function post_post(&$a) {
                                AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
                        dbesc($nickname)
                );
-               if(! dbm::is_result($r))
+               if (! dbm::is_result($r)) {
                        http_status_exit(500);
+               }
 
                $importer = $r[0];
        }
index a5f5609b6b52f2c068297e6ec0819d12d8c0185e..44067032ea527a05f71d0048a686785a1ce44264 100644 (file)
@@ -15,7 +15,7 @@ function profiles_init(&$a) {
                        intval($a->argv[2]),
                        intval(local_user())
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        notice( t('Profile not found.') . EOL);
                        goaway('profiles');
                        return; // NOTREACHED
@@ -130,7 +130,7 @@ function profiles_init(&$a) {
                        intval($a->argv[1]),
                        intval(local_user())
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        notice( t('Profile not found.') . EOL);
                        killme();
                        return;
@@ -613,7 +613,7 @@ function profiles_content(&$a) {
                        intval($a->argv[1]),
                        intval(local_user())
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        notice( t('Profile not found.') . EOL);
                        return;
                }
index 1c37f84ab2fca78f9703d2c74ac9075d7eeee380..aa610d3a93082821c4906a62a640678f071baf34 100644 (file)
@@ -52,7 +52,7 @@ function profperm_content(&$a) {
                        intval($a->argv[1]),
                        intval(local_user())
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        notice( t('Invalid profile identifier.') . EOL );
                        return;
                }
index ddda7ec228a9e9ff0718e3eb732d7beccaad2ec7..ea7e1000bade84bfde27357ba359fd5f75bd83d1 100644 (file)
@@ -47,7 +47,7 @@ function pubsub_init(&$a) {
                $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
                        dbesc($nick)
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        logger('pubsub: local account not found: ' . $nick);
                        hub_return(false, '');
                }
@@ -62,7 +62,7 @@ function pubsub_init(&$a) {
                        intval($contact_id),
                        intval($owner['uid'])
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        logger('pubsub: contact '.$contact_id.' not found.');
                        hub_return(false, '');
                }
@@ -117,8 +117,9 @@ function pubsub_post(&$a) {
        $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
                dbesc($nick)
        );
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                hub_post_return();
+       }
 
        $importer = $r[0];
 
@@ -131,7 +132,7 @@ function pubsub_post(&$a) {
                dbesc(NETWORK_FEED)
        );
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                logger('pubsub: no contact record for "'.$nick.' ('.$contact_id.')" - ignored. '.$xml);
                hub_post_return();
        }
index dd4e61ae4f95ce43cbb4fd8b47b1ae20c6072ae3..99e3648e91d3ae20d93e8b309404457d8cacd1c9 100644 (file)
@@ -34,8 +34,9 @@ function receive_post(&$a) {
                $r = q("SELECT * FROM `user` WHERE `guid` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
                        dbesc($guid)
                );
-               if(! dbm::is_result($r))
+               if (! dbm::is_result($r)) {
                        http_status_exit(500);
+               }
 
                $importer = $r[0];
        }
index 78cdc09328685158a9dcc931a7b22963e0471a9d..ff5856a946861a7ae91ea2cae7e5f87004dac08f 100644 (file)
@@ -31,8 +31,9 @@ function salmon_post(&$a) {
        $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
                dbesc($nick)
        );
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                http_status_exit(500);
+       }
 
        $importer = $r[0];
 
@@ -150,7 +151,7 @@ function salmon_post(&$a) {
                dbesc(normalise_link($author_link)),
                intval($importer['uid'])
        );
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                logger('mod-salmon: Author unknown to us.');
                if(get_pconfig($importer['uid'],'system','ostatus_autofriend')) {
                        $result = new_contact($importer['uid'],$author_link);
index d36cc8fcb73ee22f8d64e90b534406fce62da040..c19bb27673a83f2d91b6dd8a7a5eb679d4f0f4b8 100644 (file)
@@ -53,7 +53,7 @@ function search_init(&$a) {
                                intval(local_user()),
                                dbesc($search)
                        );
-                       if(! dbm::is_result($r)) {
+                       if (! dbm::is_result($r)) {
                                q("INSERT INTO `search` (`uid`,`term`) VALUES ( %d, '%s')",
                                        intval(local_user()),
                                        dbesc($search)
@@ -219,7 +219,7 @@ function search_content(&$a) {
                                intval($a->pager['start']), intval($a->pager['itemspage']));
        }
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                info( t('No results.') . EOL);
                return $o;
        }
index 41783815e7fd3b4364166bf7f87291cc042efb61..e7fd55e944657e0fd5c296abced49520bfa4fea1 100644 (file)
@@ -225,7 +225,7 @@ function settings_post(&$a) {
                                $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
                                        intval(local_user())
                                );
-                               if(! dbm::is_result($r)) {
+                               if (! dbm::is_result($r)) {
                                        q("INSERT INTO `mailacct` (`uid`) VALUES (%d)",
                                                intval(local_user())
                                        );
@@ -752,8 +752,9 @@ function settings_content(&$a) {
                $settings_addons = "";
 
                $r = q("SELECT * FROM `hook` WHERE `hook` = 'plugin_settings' ");
-               if(! dbm::is_result($r))
+               if (! dbm::is_result($r)) {
                        $settings_addons = t('No Plugin settings configured');
+               }
 
                call_hooks('plugin_settings', $settings_addons);
 
index 5acbb393ef74ccace54c1ac04f74222485bf7a9c..0e5e75d1674bf335d6267bf984c208f1a3f2e941 100644 (file)
@@ -18,8 +18,9 @@ function starred_init(&$a) {
                intval(local_user()),
                intval($message_id)
        );
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                killme();
+       }
 
        if(! intval($r[0]['starred']))
                $starred = 1;
index dc014047a0bdf151fc18b1971b7f646734849d91..66072bcc881a293543de899a93db7e8bb1f0a5d5 100644 (file)
@@ -41,8 +41,9 @@ function subthread_content(&$a) {
                        intval($item['contact-id']),
                        intval($item['uid'])
                );
-               if(! dbm::is_result($r))
+               if (! dbm::is_result($r)) {
                        return;
+               }
                if(! $r[0]['self'])
                        $remote_owner = $r[0];
        }
index 080decc71a86f9cde1f504ea4aea8a38652ab4c3..73f5ffe4b218722247617cf42ab9dcbd9590b6c5 100644 (file)
@@ -67,7 +67,7 @@ function suggest_content(&$a) {
 
        $r = suggestion_query(local_user());
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                $o .= t('No suggestions available. If this is a new site, please try again in 24 hours.');
                return $o;
        }
index 08d390a70bb7112719dca1eee875396632499efa..d6e57d36a93fe3e3664799b8158580e07bc49761 100644 (file)
@@ -19,8 +19,9 @@ function tagrm_post(&$a) {
                intval(local_user())
        );
 
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
+       }
 
        $arr = explode(',', $r[0]['tag']);
        for($x = 0; $x < count($arr); $x ++) {
@@ -68,8 +69,9 @@ function tagrm_content(&$a) {
                intval(local_user())
        );
 
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
+       }
 
        $arr = explode(',', $r[0]['tag']);
 
index c9f465676cfe6da34991f3290cae8a998b0a10be..3fd5d79e1b4ae16cfaa12739745656617d53b3d9 100644 (file)
@@ -16,8 +16,9 @@ function viewcontacts_init(&$a) {
                        dbesc($nick)
                );
 
-               if(! dbm::is_result($r))
+               if (! dbm::is_result($r)) {
                        return;
+               }
 
                $a->data['user'] = $r[0];
                $a->profile_uid = $r[0]['uid'];
index 80fc1c6e796e71c11940e7e3f3f10f40e529f7f6..525d3509c17516f33efb52276eefba803db15d0b 100644 (file)
@@ -12,7 +12,7 @@ function wall_attach_post(&$a) {
                $r = q("SELECT `user`.*, `contact`.`id` FROM `user` LEFT JOIN `contact` on `user`.`uid` = `contact`.`uid`  WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 and `contact`.`self` = 1 LIMIT 1",
                        dbesc($nick)
                );
-               if(! dbm::is_result($r)){
+               if (! dbm::is_result($r)) {
                        if ($r_json) {
                                echo json_encode(array('error'=>t('Invalid request.')));
                                killme();
@@ -168,7 +168,7 @@ function wall_attach_post(&$a) {
                dbesc($hash)
        );
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                $msg = t('File upload failed.');
                if ($r_json) {
                        echo json_encode(array('error'=>$msg));
index e27729098518a16688aeb8398bad523710a17cb5..eb2a92323ab0115b489e92bb371039d02b17e0f6 100644 (file)
@@ -15,7 +15,7 @@ function wall_upload_post(&$a, $desktopmode = true) {
                                dbesc($nick)
                        );
 
-                       if(! dbm::is_result($r)){
+                       if (! dbm::is_result($r)) {
                                if ($r_json) {
                                        echo json_encode(array('error'=>t('Invalid request.')));
                                        killme();
index 03a0b7a16f57e0e3aafbf3683792ea06dbb68cd6..afe25cbe8be9dfeb3fa0ac86c1023baa864f0e82 100644 (file)
@@ -22,7 +22,7 @@ function wallmessage_post(&$a) {
                dbesc($recipient)
        );
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                logger('wallmessage: no recipient');
                return;
        }
@@ -91,7 +91,7 @@ function wallmessage_content(&$a) {
                dbesc($recipient)
        );
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                notice( t('No recipient.') . EOL);
                logger('wallmessage: no recipient');
                return;
index 576ae9b38fafdd462738d4487595556925021ebf..290c524a7d7aac3446159346b22989f54c068084 100644 (file)
@@ -21,8 +21,9 @@ function xrd_init(&$a) {
        $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
                dbesc($name)
        );
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                killme();
+       }
 
        $salmon_key = salmon_key($r[0]['spubkey']);