From bbf857ba39c87cf907be88ecd013e961f5ad1a7f Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 12 Nov 2011 17:50:14 -0800 Subject: [PATCH] add revision date to main profile photo to overcome cache when updated, other photos (e.g. conversations) must wait for cache update --- boot.php | 14 ++++++++------ view/profile_vcard.tpl | 2 +- view/theme/duepuntozero/profile_vcard.tpl | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/boot.php b/boot.php index be33594e4d..a3e4855277 100644 --- a/boot.php +++ b/boot.php @@ -796,17 +796,17 @@ function profile_load(&$a, $nickname, $profile = 0) { if($profile) { $profile_int = intval($profile); - $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` - LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid` - WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d LIMIT 1", + $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile` + left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid` + WHERE `user`.`nickname` = '%s' AND `profile`.`id` = %d and `contact`.`self` = 1 LIMIT 1", dbesc($nickname), intval($profile_int) ); } if(! count($r)) { - $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` - LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid` - WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 LIMIT 1", + $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile` + left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid` + WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 and `contact`.`self` = 1 LIMIT 1", dbesc($nickname) ); } @@ -881,6 +881,8 @@ function profile_sidebar($profile, $block = 0) { if((! is_array($profile)) && (! count($profile))) return $o; + $profile['picdate'] = urlencode($profile['picdate']); + call_hooks('profile_sidebar_enter', $profile); diff --git a/view/profile_vcard.tpl b/view/profile_vcard.tpl index c78eb9b7f5..5bcbfd0b02 100644 --- a/view/profile_vcard.tpl +++ b/view/profile_vcard.tpl @@ -21,7 +21,7 @@ {{ if $pdesc }}
$profile.pdesc
{{ endif }} -
$profile.name
+
$profile.name
diff --git a/view/theme/duepuntozero/profile_vcard.tpl b/view/theme/duepuntozero/profile_vcard.tpl index b3f5cc50d6..154f22363c 100644 --- a/view/theme/duepuntozero/profile_vcard.tpl +++ b/view/theme/duepuntozero/profile_vcard.tpl @@ -5,7 +5,7 @@ {{ if $pdesc }}
$profile.pdesc
{{ endif }} -
$profile.name
+
$profile.name