diff options
author | friendica <info@friendica.com> | 2014-08-13 16:34:36 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-08-13 16:34:36 -0700 |
commit | eb38f3f47460bfb00af3dcae815720b2970a31eb (patch) | |
tree | 13c7efd787b705e73e94676347ab2f9fc10f1afc | |
parent | 041aff36b7feb4983a2cc5faed79e54863e06913 (diff) | |
download | volse-hubzilla-eb38f3f47460bfb00af3dcae815720b2970a31eb.tar.gz volse-hubzilla-eb38f3f47460bfb00af3dcae815720b2970a31eb.tar.bz2 volse-hubzilla-eb38f3f47460bfb00af3dcae815720b2970a31eb.zip |
support title and description (and dates which were done earlier) for friendica photo import
-rw-r--r-- | include/photo/photo_driver.php | 12 | ||||
-rw-r--r-- | include/photos.php | 4 | ||||
-rw-r--r-- | util/frphotohelper.php | 2 | ||||
-rw-r--r-- | version.inc | 2 |
4 files changed, 17 insertions, 3 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 5fb08b814..daf1bfc25 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -289,6 +289,8 @@ abstract class photo_driver { $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']); + $p['title'] = (($arr['title']) ? $arr['title'] : ''); + $p['description'] = (($arr['description']) ? $arr['description'] : ''); // 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. @@ -320,6 +322,8 @@ abstract class photo_driver { `scale` = %d, `profile` = %d, `photo_flags` = %d, + `title` = '%s', + `description` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', @@ -342,6 +346,8 @@ abstract class photo_driver { intval($p['scale']), intval($p['profile']), intval($p['photo_flags']), + dbesc($p['title']), + dbesc($p['description']), dbesc($p['allow_cid']), dbesc($p['allow_gid']), dbesc($p['deny_cid']), @@ -351,8 +357,8 @@ abstract class photo_driver { } else { $r = q("INSERT INTO `photo` - ( `aid`, `uid`, `xchan`, `resource_id`, `created`, `edited`, `filename`, type, `album`, `height`, `width`, `data`, `size`, `scale`, `profile`, `photo_flags`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` ) - VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s' )", + ( `aid`, `uid`, `xchan`, `resource_id`, `created`, `edited`, `filename`, type, `album`, `height`, `width`, `data`, `size`, `scale`, `profile`, `photo_flags`, `title`, `description`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` ) + VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s' )", intval($p['aid']), intval($p['uid']), dbesc($p['xchan']), @@ -369,6 +375,8 @@ abstract class photo_driver { intval($p['scale']), intval($p['profile']), intval($p['photo_flags']), + dbesc($p['title']), + dbesc($p['description']), dbesc($p['allow_cid']), dbesc($p['allow_gid']), dbesc($p['deny_cid']), diff --git a/include/photos.php b/include/photos.php index bd61e555d..06a99457a 100644 --- a/include/photos.php +++ b/include/photos.php @@ -175,6 +175,10 @@ function photo_upload($channel, $observer, $args) { $p['created'] = $args['created']; if($args['edited']) $p['edited'] = $args['edited']; + if($args['title']) + $p['title'] = $args['title']; + if($args['description']) + $p['desciprion'] = $args['description']; $r1 = $ph->save($p); diff --git a/util/frphotohelper.php b/util/frphotohelper.php index e8477b096..484e7fcaf 100644 --- a/util/frphotohelper.php +++ b/util/frphotohelper.php @@ -49,6 +49,8 @@ $cookies = 'store/[data]/frphoto_cookie_' . $channel_address; $args['not_visible'] = 1; $args['created'] = $j['created']; $args['edited'] = $j['edited']; + $args['title'] = $j['title']; + $args['description'] = $j['desc']; if($j['allow_cid'] || $j['allow_gid'] || $j['deny_cid'] || $j['deny_gid']) $args['contact_allow'] = $channel['channel_hash']; diff --git a/version.inc b/version.inc index 5552ee1d9..541e61679 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2014-08-12.765 +2014-08-13.766 |