]> git.mxchange.org Git - friendica.git/commitdiff
add revision date to main profile photo to overcome cache when updated, other photos...
authorfriendica <info@friendica.com>
Sun, 13 Nov 2011 01:50:14 +0000 (17:50 -0800)
committerfriendica <info@friendica.com>
Sun, 13 Nov 2011 01:50:14 +0000 (17:50 -0800)
boot.php
view/profile_vcard.tpl
view/theme/duepuntozero/profile_vcard.tpl

index be33594e4df5f5785ddd8dfbc19999169ef65219..a3e4855277b2bee7636a330766da70d1b561aa37 100644 (file)
--- 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);
 
        
index c78eb9b7f5e14a43879d0affa6a041b5fb1064a7..5bcbfd0b02e147aa32b81f2c86988fbc14d0dd09 100644 (file)
@@ -21,7 +21,7 @@
                                
        
        {{ if $pdesc }}<div class="title">$profile.pdesc</div>{{ endif }}
-       <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="$profile.photo" alt="$profile.name" /></div>
+       <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="$profile.photo?rev=$profile.picdate" alt="$profile.name" /></div>
 
 
 
index b3f5cc50d6570a43dc99f9d522b9949859d340a5..154f22363ce6118ce3c80c104a449d4024b503d1 100644 (file)
@@ -5,7 +5,7 @@
                                
        
        {{ if $pdesc }}<div class="title">$profile.pdesc</div>{{ endif }}
-       <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="$profile.photo" alt="$profile.name"></div>
+       <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="$profile.photo?rev=$profile.picdate" alt="$profile.name"></div>