diff options
Diffstat (limited to 'Zotlabs/Daemon/Xchan_photo.php')
-rw-r--r-- | Zotlabs/Daemon/Xchan_photo.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/Xchan_photo.php b/Zotlabs/Daemon/Xchan_photo.php new file mode 100644 index 000000000..f90d1d726 --- /dev/null +++ b/Zotlabs/Daemon/Xchan_photo.php @@ -0,0 +1,34 @@ +<?php + +/** @file */ + +namespace Zotlabs\Daemon; + +class Xchan_photo { + + static public function run($argc, $argv) { + + if ($argc != 3) { + return; + } + + $url = hex2bin($argv[1]); + $xchan = hex2bin($argv[2]); + + $photos = import_xchan_photo($url, $xchan); + if ($photos) { + $result = q("update xchan set xchan_photo_date = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s' where xchan_hash = '%s'", + dbescdate(datetime_convert()), + dbesc($photos[0]), + dbesc($photos[1]), + dbesc($photos[2]), + dbesc($photos[3]), + dbesc($xchan) + ); + + if (! $result) { + logger("xchan update failed for $url"); + } + } + } +} |