aboutsummaryrefslogtreecommitdiffstats
path: root/include/photo/photo_driver.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-03-14 22:02:28 -0700
committerMario Vavti <mario@mariovavti.com>2017-03-29 13:44:17 +0200
commitfa5115b3ed017f6aa22c99cad563de3934b171c2 (patch)
treec991038cb13bfbbbead26a6a66f82f26b38e1e0b /include/photo/photo_driver.php
parentec5e1067bc0a949ceea7e28dbf11873e693b2586 (diff)
downloadvolse-hubzilla-fa5115b3ed017f6aa22c99cad563de3934b171c2.tar.gz
volse-hubzilla-fa5115b3ed017f6aa22c99cad563de3934b171c2.tar.bz2
volse-hubzilla-fa5115b3ed017f6aa22c99cad563de3934b171c2.zip
add os_path and display_path to photos, fix some issues with multiple path separators after cloud/nickname in the content field of attach and photos
Diffstat (limited to 'include/photo/photo_driver.php')
-rw-r--r--include/photo/photo_driver.php88
1 files changed, 2 insertions, 86 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index c8b3c3782..923e34dbe 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -380,7 +380,7 @@ abstract class photo_driver {
dbesc($p['album']),
intval($this->getHeight()),
intval($this->getWidth()),
- (intval($p['os_storage']) ? dbescbin($p['os_path']) : dbescbin($this->imageString())),
+ (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())),
intval($p['os_storage']),
intval(strlen($this->imageString())),
intval($p['imgscale']),
@@ -411,7 +411,7 @@ abstract class photo_driver {
dbesc($p['album']),
intval($this->getHeight()),
intval($this->getWidth()),
- (intval($p['os_storage']) ? dbescbin($p['os_path']) : dbescbin($this->imageString())),
+ (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())),
intval($p['os_storage']),
intval(strlen($this->imageString())),
intval($p['imgscale']),
@@ -429,90 +429,6 @@ abstract class photo_driver {
return $r;
}
-
- // should be obsolete now
-
- public function store($aid, $uid, $xchan, $rid, $filename, $album, $scale, $usage = PHOTO_NORMAL, $allow_cid = '', $allow_gid = '', $deny_cid = '', $deny_gid = '') {
-
- $x = q("select id from photo where resource_id = '%s' and uid = %d and xchan = '%s' and imgscale = %d limit 1",
- dbesc($rid),
- intval($uid),
- dbesc($xchan),
- intval($scale)
- );
- if(count($x)) {
- $r = q("UPDATE photo
- set aid = %d,
- uid = %d,
- xchan = '%s',
- resource_id = '%s',
- created = '%s',
- edited = '%s',
- filename = '%s',
- mimetype = '%s',
- album = '%s',
- height = %d,
- width = %d,
- content = '%s',
- filesize = %d,
- imgscale = %d,
- photo_usage = %d,
- allow_cid = '%s',
- allow_gid = '%s',
- deny_cid = '%s',
- deny_gid = '%s'
- where id = %d",
-
- intval($aid),
- intval($uid),
- dbesc($xchan),
- dbesc($rid),
- dbesc(datetime_convert()),
- dbesc(datetime_convert()),
- dbesc(basename($filename)),
- dbesc($this->getType()),
- dbesc($album),
- intval($this->getHeight()),
- intval($this->getWidth()),
- dbescbin($this->imageString()),
- intval(strlen($this->imageString())),
- intval($scale),
- intval($photo_usage),
- dbesc($allow_cid),
- dbesc($allow_gid),
- dbesc($deny_cid),
- dbesc($deny_gid),
- intval($x[0]['id'])
- );
- }
- else {
- $r = q("INSERT INTO photo
- ( aid, uid, xchan, resource_id, created, edited, filename, mimetype, album, height, width, content, filesize, imgscale, photo_usage, allow_cid, allow_gid, deny_cid, deny_gid )
- VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s' )",
- intval($aid),
- intval($uid),
- dbesc($xchan),
- dbesc($rid),
- dbesc(datetime_convert()),
- dbesc(datetime_convert()),
- dbesc(basename($filename)),
- dbesc($this->getType()),
- dbesc($album),
- intval($this->getHeight()),
- intval($this->getWidth()),
- dbescbin($this->imageString()),
- intval(strlen($this->imageString())),
- intval($scale),
- intval($photo_usage),
- dbesc($allow_cid),
- dbesc($allow_gid),
- dbesc($deny_cid),
- dbesc($deny_gid)
- );
- }
- return $r;
- }
-
}