aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/photo/photo_driver.php10
-rw-r--r--include/photos.php5
2 files changed, 11 insertions, 4 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index f5e915402..5fb08b814 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -287,6 +287,8 @@ abstract class photo_driver {
$p['allow_gid'] = (($arr['allow_gid']) ? $arr['allow_gid'] : '');
$p['deny_cid'] = (($arr['deny_cid']) ? $arr['deny_cid'] : '');
$p['deny_gid'] = (($arr['deny_gid']) ? $arr['deny_gid'] : '');
+ $p['created'] = (($arr['created']) ? $arr['created'] : datetime_convert());
+ $p['edited'] = (($arr['edited']) ? $arr['edited'] : $p['created']);
// temporary until we get rid of photo['profile'] and just use photo['photo_flags']
// but this will require updating all existing photos in the DB.
@@ -328,8 +330,8 @@ abstract class photo_driver {
intval($p['uid']),
dbesc($p['xchan']),
dbesc($p['resource_id']),
- dbesc(datetime_convert()),
- dbesc(datetime_convert()),
+ dbesc($p['created']),
+ dbesc($p['edited']),
dbesc(basename($p['filename'])),
dbesc($this->getType()),
dbesc($p['album']),
@@ -355,8 +357,8 @@ abstract class photo_driver {
intval($p['uid']),
dbesc($p['xchan']),
dbesc($p['resource_id']),
- dbesc(datetime_convert()),
- dbesc(datetime_convert()),
+ dbesc($p['created']),
+ dbesc($p['edited']),
dbesc(basename($p['filename'])),
dbesc($this->getType()),
dbesc($p['album']),
diff --git a/include/photos.php b/include/photos.php
index 8bedfd15d..bd61e555d 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -171,6 +171,11 @@ function photo_upload($channel, $observer, $args) {
'allow_cid' => $str_contact_allow, 'allow_gid' => $str_group_allow,
'deny_cid' => $str_contact_deny, 'deny_gid' => $str_group_deny
);
+ if($args['created'])
+ $p['created'] = $args['created'];
+ if($args['edited'])
+ $p['edited'] = $args['edited'];
+
$r1 = $ph->save($p);
if(! $r1)