]> git.mxchange.org Git - friendica.git/blobdiff - include/identity.php
Merge pull request #2102 from annando/1511-unseen-forums
[friendica.git] / include / identity.php
index 3e7c6ed3c0199e623cb93c6174ce04bc8e0a80cb..a785ce981dc8074873c9fb354b2e72a4e31f310d 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-/*
+/**
  * @file include/identity.php
  */
 
@@ -62,17 +62,17 @@ if(! function_exists('profile_load')) {
 
                if($profile) {
                        $profile_int = intval($profile);
-                       $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
+                       $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `contact`.`addr` AS faddr, `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",
+                       $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `contact`.`addr` AS faddr, `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",
                                        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')
        ));