From a67710bc7cca030c74a71d4462c9ab55fa44d783 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Tue, 10 Nov 2015 20:31:13 +0100 Subject: [PATCH] forumlist: some little code unification --- include/identity.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/identity.php b/include/identity.php index 3e7c6ed3c0..5c233a32f2 100644 --- a/include/identity.php +++ b/include/identity.php @@ -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') )); -- 2.39.5