]> git.mxchange.org Git - friendica.git/commitdiff
Merge git://github.com/friendica/friendica
authorZvi ben Yaakov (a.k.a rdc) <coderzvi@infosoc.net>
Tue, 19 Jun 2012 20:29:24 +0000 (23:29 +0300)
committerZvi ben Yaakov (a.k.a rdc) <coderzvi@infosoc.net>
Tue, 19 Jun 2012 20:29:24 +0000 (23:29 +0300)
1  2 
boot.php
mod/photos.php

diff --combined boot.php
index ecd95aceccd88724889c7f8b4a23c3b910f0730e,e8bd1087bf048e300aafcdd5937d706398a97c13..97085c1e79b6c3a7456cd14c1f87d3182948614a
+++ b/boot.php
@@@ -10,7 -10,7 +10,7 @@@ require_once('include/nav.php')
  require_once('include/cache.php');
  
  define ( 'FRIENDICA_PLATFORM',     'Friendica');
- define ( 'FRIENDICA_VERSION',      '3.0.1377' );
+ define ( 'FRIENDICA_VERSION',      '3.0.1378' );
  define ( 'DFRN_PROTOCOL_VERSION',  '2.23'    );
  define ( 'DB_UPDATE_VERSION',      1149      );
  
@@@ -332,9 -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;
                        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];
 +              }
 +
  
        }
  }
@@@ -1155,9 -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){
diff --combined mod/photos.php
index c6065f3cade82fbbbc13d60e3df835b160b490da,4fa8aca082cfcc4e229d54de5b85af90222abb0a..91adbb33b7dd479ac0a992a7c109bd6c816831f8
@@@ -16,7 -16,7 +16,7 @@@ function photos_init(&$a) 
  
        if($a->argc > 1) {
                $nick = $a->argv[1];
 -              $r = q("SELECT `user`.*, `contact`.`avatar-date` AS picdate FROM `user` LEFT JOIN `contact` on `contact`.`uid` = `user`.`uid` WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 LIMIT 1",
 +              $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `blocked` = 0 LIMIT 1",
                        dbesc($nick)
                );
  
@@@ -36,7 -36,7 +36,7 @@@
  
                        $o .= '<div class="vcard">';
                        $o .= '<div class="fn">' . $a->data['user']['username'] . '</div>';
 -                      $o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg?rev=' . urlencode($a->data['user']['picdate']) . '" alt="' . $a->data['user']['username'] . '" /></div>';
 +                      $o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg') . '" alt="' . $a->data['user']['username'] . '" /></div>';
                        $o .= '</div>';
                        
                        if(! intval($a->data['user']['hidewall'])) {
@@@ -718,6 -718,7 +718,7 @@@ function photos_post(&$a) 
                killme();
        }
  
+       $ph->orient($src);
        @unlink($src);
  
        $width  = $ph->getWidth();