summaryrefslogtreecommitdiff
path: root/public/app/models/cms/Media_model.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-27 03:47:30 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-27 03:47:30 +0300
commit059e0d95d0c28bc5060e87e146eaf7411f51bf90 (patch)
tree7c21ac432f16dde2329a0d5954d70711eceb48e6 /public/app/models/cms/Media_model.php
parent26cd8ee99659ef1926c96a049c93645ffc9b169d (diff)
downloadgyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.tar.gz
gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.tar.bz2
gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.zip
skeleton commit; based on an anom project
Diffstat (limited to 'public/app/models/cms/Media_model.php')
-rw-r--r--public/app/models/cms/Media_model.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/public/app/models/cms/Media_model.php b/public/app/models/cms/Media_model.php
new file mode 100644
index 0000000..6a4a681
--- /dev/null
+++ b/public/app/models/cms/Media_model.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace app\models\cms;
+
+use \Registry;
+
+
+class Media_model
+{
+ public static function serve($type, $id, $ticket)
+ {
+
+ // get media data
+ // [ type =>, rights =>, path => ]
+
+ // validate ticket
+ // ValidateAccess::for($ticket)
+
+ // serve
+ // header("Content-type: type");
+ // passthru('cat $media_path');
+
+
+ return Registry::use('database')->query(
+ "SELECT * FROM pages
+ WHERE FullFriendlyUrl = :url AND IsActive = 1",
+ [ ':url' => $url ]
+ )->getFirst();
+ }
+
+}
+
+
+
+// check:
+// https://stackoverflow.com/questions/1353850/serve-image-with-php-script-vs-direct-loading-an-image \ No newline at end of file