From acc42674db6482ee6d432c4a9c174ed7dfcea063 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Thu, 24 May 2018 19:03:42 +0200 Subject: W 2.2 --- public/css/stylebase.css | 6 -- public/css/stylem.css | 51 --------------- public/css/stylemedia.css | 66 +++++++++++++++++++ public/index.php | 11 +++- public/m/index.php | 160 ---------------------------------------------- public/w/index.php | 67 ++++++++++++++++--- 6 files changed, 132 insertions(+), 229 deletions(-) delete mode 100644 public/css/stylem.css create mode 100644 public/css/stylemedia.css delete mode 100644 public/m/index.php (limited to 'public') 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/stylem.css deleted file mode 100644 index 4e18678..0000000 --- a/public/css/stylem.css +++ /dev/null @@ -1,51 +0,0 @@ - - -.infobulle { - display: none; -} - -.little:hover .infobulle { - display: inline-block; - position: relative; - background-color: white; - z-index: 5; - top: 5px; - width: 300px; - font-family: monospace; - font-size: 0.9em; - line-height: 1.1em; -} - -span.infobulle img { - width: 100%; -} - -.grid { - display: flex; - flex-wrap: wrap; - padding: 4%; - margin-right: 120px; - -} - -.little { - width: 100px; - height: 150px; - margin: 10px; - background-color: white; - -} - -.infobulle input[type="text"] { - font-family: monospace; - font-size: 0.9em; - margin: 3px; -} - -img.thumbnail { - width: 100%; -} - -section.gest { - padding-bottom: 300px; -} \ No newline at end of file diff --git a/public/css/stylemedia.css b/public/css/stylemedia.css new file mode 100644 index 0000000..9e46c3f --- /dev/null +++ b/public/css/stylemedia.css @@ -0,0 +1,66 @@ +section { + padding: 0; +} + +.infobulle { + display: none; +} + +.little:hover .infobulle { + display: inline-block; + position: relative; + background-color: white; + z-index: 5; + top: 5px; + width: 300px; + font-family: monospace; + font-size: 0.9em; + line-height: 1.1em; +} + +span.infobulle img { + width: 100%; +} + +.grid { + display: flex; + flex-wrap: wrap; + padding: 4%; + margin-right: 120px; + list-style: none; + +} + +.little { + width: 100px; + height: 150px; + margin: 10px; + background-color: white; + +} + +.infobulle input[type="text"] { + font-family: monospace; + font-size: 0.9em; + margin: 3px; +} + +img.thumbnail { + 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 @@ -w -
-m +

Vincent Peugnet

+

W

+ +

@

+v.peugnet@free.fr + +

📐

+ \ 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 @@ -head($titre, 'm'); - -// _____________________________________________________ A L E R T _______________________________________________________________ - -if (isset($_GET['message'])) { - echo '

' . $_GET['message'] . '

'; -} - - - -// ____________________________________________________ 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 ''; -$aff->nav($app); -$aff->addmedia(); - - -echo '
'; -echo 'Media List'; -echo '

Media

'; - -echo '
'; - -$dir = "../media/"; - -echo '
'; - -echo '
'; - -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 '
'; - - - ?> - - - - - '; - - echo ''; - echo 'width = ' . $width . ' px'; - echo '
'; - echo 'height = ' . $height . ' px'; - echo '
'; - echo 'filesize = ' . readablesize($filesize); - echo '
'; - - echo ''; - echo '
'; - - - echo '' . $fileinfo['filename'] . ''; - echo '
'; - - - echo '
'; - } -} -closedir($handle); -} - -echo '
'; - -?> - - - -
- - - -'; -echo '
'; - -var_dump($app->getlistermedia($dir)); - -echo ''; - - -?> - - - 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 '

' . $_GET['message'] . '

'; } -$aff->head($titre, 'w'); + + + + @@ -155,6 +185,23 @@ if (isset($_GET['id'])) { echo '

' . $_GET['lien'] . '

'; $aff->lien($app->getlister(['id', 'titre', 'intro', 'lien'], 'id'), $_GET['lien']); +} elseif (isset($_GET['aff'])) { + if ($_GET['aff'] == 'admin') { + echo '

Admin

'; + } elseif ($_GET['aff'] == 'media') { + echo '
'; + + $aff->addmedia(); + $aff->medialist($app); + + echo '
'; + + } elseif ($_GET['aff'] == 'record') { + echo '

Record

'; + } 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 ''; -- cgit v1.2.3