aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Poster.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-04-29 11:58:59 +0200
committerMario <mario@mariovavti.com>2019-04-29 11:58:59 +0200
commit674215e9e6632ac22a1b87f9996f0323f5949d94 (patch)
tree152c71c2b99c337ec3ca35d9644a6fe4ec9ff5a4 /Zotlabs/Module/Poster.php
parentdce6a5763d925e6bf70c6a293be079a05269ce36 (diff)
parentd89d6e8a01ef9af0d300c192367445c385e0252b (diff)
downloadvolse-hubzilla-674215e9e6632ac22a1b87f9996f0323f5949d94.tar.gz
volse-hubzilla-674215e9e6632ac22a1b87f9996f0323f5949d94.tar.bz2
volse-hubzilla-674215e9e6632ac22a1b87f9996f0323f5949d94.zip
Merge branch 'dev' into 'dev'
Add jot videos inline and with poster if possible See merge request hubzilla/core!1613
Diffstat (limited to 'Zotlabs/Module/Poster.php')
-rw-r--r--Zotlabs/Module/Poster.php37
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();
+ }
+ }
+ }
+}