]> git.mxchange.org Git - friendica.git/blobdiff - mod/photo.php
Merge github.com:tobiasd/friendika
[friendica.git] / mod / photo.php
index 4e0b85b451f03085c914226890d7ed9c9b3269d0..7f13d1cbf83db67d765ccf3d6c527f2b81bd9c1c 100644 (file)
@@ -13,18 +13,25 @@ function photo_init(&$a) {
                case 1:
                default:
                        killme();
-                       return; // NOTREACHED
+                       // NOTREACHED
        }
 
+       $default = 'images/default-profile.jpg';
+
        if(isset($type)) {
                switch($type) {
 
                        case 'profile':
                                $resolution = 4;
                                break;
+                       case 'micro':
+                               $resolution = 6;
+                               $default = 'images/default-profile-mm.jpg';
+                               break;
                        case 'avatar':
                        default:
                                $resolution = 5;
+                               $default = 'images/default-profile-sm.jpg';
                                break;
                }
 
@@ -38,9 +45,7 @@ function photo_init(&$a) {
                        $data = $r[0]['data'];
                }
                if(! isset($data)) {
-                       $data = file_get_contents(($resolution == 5) 
-                               ? 'images/default-profile-sm.jpg' 
-                               : 'images/default-profile.jpg');
+                       $data = file_get_contents($default);
                }
        }
        else {
@@ -106,15 +111,13 @@ function photo_init(&$a) {
                }
        }
 
-       if(x($data) === false) {
+       if(! isset($data)) {
                killme();
-               return; // NOTREACHED
+               // NOTREACHED
        }
 
-        header("Content-type: image/jpeg");
-       header('Expires: ' . datetime_convert('UTC','UTC', 'now + 3 months', 'D, d M Y H:i:s' . ' GMT'));
-//     header("Cache-Control: max-age=36000, only-if-cached");
-        echo $data;
+       header("Content-type: image/jpeg");
+       echo $data;
        killme();
-       return; //NOTREACHED
+       // NOTREACHED
 }
\ No newline at end of file