From: Florent Bruneau Date: Sat, 27 Nov 2010 21:00:38 +0000 (+0100) Subject: Add Last-Modified date for photos. X-Git-Tag: xorg/1.0.2~131 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=8d6bbca3841851c290b08eb902b456406a7264a0;p=platal.git Add Last-Modified date for photos. Signed-off-by: Florent Bruneau --- diff --git a/classes/profile.php b/classes/profile.php index 9b2e4b0..bb948e0 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -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 --- 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 index 0000000..62ee66e --- /dev/null +++ b/upgrade/1.0.2/01_photos.sql @@ -0,0 +1,4 @@ +ALTER TABLE profile_photos + ADD COLUMN last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; + +-- vim:set syntax=mysql: