aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/css/stylebase.css6
-rw-r--r--public/css/stylemedia.css (renamed from public/css/stylem.css)19
-rw-r--r--public/index.php11
-rw-r--r--public/m/index.php160
-rw-r--r--public/w/index.php67
5 files changed, 83 insertions, 180 deletions
diff --git a/public/css/stylebase.css b/public/css/stylebase.css
index 46d43f4..92ea674 100644
--- a/public/css/stylebase.css
+++ b/public/css/stylebase.css
@@ -40,17 +40,11 @@ a:hover{
text-decoration: underline;
}
-img {
- width: 90%;
- max-width: 1000px;
-}
-
form {
margin-bottom: 0px;
}
section {
- text-align: justify;
padding: 3%;
line-height: 1.2em;
}
diff --git a/public/css/stylem.css b/public/css/stylemedia.css
index 4e18678..9e46c3f 100644
--- a/public/css/stylem.css
+++ b/public/css/stylemedia.css
@@ -1,4 +1,6 @@
-
+section {
+ padding: 0;
+}
.infobulle {
display: none;
@@ -25,6 +27,7 @@ span.infobulle img {
flex-wrap: wrap;
padding: 4%;
margin-right: 120px;
+ list-style: none;
}
@@ -43,9 +46,21 @@ span.infobulle img {
}
img.thumbnail {
- width: 100%;
+ max-width: 100%;
+ max-height: 100px;
}
section.gest {
padding-bottom: 300px;
+}
+
+input[type="file"] {
+ font-size: 1.3em;
+}
+
+input[type="checkbox"] {
+ width: unset;
+ padding: unset;
+ margin: unset;
+ height: unset;
} \ No newline at end of file
diff --git a/public/index.php b/public/index.php
index 40202a3..ab7ff55 100644
--- a/public/index.php
+++ b/public/index.php
@@ -1,6 +1,11 @@
<html>
-<a href="/w/">w</a>
-<br/>
-<a href="/m/">m</a>
+<h1>Vincent Peugnet</h1>
+<a href="/w/"><h2>W</h2></a>
+
+<h2>@</h2>
+<a href="mailto:v.peugnet@free.fr">v.peugnet@free.fr</a>
+
+<h1>📐</h1>
+
</html> \ No newline at end of file
diff --git a/public/m/index.php b/public/m/index.php
deleted file mode 100644
index e29c801..0000000
--- a/public/m/index.php
+++ /dev/null
@@ -1,160 +0,0 @@
-<?php
-
-// _____________________________________________________ R E Q U I R E ________________________________________________________________
-
-
-$config = require('../../config.php');
-
-
-
-require('../../fn/fn.php');
-require('../../class/class.art.php');
-require('../../class/class.media.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, 'm');
-
-// _____________________________________________________ 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;
-
- case 'login':
- $_SESSION['level'] = $app->login($_POST['pass']);
- if (isset($_GET['id'])) {
- header('Location: ?id=' . $_GET['id']);
- } else {
- header('Location: ?');
- }
- break;
-
- case 'logout':
- $_SESSION['level'] = $app->logout();
- if (isset($_GET['id'])) {
- header('Location: ?id=' . $_GET['id']);
- } else {
- header('Location: ?');
- }
- break;
- }
-}
-
-// ______________________________________________________ B O D Y _______________________________________________________________
-
-
-
-echo '<body>';
-$aff->nav($app);
-$aff->addmedia();
-
-
-echo '<details open>';
-echo '<summary>Media List</summary>';
-echo '<h1>Media</h1>';
-
-echo '<section class="gest">';
-
-$dir = "../media/";
-
-echo '<form action="" method="post">';
-
-echo '<div class="grid">';
-
-if ($handle = opendir($dir)) {
- while (false !== ($entry = readdir($handle))) {
- if ($entry != "." && $entry != "..") {
- $fileinfo = pathinfo($entry);
-
- $filepath = $dir . $fileinfo['filename'] . '.' . $fileinfo['extension'];
-
- list($width, $height, $type, $attr) = getimagesize($filepath);
- $filesize = filesize($filepath);
-
- echo '<div class="little">';
-
-
- ?>
- <label for="<?= $entry ?>"><?= $entry ?></label>
- <input type="hidden" name="" value="">
- <input type="checkbox" id="<?= $entry ?>" name="<?= $entry ?>" value="1">
-
- <?php
-
- echo '<img class="thumbnail" src="' . $filepath . '" alt="' . $fileinfo['filename'] . '">';
-
- echo '<span class="infobulle">';
- echo 'width = ' . $width . ' px';
- echo '<br/>';
- echo 'height = ' . $height . ' px';
- echo '<br/>';
- echo 'filesize = ' . readablesize($filesize);
- echo '<br/>';
-
- echo '<input type="text" value="![' . $fileinfo['filename'] . '](/' . $entry . ')">';
- echo '<br/>';
-
-
- echo '<img src="' . $filepath . '" alt="' . $fileinfo['filename'] . '">';
- echo '</span>';
-
-
- echo '</div>';
- }
-}
-closedir($handle);
-}
-
-echo '</div>';
-
-?>
-<select name="action" id="">
- <option value="">compress /2</option>
- <option value="">downscale /2</option>
- <option value="">upscale *2</option>
-</select>
-<input type="submit" value="edit">
-<input type="submit" value="delete">
-</form>
-</div>
-
-
-<?php
-
-
-echo '</section>';
-echo '</details>';
-
-var_dump($app->getlistermedia($dir));
-
-echo '</body>';
-
-
-?>
-
-
-
diff --git a/public/w/index.php b/public/w/index.php
index 71f1728..9a40e9f 100644
--- a/public/w/index.php
+++ b/public/w/index.php
@@ -12,9 +12,10 @@ use Michelf\MarkdownExtra;
require('../../fn/fn.php');
-require('../../class/class.art.php');
-require('../../class/class.app.php');
-require('../../class/class.aff.php');
+require('../../class/class.w.art.php');
+require('../../class/class.w.app.php');
+require('../../class/class.w.aff.php');
+require('../../class/class.w.media.php');
session();
if (!isset($_SESSION['level'])) {
$level = 0;
@@ -76,7 +77,7 @@ if (isset($_POST['action'])) {
if (isset($_GET['id'])) {
header('Location: ?id=' . $_GET['id']);
} else {
- header('Location: ?');
+ header('Location: ./');
}
break;
@@ -85,10 +86,15 @@ if (isset($_POST['action'])) {
if (isset($_GET['id'])) {
header('Location: ?id=' . $_GET['id']);
} else {
- header('Location: ?');
+ header('Location: ./');
}
break;
+ case 'addmedia':
+ $message = $app->addmedia($_FILES, 2 ** 10, $_POST['id']);
+ header('Location: ./?aff=media&message='.$message);
+ break;
+
}
}
@@ -97,15 +103,39 @@ if (isset($_POST['action'])) {
// _______________________________________________________ H E A D _____________________________________________________________
-$titre = 'home';
+
if (isset($_GET['id'])) {
- $titre = $_GET['id'];
if ($app->exist($_GET['id'])) {
$art = $app->get($_GET['id']);
- $titre = $art->titre();
+ if (isset($_GET['edit']) && $_GET['edit'] == 1) {
+ $aff->arthead($art, '✏');
+ }
+ $aff->arthead($art, '');
+ } else {
+ $aff->head($_GET['id'], 'w');
+
}
+} elseif (isset($_GET['aff'])) {
+ $aff->head($_GET['aff'], $_GET['aff']);
+} else {
+ $aff->head('home', 'w');
+}
+
+
+
+
+
+
+
+// _____________________________________________________ A L E R T _______________________________________________________________
+
+if (isset($_GET['message'])) {
+ echo '<span class="alert"><h4>' . $_GET['message'] . '</h4></span>';
}
-$aff->head($titre, 'w');
+
+
+
+
@@ -155,6 +185,23 @@ if (isset($_GET['id'])) {
echo '<h4>' . $_GET['lien'] . '</h4>';
$aff->lien($app->getlister(['id', 'titre', 'intro', 'lien'], 'id'), $_GET['lien']);
+} elseif (isset($_GET['aff'])) {
+ if ($_GET['aff'] == 'admin') {
+ echo '<h1>Admin</h1>';
+ } elseif ($_GET['aff'] == 'media') {
+ echo '<section>';
+
+ $aff->addmedia();
+ $aff->medialist($app);
+
+ echo '</section>';
+
+ } elseif ($_GET['aff'] == 'record') {
+ echo '<h1>Record</h1>';
+ } else {
+ header('Location: ./');
+ }
+
} else {
if (isset($_GET['tri'])) {
$tri = strip_tags($_GET['tri']);
@@ -167,7 +214,9 @@ if (isset($_GET['id'])) {
$desc = 'ASC';
}
$aff->home2table($app->getlister(['id', 'titre', 'intro', 'lien', 'datecreation', 'datemodif'], $tri, $desc));
+
}
+
echo '</body>';