]> git.mxchange.org Git - friendica.git/commitdiff
forumlist: some little code unification
authorrabuzarus <>
Tue, 10 Nov 2015 19:31:13 +0000 (20:31 +0100)
committerrabuzarus <>
Tue, 10 Nov 2015 19:31:13 +0000 (20:31 +0100)
include/identity.php

index 3e7c6ed3c0199e623cb93c6174ce04bc8e0a80cb..5c233a32f236a3ee9e1032b4bed35c3afd35402a 100644 (file)
@@ -64,15 +64,15 @@ if(! function_exists('profile_load')) {
                        $profile_int = intval($profile);
                        $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
                                        INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
-                                       WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d and `contact`.`self` = 1 LIMIT 1",
+                                       WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d AND `contact`.`self` = 1 LIMIT 1",
                                        dbesc($nickname),
                                        intval($profile_int)
                        );
                }
                if((!$r) && (!count($r))) {
                        $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
-                                       INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
-                                       WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 and `contact`.`self` = 1 LIMIT 1",
+                                       INNER JOIN `contact` ON `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
+                                       WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 AND `contact`.`self` = 1 LIMIT 1",
                                        dbesc($nickname)
                        );
                }
@@ -87,7 +87,7 @@ if(! function_exists('profile_load')) {
                // fetch user tags if this isn't the default profile
 
                if(!$r[0]['is-default']) {
-                       $x = q("select `pub_keywords` from `profile` where uid = %d and `is-default` = 1 limit 1",
+                       $x = q("SELECT `pub_keywords` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
                                        intval($r[0]['profile_uid'])
                        );
                        if($x && count($x))
@@ -311,7 +311,7 @@ if(! function_exists('profile_sidebar')) {
                                if(count($r))
                                        $updated =  date("c", strtotime($r[0]['updated']));
 
-                               $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0
+                               $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0
                                                AND `network` IN ('%s', '%s', '%s', '')",
                                        intval($profile['uid']),
                                        dbesc(NETWORK_DFRN),
@@ -532,7 +532,7 @@ function advanced_profile(&$a) {
        $o = '';
        $uid = $a->profile['uid'];
 
-       $o .= replace_macros(get_markup_template("section_title.tpl"),array(
+       $o .= replace_macros(get_markup_template('section_title.tpl'),array(
                '$title' => t('Profile')
        ));