Add Last-Modified date for photos.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 27 Nov 2010 21:00:38 +0000 (22:00 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 27 Nov 2010 21:03:02 +0000 (22:03 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/profile.php
core
upgrade/1.0.2/01_photos.sql [new file with mode: 0644]

index 9b2e4b0..bb948e0 100644 (file)
@@ -486,10 +486,10 @@ class Profile
     {
         if ($this->has_photo) {
             if ($data && ($this->photo == null || $this->photo->mimeType == null)) {
-                $res = XDB::fetchOneAssoc('SELECT  attach, attachmime, x, y
+                $res = XDB::fetchOneAssoc('SELECT  attach, attachmime, x, y, last_update
                                              FROM  profile_photos
                                             WHERE  pid = {?}', $this->pid);
-                $this->photo = PlImage::fromData($res['attach'], $res['attachmime'], $res['x'], $res['y']);
+                $this->photo = PlImage::fromData($res['attach'], 'image/' .$res['attachmime'], $res['x'], $res['y'], $res['last_update']);
             } else if ($this->photo == null) {
                 $this->photo = PlImage::fromData(null, null, $this->photo_width, $this->photo_height);
             }
diff --git a/core b/core
index 668cbf4..2055d88 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 668cbf42df8655290abfa1627250e593e1ff6cc7
+Subproject commit 2055d886e01ef029b4eee998cea108351d74c188
diff --git a/upgrade/1.0.2/01_photos.sql b/upgrade/1.0.2/01_photos.sql
new file mode 100644 (file)
index 0000000..62ee66e
--- /dev/null
@@ -0,0 +1,4 @@
+ALTER TABLE  profile_photos
+ ADD COLUMN  last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
+
+-- vim:set syntax=mysql: