diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-12 18:00:00 +0200 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-12 18:00:00 +0200 |
| commit | 221af3a2e035bd6689294509feb52f286d3bd5be (patch) | |
| tree | 811188225d6edc9f303c777f86aa8604c6f21743 /html/app/models/cms | |
| parent | 8b1a9cca9ca949d431f6ef5cf2b1fba0f27b4209 (diff) | |
| download | classroom-221af3a2e035bd6689294509feb52f286d3bd5be.tar.gz classroom-221af3a2e035bd6689294509feb52f286d3bd5be.tar.bz2 classroom-221af3a2e035bd6689294509feb52f286d3bd5be.zip | |
database connection and documentation API
Diffstat (limited to 'html/app/models/cms')
| -rw-r--r-- | html/app/models/cms/Media_model.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/html/app/models/cms/Media_model.php b/html/app/models/cms/Media_model.php index e69de29..6a4a681 100644 --- a/html/app/models/cms/Media_model.php +++ b/html/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 |
