aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-10-18 19:51:27 -0700
committerfriendica <info@friendica.com>2012-10-18 19:51:27 -0700
commit0b37d4efd69de4306bb27de8d19090c5f1149abc (patch)
tree76c39f1a4e7b0c609721fa216e0b4af843d62009
parentf685b676567e990a1105100230a2cf1ba6d55ee9 (diff)
downloadvolse-hubzilla-0b37d4efd69de4306bb27de8d19090c5f1149abc.tar.gz
volse-hubzilla-0b37d4efd69de4306bb27de8d19090c5f1149abc.tar.bz2
volse-hubzilla-0b37d4efd69de4306bb27de8d19090c5f1149abc.zip
fix profile
-rw-r--r--boot.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/boot.php b/boot.php
index 9fb49dbd5..d731069dc 100644
--- a/boot.php
+++ b/boot.php
@@ -1156,19 +1156,22 @@ function profile_load(&$a, $nickname, $profile = 0) {
$r = null;
+//TODO needs avatar_date !!
+
if($profile) {
$profile_int = intval($profile);
- $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar_date` AS picdate, channel.* FROM `profile`
- left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN channel ON `profile`.`uid` = channel.channel_id
- WHERE channel.channel_address = '%s' AND `profile`.`id` = %d and `contact`.`self` = 1 LIMIT 1",
+ $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , channel.* FROM `profile`
+ LEFT JOIN channel ON `profile`.`uid` = channel.channel_id
+ WHERE channel.channel_address = '%s' AND `profile`.`id` = %d 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, `channel`.* FROM `profile`
- left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `channel` ON `profile`.`uid` = channel.channel_id
- WHERE channel.channel_address = '%s' AND `profile`.`is_default` = 1 and `contact`.`self` = 1 LIMIT 1",
+ $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `channel`.* FROM `profile`
+ LEFT JOIN `channel` ON `profile`.`uid` = channel.channel_id
+ WHERE channel.channel_address = '%s' AND `profile`.`is_default` = 1 LIMIT 1",
dbesc($nickname)
);
}