diff options
Diffstat (limited to 'public')
-rw-r--r-- | public/css/style.css | 9 | ||||
-rw-r--r-- | public/index.php | 2 | ||||
-rw-r--r-- | public/m/index.php | 104 |
3 files changed, 115 insertions, 0 deletions
diff --git a/public/css/style.css b/public/css/style.css index 7fb75c0..b0d8cc1 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -165,4 +165,13 @@ nav a { top: 0px; left: 0px; width: 8%; +} + +.thumbnail { + max-width: 100px; +} + +.grid { + display: flex; + flex-wrap: wrap; }
\ No newline at end of file diff --git a/public/index.php b/public/index.php index f935eed..40202a3 100644 --- a/public/index.php +++ b/public/index.php @@ -1,4 +1,6 @@ <html> <a href="/w/">w</a> +<br/> +<a href="/m/">m</a> </html>
\ No newline at end of file diff --git a/public/m/index.php b/public/m/index.php new file mode 100644 index 0000000..f5e101d --- /dev/null +++ b/public/m/index.php @@ -0,0 +1,104 @@ +<?php + +// _____________________________________________________ R E Q U I R E ________________________________________________________________ + + +$config = require('../../config.php'); + + + +require('../../fn/fn.php'); +require('../../class/class.art.php'); +require('../../class/class.app.php'); +require('../../class/class.aff.php'); +session(); +if (!isset($_SESSION['level'])) { + $level = 0; +} else { + $level = $_SESSION['level']; +} +$app = new App($config); +$aff = new Aff($level); + + + +// ______________________________________________________ H E A D _____________________________________________________________ +$titre = 'home'; +$aff->head($titre); + +// _____________________________________________________ A L E R T _______________________________________________________________ + +if (isset($_GET['message'])) { + echo '<h4>' . $_GET['message'] . '</h4>'; +} + + + +// ____________________________________________________ A C T I O N _______________________________________________________________ + + +if (isset($_POST['action'])) { + switch ($_POST['action']) { + case 'addmedia': + $app->addmedia($_FILES, 2 ** 30, $_POST['id']); + break; + } +} + +// ______________________________________________________ B O D Y _______________________________________________________________ + + + +echo '<body>'; +$aff->nav($app); +$aff->addmedia(); + +echo '<h1>Media</h1>'; + +var_dump(2 ** 29); +var_dump(readablesize(2 ** 29)); + +echo '<section class="grid">'; + + +$dir = "../media/"; + + +if ($handle = opendir($dir)) { + while (false !== ($entry = readdir($handle))) { + if ($entry != "." && $entry != "..") { + $fileinfo = pathinfo($entry); + + $filepath = '../media/' . $fileinfo['filename'] . '.' . $fileinfo['extension']; + + list($width, $height, $type, $attr) = getimagesize($filepath); + $filesize = filesize($filepath); + + echo '<span>'; + echo '<h2>' . $entry . '</h2>'; + + echo 'width = ' . $width; + echo '<br/>'; + echo 'height = ' . $height; + echo '<br/>'; + echo 'filesize = ' . readablesize($filesize); + echo '<br/>'; + + + echo '<img class="thumbnail" src="' . $filepath . '" title="' . $fileinfo['filename'] . '" alt="image">'; + + echo '</span>'; + } + } + closedir($handle); +} + +echo '</section>'; + +echo '</body>'; + + +?> + + + |