diff options
author | zotlabs <mike@macgirvin.com> | 2019-04-27 17:20:38 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2019-04-27 17:20:38 -0700 |
commit | 9536a490b3fc5fc02a6d0a79275e8df03ee8156b (patch) | |
tree | e3e52f17fcfe9fa19dce22f8dbd25aef916878d4 /Zotlabs/Module/Poster.php | |
parent | 0c1e80320887f9e1152edc4017f0639080ede6cc (diff) | |
download | volse-hubzilla-9536a490b3fc5fc02a6d0a79275e8df03ee8156b.tar.gz volse-hubzilla-9536a490b3fc5fc02a6d0a79275e8df03ee8156b.tar.bz2 volse-hubzilla-9536a490b3fc5fc02a6d0a79275e8df03ee8156b.zip |
Add jot videos inline and with poster if possible
Diffstat (limited to 'Zotlabs/Module/Poster.php')
-rw-r--r-- | Zotlabs/Module/Poster.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Zotlabs/Module/Poster.php b/Zotlabs/Module/Poster.php new file mode 100644 index 000000000..10317ee61 --- /dev/null +++ b/Zotlabs/Module/Poster.php @@ -0,0 +1,37 @@ +<?php + +namespace Zotlabs\Module; + +use Zotlabs\Web\Controller; + +require_once('include/security.php'); + +class Poster extends Controller { + + function init() { + + $nick = argv(1); + $hash = argv(2); + + if(! ($nick && $hash)) { + return; + } + + $u = channelx_by_nick($nick); + + $sql_extra = permissions_sql(intval($u['channel_id'])); + + $r = q("select content from attach where hash = '%s' and uid = %d and os_storage = 1 $sql_extra limit 1", + dbesc($hash), + intval($u['channel_id']) + ); + if($r) { + $path = dbunescbin($r[0]['content']); + if($path && @file_exists($path . '.thumb')) { + header('Content-Type: image/jpeg'); + echo file_get_contents($path . '.thumb'); + killme(); + } + } + } +} |