aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php33
1 files changed, 29 insertions, 4 deletions
diff --git a/boot.php b/boot.php
index e8bd1087b..3d0d5098d 100644
--- a/boot.php
+++ b/boot.php
@@ -10,7 +10,7 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
-define ( 'FRIENDICA_VERSION', '3.0.1378' );
+define ( 'FRIENDICA_VERSION', '3.0.1379' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1149 );
@@ -332,6 +332,9 @@ if(! class_exists('App')) {
private $curl_code;
private $curl_headers;
+ private $cached_profile_image;
+ private $cached_profile_picdate;
+
function __construct() {
global $default_timezone;
@@ -543,6 +546,28 @@ if(! class_exists('App')) {
return $this->curl_headers;
}
+ function get_cached_avatar_image($avatar_image){
+ if($this->cached_profile_image[$avatar_image])
+ return $this->cached_profile_image[$avatar_image];
+
+ $path_parts = explode("/",$avatar_image);
+ $common_filename = $path_parts[count($path_parts)-1];
+
+ if($this->cached_profile_picdate[$common_filename]){
+ $this->cached_profile_image[$avatar_image] = $avatar_image . $this->cached_profile_picdate[$common_filename];
+ } else {
+ $r = q("SELECT `contact`.`avatar-date` AS picdate FROM `contact` WHERE `contact`.`thumb` like \"%%/%s\"",
+ $common_filename);
+ if(! count($r)){
+ $this->cached_profile_image[$avatar_image] = $avatar_image;
+ } else {
+ $this->cached_profile_picdate[$common_filename] = "?rev=" . urlencode($r[0]['picdate']);
+ $this->cached_profile_image[$avatar_image] = $avatar_image . $this->cached_profile_picdate[$common_filename];
+ }
+ }
+ return $this->cached_profile_image[$avatar_image];
+ }
+
}
}
@@ -1130,9 +1155,9 @@ if(! function_exists('profile_sidebar')) {
'fullname' => $profile['name'],
'firstname' => $firstname,
'lastname' => $lastname,
- 'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg',
- 'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg',
- 'photo50' => $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg',
+ 'photo300' => $a->get_cached_avatar_image($a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg'),
+ 'photo100' => $a->get_cached_avatar_image($a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg'),
+ 'photo50' => $a->get_cached_avatar_image($a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg'),
);
if (!$block){