diff --git a/html-old/about.php b/html-old/about.php deleted file mode 100755 index e839e4ef..00000000 --- a/html-old/about.php +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - <?=$title?> - - -
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- text($markdownContent); - ?> -
-
-
-
- - - \ No newline at end of file diff --git a/html-old/admin.php b/html-old/admin.php deleted file mode 100755 index 92368cf2..00000000 --- a/html-old/admin.php +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - <?=$title?> - - -
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- text($markdownContent); - ?> -
-
-
-
- - - \ No newline at end of file diff --git a/html-old/compte.php b/html-old/compte.php deleted file mode 100755 index c0885655..00000000 --- a/html-old/compte.php +++ /dev/null @@ -1,296 +0,0 @@ -prepare("UPDATE users SET profile_picture = :user_pp WHERE ID = :user_id"); - $req->bindParam(":user_pp", $webPath); - $req->bindParam(":user_id", $_SESSION['userid']); - if($req->execute()) { - $status = "PP mise à jour"; - } else { - $status = "Erreur SQL"; - } - } else { - $status = "Le fichier doit être au format PNG ou JPG"; - } -} - -if (isset($_FILES['banner']) && $_FILES['banner']['error'] == 0) { - // Chemins et noms de fichiers - $tempPath = $_FILES['banner']['tmp_name']; - $path = '/src/banner/'. $_SESSION['userid'] .'.png'; - $rootPath = $wwwroot . "/html" . $path; - $webPath = $root . $path; - - // Redimensionnement de l'image - list($width, $height) = getimagesize($tempPath); - $imageInfo = getimagesize($tempPath); - - if ($imageInfo[2] === IMAGETYPE_PNG || $imageInfo[2] === IMAGETYPE_JPEG) { - $newWidth = 800; - $newHeight = ($height / $width) * $newWidth; - $imageResized = imagecreatetruecolor($newWidth, $newHeight); - imagealphablending($imageResized, false); - imagesavealpha($imageResized, true); - $imageOriginal = imagecreatefromstring(file_get_contents($tempPath)); - imagecopyresampled($imageResized, $imageOriginal, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); - - // Enregistrement de l'image redimensionnée - imagepng($imageResized, $rootPath); - - // Nettoyage - imagedestroy($imageOriginal); - imagedestroy($imageResized); - - $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); - $req = $bdd->prepare("UPDATE users SET banner = :user_banner WHERE ID = :user_id"); - $req->bindParam(":user_banner", $webPath); - $req->bindParam(":user_id", $_SESSION['userid']); - if($req->execute()) { - $status = "Banière mise à jour"; - } else { - $status = "Erreur SQL"; - } - } else { - $status = "Le fichier doit être un PNG ou JPG"; - } -} - -if(isset($_POST['user_display_name']) && isset($_POST['user_name']) && isset($_POST['user_bio'])) { - $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); - $req = $bdd->prepare("SELECT ID FROM users WHERE username = :user_name AND NOT ID = :user_id"); - $req->bindParam(":user_name", htmlspecialchars($_POST['user_name'])); - $req->bindParam(":user_id", $_SESSION['userid'], PDO::PARAM_INT); - $req->execute(); - $resultat = $req->fetchAll(PDO::FETCH_ASSOC); - if($resultat) { - $status = "Erreur, le nom d'utilisateur existe déjà."; - } else { - $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); - $req = $bdd->prepare("UPDATE users SET username = :user_name, display_name = :user_display_name, bio = :user_bio WHERE ID = :user_id"); - $req->bindParam(":user_name", htmlspecialchars($_POST['user_name'])); - $req->bindParam(":user_display_name", htmlspecialchars($_POST['user_display_name'])); - $req->bindParam(":user_bio", htmlspecialchars($_POST['user_bio'])); - $req->bindParam(":user_id", $_SESSION['userid']); - if($req->execute()) { - $status = "Informations mises à jour"; - $_SESSION['username'] = htmlspecialchars($_POST['user_name']); - $_SESSION['display_name'] = htmlspecialchars($_POST['user_display_name']); - } else { - $status = "Erreur, les informations n'ont pas pu être mises à jour."; - } - } -} - -$bdd = connect($dbhost, $dbname, $dbuser, $dbpass); -$req = $bdd->prepare("SELECT ID, username, creation_date, display_name, role, profile_picture, banner, bio FROM users WHERE ID = :user_id"); -$req->bindParam(":user_id", $_SESSION['userid']); -$req->execute(); -$resultat = $req->fetchAll(PDO::FETCH_ASSOC); - -if($resultat) { - $user_id = $resultat[0]['ID']; - $user_name = $resultat[0]['username']; - $user_creation_date = $resultat[0]['creation_date']; - $user_display_name = $resultat[0]['display_name']; - $user_role = $resultat[0]['role']; - $user_pp = $resultat[0]['profile_picture'] == NULL ? "https://abs.twimg.com/sticky/default_profile_images/default_profile_400x400.png" : $resultat[0]['profile_picture']; - $user_pp_url = $resultat[0]['profile_picture']; - $user_banner = $resultat[0]['banner'] = NULL ? "./src/img/empty.jpg" : $resultat[0]['banner']; - $user_bio = $resultat[0]['bio']; -} else { - die("Erreur, utilisateur introuvable"); -} -?> - - - - - - - - - - <?=$title?> - - -
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
- -
- -
-
-
-
- - prepare("SELECT ID, titre, date, image, resume FROM articles WHERE (titre LIKE :search OR ID LIKE :search OR auteur LIKE :search) AND classification <= :accreditation AND auteur = :user_id ORDER BY date DESC"); - $req->bindParam(":search", $search); - $req->bindParam(":accreditation", $_SESSION['accreditation']); - $req->bindParam(":user_id", $user_id); - $req->execute(); - $resultat = $req->fetchAll(PDO::FETCH_ASSOC); - echo "

Editer un article

"; - echo "
"; - - if ($resultat) { - foreach($resultat as $row) { - $date = strtotime($row['date']); - echo '
'; - echo '
'; - echo ''; - echo '
'; - echo '
'; - echo '
n° ' . $row['ID'] . ' | ' . date('d/m/Y', $date) . '
'; - echo ''; - echo '
' . $row['titre'] . '
'; - echo '
'; - echo '
' . $row['resume'] . '
'; - echo '
'; - echo '
'; - } - } else { - echo "Vous n'avez publié aucun article..."; - } - ?> -
-
- -
-
-
-
- - - \ No newline at end of file diff --git a/html-old/editpage.php b/html-old/editpage.php deleted file mode 100755 index 5f1cb6c9..00000000 --- a/html-old/editpage.php +++ /dev/null @@ -1,276 +0,0 @@ - "article", - 1 => "page" -]; - -if(isset($_GET['article']) && filter_var($_GET['article'], FILTER_VALIDATE_INT)) { - if(file_exists($wwwroot . "/content/journal/" . $_GET['article'] . ".md")){ - $fichier = $wwwroot . "/content/journal/" . $_GET['article'] . ".md"; - $filename = $_GET['article']; - $filetype = 0; - } -} - -if(isset($_GET['page']) && strpos($_GET['page'], "..") == false && $_SESSION['role'] >= 3) { - if(file_exists($wwwroot . "/content/" . $_GET['page'] . ".md")){ - $fichier = $wwwroot . "/content/" . $_GET['page'] . ".md"; - $filename = $_GET['page']; - $filetype = 1; - } -} - -if (isset($_FILES['miniature']) && $_FILES['miniature']['error'] == 0 && isset($_GET['article'])) { - // Chemins et noms de fichiers - $tempPath = $_FILES['miniature']['tmp_name']; - $path = '/src/miniature/'. $_GET['article'] .'.png'; - $rootPath = $wwwroot . "/html" . $path; - $webPath = $root . $path; - - // Redimensionnement de l'image - list($width, $height) = getimagesize($tempPath); - $imageInfo = getimagesize($tempPath); - - if ($imageInfo[2] === IMAGETYPE_PNG || $imageInfo[2] === IMAGETYPE_JPEG) { - $newWidth = 600; - $newHeight = ($height / $width) * $newWidth; - $imageResized = imagecreatetruecolor($newWidth, $newHeight); - imagealphablending($imageResized, false); - imagesavealpha($imageResized, true); - $imageOriginal = imagecreatefromstring(file_get_contents($tempPath)); - imagecopyresampled($imageResized, $imageOriginal, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); - - // Enregistrement de l'image redimensionnée - imagepng($imageResized, $rootPath); - - // Nettoyage - imagedestroy($imageOriginal); - imagedestroy($imageResized); - - $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); - $req = $bdd->prepare("UPDATE articles SET image = :image WHERE ID = :article AND auteur = :user_id"); - $req->bindParam(":image", $webPath); - $req->bindParam(":article", $_GET['article']); - $req->bindParam(":user_id", $_SESSION['userid']); - if($req->execute()) { - $status = "Miniature mise à jour"; - } else { - $status = "Erreur SQL"; - } - } else { - $status = "Le fichier doit être un PNG ou JPG"; - } -} - -$filename = isset($filename) ? $filename : ""; - -if(isset($fichier)) { - if(isset($_GET['article']) && isset($_POST['deletefile']) && $_POST['deletefile'] == "Supprimer") { - if(unlink($fichier)) { - $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); - $upload = $bdd->prepare("DELETE FROM articles WHERE ID = :filename AND auteur = :user_id"); - $upload->bindParam(':filename', $filename); - $upload->bindParam(':auteur', $_SESSION['userid']); - if($upload->execute()) { - header("Location: editpage.php"); - echo "Fichier supprimé"; - exit(); - } else { - die("Erreur SQL"); - } - } else { - die("Erreur : Le fichier n'a pas pu être supprimé"); - } - } - if(isset($_POST['page-content'])) { - file_put_contents($fichier, nl2br($_POST['page-content'])); - } - if(isset($_POST['article-classification']) && isset($_POST['article-resume']) && isset($_GET['article'])) { - $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); - - $req = $bdd->prepare("UPDATE articles SET classification = :classification, titre = :titre, resume = :resume WHERE ID = :article AND auteur = :user_id"); - $req->bindParam(':classification', $_POST['article-classification']); - $req->bindParam(':titre', htmlspecialchars($_POST['article-titre'])); - $req->bindParam(':resume', nl2br($_POST['article-resume'])); - $req->bindParam(':article', $_GET['article']); - $req->bindParam(':user_id', $_SESSION['userid']); - if($req->execute()) { - $status = "Informations mises à jour"; - } else { - $status = "Erreur SQL"; - } - } - $contenu = file_get_contents($fichier); -} - -?> - - - - - - - - - - <?=$title?> - - - -
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- '; - echo "
"; - echo "
"; - if(isset($_GET['article'])) { - $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); - $req = $bdd->prepare("SELECT classification, titre, image, resume FROM articles WHERE ID = :article AND auteur = :user_id"); - $req->bindParam(":article", $_GET['article']); - $req->bindParam(":user_id", $_SESSION['userid']); - $req->execute(); - $resultat = $req->fetchAll(PDO::FETCH_ASSOC); - - if($resultat) { - echo '
'; - $filetitle = $resultat[0]['titre']; - - echo '
'; - echo '
'; - } - } - echo "

" . $filetitle . "

"; - echo '
'; - echo '
'; - if($resultat) { - echo '
'; - echo ''; - echo ''; - echo '
'; - } - } else { - if($_SESSION['role'] >= 3) { - echo "

Pages

"; - echo "
"; - $pages = scandir($wwwroot . "/content/"); - foreach($pages as $page) { - if($page != "." && $page != "..") { - if (is_file($wwwroot . "/content/" . $page)) { - echo "
" . pathinfo($page, PATHINFO_FILENAME) . "
"; - } - } - } - echo "
"; - } - echo "

Articles

"; - echo "
"; - - $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); - $condition = ""; - if(isset($_GET['search'])) { - $search = "%" . htmlspecialchars($_GET['search']) . "%"; - $condition = "AND (titre LIKE '" . $search . "' OR ID LIKE '" . $search . "' OR auteur LIKE '" . $search . "') "; - } - $req = $bdd->prepare("SELECT ID, titre, date, image, resume FROM articles WHERE auteur = :user_id ORDER BY date DESC LIMIT 10"); - $req->bindParam(":user_id", $_SESSION['userid']); - $req->execute(); - $resultat = $req->fetchAll(PDO::FETCH_ASSOC); - - if ($resultat) { - foreach($resultat as $row) { - $date = strtotime($row['date']); - echo '
'; - echo '
'; - echo ''; - echo '
'; - echo '
'; - echo '
n° ' . $row['ID'] . ' | ' . date('d/m/Y', $date) . '
'; - echo ''; - echo '
' . $row['titre'] . '
'; - echo '
'; - echo '
' . $row['resume'] . '
'; - echo '
'; - echo '
'; - } - } - - echo "
"; - } - ?> -
-
'; - } - ?> -
-
-
- - - \ No newline at end of file diff --git a/html-old/index.php b/html-old/index.php deleted file mode 100755 index af4d0fec..00000000 --- a/html-old/index.php +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - <?=$title?> - - -
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- text($markdownContent); - ?> -
-
prepare("SELECT articles.ID, articles.titre, articles.date, articles.image, articles.resume, users.username, users.display_name FROM articles JOIN users ON articles.auteur = users.ID WHERE articles.classification <= :accreditation ORDER BY date DESC LIMIT 3"); - $req->bindParam(":accreditation", $_SESSION['accreditation']); - $req->execute(); - $resultat = $req->fetchAll(PDO::FETCH_ASSOC); - - foreach($resultat as $row) { - $date = strtotime($row['date']); - echo '
'; - echo '
'; - echo ''; - echo '
'; - echo '
'; - echo '
n° ' . $row['ID'] . ' | ' . date('d/m/Y', $date) . ' | '. '' . $row['display_name'] . '
'; - echo ''; - echo '
' . $row['titre'] . '
'; - echo '
'; - echo '
' . $row['resume'] . '
'; - echo '
'; - echo '
'; - } - ?> -
-
-
-
- - - \ No newline at end of file diff --git a/html-old/login.php b/html-old/login.php deleted file mode 100755 index 85fd89bd..00000000 --- a/html-old/login.php +++ /dev/null @@ -1,101 +0,0 @@ -prepare("SELECT ID, username, email, display_name, role, accreditation FROM users WHERE (username = :username OR email = :username) AND password = :password"); - $req->bindParam(':username', htmlspecialchars($_POST['username'])); - $req->bindParam(':password', md5($_POST['password'])); - $req->execute(); - - $resultat = $req->fetchAll(PDO::FETCH_ASSOC); - - if ($resultat) { - $_SESSION['username'] = $resultat[0]['username']; - $_SESSION['email'] = $resultat[0]['email']; - $_SESSION['display_name'] = $resultat[0]['display_name']; - $_SESSION['userid'] = $resultat[0]['ID']; - $_SESSION['role'] = $resultat[0]['role']; - $_SESSION['accreditation'] = $resultat[0]['accreditation']; - header("Location: index.php"); - exit(); - } else { - $status = "Nom d'utilisateur / mot de passe incorrect"; - } - } -} - -?> - - - - - - - - - <?=$title?> - - -
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
- - - \ No newline at end of file diff --git a/html-old/logout.php b/html-old/logout.php deleted file mode 100755 index eb269c54..00000000 --- a/html-old/logout.php +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/html-old/news.php b/html-old/news.php deleted file mode 100755 index 263f10ed..00000000 --- a/html-old/news.php +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - <?=$title?> - - -
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- prepare("SELECT articles.ID, articles.titre, articles.date, articles.image, articles.resume, users.username, users.display_name FROM articles JOIN users ON articles.auteur = users.ID WHERE (articles.titre LIKE :search OR articles.ID LIKE :search OR users.username LIKE :search) AND articles.classification <= :accreditation ORDER BY date DESC"); - $req->bindParam(":search", $search); - $req->bindParam(":accreditation", $_SESSION['accreditation']); - $req->execute(); - $resultat = $req->fetchAll(PDO::FETCH_ASSOC); - - echo "

Actualités du club

"; - echo "
"; - - if ($resultat) { - foreach($resultat as $row) { - $date = strtotime($row['date']); - echo '
'; - echo '
'; - echo ''; - echo '
'; - echo '
'; - echo '
n° ' . $row['ID'] . ' | ' . date('d/m/Y', $date) . ' | '. '' . $row['display_name'] . '
'; - echo ''; - echo '
' . $row['titre'] . '
'; - echo '
'; - echo '
' . $row['resume'] . '
'; - echo '
'; - echo '
'; - } - } else { - echo "Aucun article trouvé"; - } - - } else if (!isset($_GET['search']) && $article != "" && file_exists($wwwroot . '/content/journal/' . $article . '.md')) { - - $markdownContent = file_get_contents($wwwroot . '/content/journal/' . $article . '.md'); - - require_once '../include/parsedown.php'; - $parsedown = new Parsedown(); - - $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); - $req = $bdd->prepare("SELECT articles.ID, articles.titre, articles.date, articles.classification, articles.image, users.username, users.display_name, users.role, users.profile_picture FROM articles JOIN users ON users.ID = articles.auteur WHERE articles.ID = :article AND articles.classification <= :accreditation"); - $req->bindParam(":article", $article); - $req->bindParam(":accreditation", $_SESSION['accreditation']); - $req->execute(); - $resultat = $req->fetchAll(PDO::FETCH_ASSOC);; - - if ($resultat) { - $date = strtotime($resultat[0]['date']); - $auteur_pp = $resultat[0]['profile_picture'] == NULL ? "https://abs.twimg.com/sticky/default_profile_images/default_profile_400x400.png" : $resultat[0]['profile_picture']; - echo "
"; - echo "
"; - echo "
"; - echo $parsedown->text($markdownContent); - echo "
"; - } - } - ?> -
-
- -
- - - \ No newline at end of file diff --git a/html-old/register.php b/html-old/register.php deleted file mode 100755 index 1ba58196..00000000 --- a/html-old/register.php +++ /dev/null @@ -1,111 +0,0 @@ -prepare("SELECT ID FROM users WHERE username = :username"); - $req->bindParam(":username", htmlspecialchars($_POST['username'])); - $req->execute(); - $resultat = $req->fetchAll(PDO::FETCH_ASSOC); - if($resultat) { - $status = "Erreur, le nom d'utilisateur existe déjà."; - } else { - $req = $bdd->prepare("INSERT INTO users (username, password, email, display_name, role, accreditation) VALUES (:username, :password, :email, :display_name, 0, 0)"); - $req->bindParam(':username', htmlspecialchars($_POST['username'])); - $req->bindParam(':password', md5($_POST['password'])); - $req->bindParam(':email', htmlspecialchars($_POST['email'])); - $req->bindParam(':display_name', htmlspecialchars($_POST['display_name'])); - if ($req->execute()) { - header("Location: login.php"); - exit(); - } else { - $status = "Erreur SQL"; - } - } - } else { - $status = "Les mots de passe ne correspondent pas."; - } - } -} - -?> - - - - - - - - - <?=$title?> - - -
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/html-old/robots.txt b/html-old/robots.txt deleted file mode 100755 index a896c212..00000000 --- a/html-old/robots.txt +++ /dev/null @@ -1,5 +0,0 @@ -User-agent: Googlebot -Disallow: /src/ - -User-agent: * -Allow: / \ No newline at end of file diff --git a/html-old/src/banner/index.php b/html-old/src/banner/index.php deleted file mode 100755 index 793e46d7..00000000 --- a/html-old/src/banner/index.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/html-old/src/css/index.php b/html-old/src/css/index.php deleted file mode 100755 index 793e46d7..00000000 --- a/html-old/src/css/index.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/html-old/src/css/style.css b/html-old/src/css/style.css deleted file mode 100755 index 50cf84ad..00000000 --- a/html-old/src/css/style.css +++ /dev/null @@ -1,312 +0,0 @@ -@font-face { - font-family: crfont; /* Nom de la police */ - src: url('/src/fonts/bahnschrift.ttf') format('truetype'); /* Chemin vers votre fichier TTF */ - /* Autres attributs de la police (facultatif) */ - font-weight: normal; - font-style: normal; -} - -body { - font-family: crfont, sans-serif; - color: var(--text); - margin: 0; -} - -main { - font-family: Helvetica, Arial, sans-serif; - background: var(--background); - width: 100%; - margin: 0; - min-height: 100em; -} - -header, footer, nav { - width: 100%; - margin: 0; - background: var(--banner-background); - display: flex; -} - -header, footer { - justify-content: space-between; -} - -input, textarea { - background-color: var(--buttons); - color: var(--text); - padding: 0.4em 1em; - margin: 15px 0; - font-size: 1.2em; - border: 0; - border-radius: 10px; -} - -input[type='submit'], button { - color: var(--text); - border-radius: 10px; -} - -input[type='submit']:hover, button:hover { - box-shadow: 0 0 15px var(--banner-background); -} - -img { - border-radius: 1em; -} - -.navitem { - padding: 0.5em; - background-color: var(--buttons); - margin-right: 1em; -} - -a { - text-decoration: none; - color: var(--text-color); -} - -.status { - color: rgb(199 181 147); -} - -.content { - width: 80%; - margin: 0 auto; - padding: 2em 0; -} - -.pancontent { - width: 90%; - display: flex; - margin: 0 auto; -} - -.athena-container { - padding: 1em 0; -} - -.athena { - height: 7em; - border-radius: 3.5em; -} - -.athena:hover { - box-shadow: 0 0 15px rgba(255, 255, 255, 0.322); -} - -.main-title { - text-align: right; - margin-top: 2em; -} - -.main-title .title { - font-size: 3em; -} - -.article-preview { - padding: 2em 0.5em; - display: flex; -} - -.article-preview .article-illustration { - padding-right: 1em; -} - -.article-preview .article-details { - vertical-align: top; -} - -.article-preview .article-link { - color: var(--text); -} - -.article-preview .article-miniature { - max-width: 15em; -} - -.article-preview .article-data { - font-size: 0.8em; -} - -.article-preview .article-titre { - font: 1.5em crfont, Arial; - padding: 0.5em 0 0.5em 0; -} - -.article-resume-input { - min-height: 5em; -} - -.article-info .article-auteur { - float: right; -} - -.article-info .article-classification { - padding: 1em 0; - font-size: 1.3em; -} - -.article-info .article-titre { - font-size: 2em; -} - -.article .article-illustration { - padding: 2em 0; -} - -.article .article-miniature { - margin: 0 auto; - width: 40%; -} - -.article-content img { - max-height: 10em; -} - -.user-main-profile .user-content { - width: 80%; - margin: 0 auto; -} - -.user-main-profile .user-header { - background-color: var(--banner-background); - padding-bottom: 2em; -} - -.user-main-profile .user-banner { - width: 100%; - height: 12em; - background-position: center; - background-repeat: no-repeat; - background-size: cover; -} - -.user-main-profile .user-pp-image { - width: 10em; - height: 10em; - border-radius: 10em; - transform: translate(0, -60%); - border: 5px solid var(--banner-background); - background-color: var(--banner-background); -} - -.user-main-profile .user-pp { - height: 6em; -} - -.user-main-profile .display-name { - font-weight: bold; - display: inline; -} - -.user-main-profile .user-role { - display: inline; -} - -.user-main-profile .certification { - transform: translate(0, +22%); - width: 1.5em; -} - -.user-main-profile .bio { - padding: 1em 0; -} - -.user-main-profile .user-articles { - margin-top: 5em; -} - -.user-main-profile .bio-input { - max-height: 3em; - width: 80%; -} - -.article-auteur { - background-color: var(--banner-background); - display: flex; - padding: 0.5em 1em 0.5em 0.5em; - border-radius: 10em; - width: 15em; -} - -.article-auteur .auteur-display-name { - font-weight: bold; - display: flex; -} - -.article-auteur .auteur-display-name .certification { - transform: translate(0, -15%); - width: 1.5em; - margin-left: 0.5em; -} - -.article-auteur .auteur-names { - margin: auto; -} - -.article-auteur .auteur-pp { - height: 4em; -} - -.article-auteur .auteur-pp-image { - width: 4em; - height: 4em; - border-radius: 4em; -} - -.row { - display: inline-block; - background-color: var(--banner-background); - border-radius: 10px; - padding: 2em; - margin: 2em; -} - -.row input { - font-size: 1em; -} - -.button { - background-color: var(--buttons); - color: var(--text); - border-radius: 10px; - color: var(--text); - padding: 0.4em 1em; - margin: 15px; - font-size: 1.2em; - display: inline-block; -} - -@media(max-width: 750px) { - body { - font-size: 0.8em - } - .article-preview { - display: block; - } - .article-preview .article-illustration { - margin: 0 auto; - padding: 2em 0; - } - .article-preview .article-miniature { - max-width: 100%; - margin: 0 auto; - } - - .article-preview .article-details { - margin: 0 auto; - } - - .article-preview .article-data { - font-size: 1em; - } - .article-preview .article-titre { - font-size: 2em; - } - .article-preview .article-resume { - font-size: 1.2em; - } - .article .article-miniature { - width: 100%; - } -} \ No newline at end of file diff --git a/html-old/src/fonts/bahnschrift.ttf b/html-old/src/fonts/bahnschrift.ttf deleted file mode 100755 index 8332c6ca..00000000 Binary files a/html-old/src/fonts/bahnschrift.ttf and /dev/null differ diff --git a/html-old/src/fonts/index.php b/html-old/src/fonts/index.php deleted file mode 100755 index 793e46d7..00000000 --- a/html-old/src/fonts/index.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/html-old/src/img/athena-mono.png b/html-old/src/img/athena-mono.png deleted file mode 100755 index ef727bd1..00000000 Binary files a/html-old/src/img/athena-mono.png and /dev/null differ diff --git a/html-old/src/img/empty.jpg b/html-old/src/img/empty.jpg deleted file mode 100755 index 57ce12d0..00000000 Binary files a/html-old/src/img/empty.jpg and /dev/null differ diff --git a/html-old/src/img/favicon.ico b/html-old/src/img/favicon.ico deleted file mode 100755 index ca976ef9..00000000 Binary files a/html-old/src/img/favicon.ico and /dev/null differ diff --git a/html-old/src/img/index.php b/html-old/src/img/index.php deleted file mode 100755 index 793e46d7..00000000 --- a/html-old/src/img/index.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/html-old/src/index.php b/html-old/src/index.php deleted file mode 100755 index 793e46d7..00000000 --- a/html-old/src/index.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/html-old/src/miniature/index.php b/html-old/src/miniature/index.php deleted file mode 100755 index 793e46d7..00000000 --- a/html-old/src/miniature/index.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/html-old/src/pp/index.php b/html-old/src/pp/index.php deleted file mode 100755 index 793e46d7..00000000 --- a/html-old/src/pp/index.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/html-old/upload.php b/html-old/upload.php deleted file mode 100755 index 84954d43..00000000 --- a/html-old/upload.php +++ /dev/null @@ -1,118 +0,0 @@ -prepare("INSERT INTO articles (ID, titre, auteur, resume, classification) VALUES (:filename, :titre, :auteur, :resume, :classification)"); - $upload->bindParam(':filename', $filename); - $upload->bindParam(':titre', htmlspecialchars($_POST['article-titre'])); - $upload->bindParam(':auteur', $_SESSION['userid']); - $upload->bindParam(':resume', htmlspecialchars($_POST['article-resume'])); - $upload->bindParam(':classification', $_POST['classification']); - if($upload->execute()) { - $status = "Article Publié"; - } else { - $status = "Erreur SQL"; - } - header("Location: editpage.php?article=" . $filename); - exit(); -} - -?> - - - - - - - - - - <?=$title?> - - - -
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-

Publier un article

-
-
-
-
- - -
-
-
- -
-
-
- - - \ No newline at end of file diff --git a/html-old/user.php b/html-old/user.php deleted file mode 100755 index 265032ab..00000000 --- a/html-old/user.php +++ /dev/null @@ -1,186 +0,0 @@ -prepare("SELECT ID, username, creation_date, display_name, role, profile_picture, banner, bio FROM users WHERE username = :username"); -$req->bindParam(":username", $username); -$req->execute(); -$resultat = $req->fetchAll(PDO::FETCH_ASSOC); - -if($resultat) { - $user_id = $resultat[0]['ID']; - $user_name = $resultat[0]['username']; - $user_creation_date = $resultat[0]['creation_date']; - $user_display_name = $resultat[0]['display_name']; - $user_role = $resultat[0]['role']; - $user_pp = $resultat[0]['profile_picture'] == NULL ? "https://abs.twimg.com/sticky/default_profile_images/default_profile_400x400.png" : $resultat[0]['profile_picture']; - $user_banner = $resultat[0]['banner'] = NULL ? "./src/img/empty.jpg" : $resultat[0]['banner']; - $user_bio = $resultat[0]['bio']; -} else { - $user_id = 0; - $user_name = $username; - $user_creation_date = "01/01/2024"; - $user_display_name = "User not found"; - $user_role = 0; - $user_pp = "https://abs.twimg.com/sticky/default_profile_images/default_profile_400x400.png"; - $user_banner = ""; - $user_bio = ""; -} - -?> - - - - - - - - - - <?=$title?> - - -
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
- -
-
-
-
-
- prepare("SELECT ID, titre, date, auteur, image, resume FROM articles WHERE (titre LIKE :search OR ID LIKE :search OR auteur LIKE :search) AND classification <= :accreditation AND auteur = :user_id ORDER BY date DESC"); - $req->bindParam(":search", $search); - $req->bindParam(":accreditation", $_SESSION['accreditation']); - $req->bindParam(":user_id", $user_id); - $req->execute(); - $resultat = $req->fetchAll(PDO::FETCH_ASSOC); - echo "

Articles de " . $user_display_name . "

"; - echo "
"; - - if ($resultat) { - foreach($resultat as $row) { - $date = strtotime($row['date']); - echo '
'; - echo '
'; - echo ''; - echo '
'; - echo '
'; - echo '
n° ' . $row['ID'] . ' | ' . date('d/m/Y', $date) . '
'; - echo ''; - echo '
' . $row['titre'] . '
'; - echo '
'; - echo '
' . $row['resume'] . '
'; - echo '
'; - echo '
'; - } - } else { - echo "L'utilisateur n'a pas publié d'articles"; - } - ?> -
-
-
-
-
-
- - - \ No newline at end of file diff --git a/html-old/users.php b/html-old/users.php deleted file mode 100755 index 716bd3df..00000000 --- a/html-old/users.php +++ /dev/null @@ -1,184 +0,0 @@ -prepare("UPDATE users SET role = :role, accreditation = :accreditation WHERE ID = :userid"); - $req->bindParam(':role',$_POST['role'], PDO::PARAM_INT); - $req->bindParam(':accreditation',$_POST['accreditation'], PDO::PARAM_INT); - $req->bindParam(':userid', $_POST['userid'], PDO::PARAM_INT); - if ($req->execute()) { - $status = "Utilisateur mis à jour"; - } else { - $status = "Erreur SQL"; - } -} - -?> - - - - - - - - - - <?=$title?> - - -
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- prepare("SELECT ID, display_name, username, email, role, accreditation, profile_picture FROM users ORDER BY creation_date DESC"); - $req->execute(); - $resultat = $req->fetchAll(PDO::FETCH_ASSOC); - - if ($resultat) { - foreach($resultat as $row) { - $user_pp = $row['profile_picture'] == NULL ? "https://abs.twimg.com/sticky/default_profile_images/default_profile_400x400.png" : $row['profile_picture']; - echo "
"; - echo ""; - echo "
"; - echo "
"; - echo "
" . $row['display_name']; - if($row['role'] > 1) { - echo ''; - } - echo "
"; - echo "
@" . $row['username'] . "
"; - echo "
"; - echo "
"; - echo "
"; - echo "
"; - echo "
"; - echo "
"; - echo "
"; - echo "
"; - } - } - ?> -
- -
- - - \ No newline at end of file diff --git a/html/about/index.php b/html/about/index.php index cc579115..193838aa 100755 --- a/html/about/index.php +++ b/html/about/index.php @@ -1,6 +1,9 @@ diff --git a/html/account/index.php b/html/account/index.php index c5349006..0d16144b 100755 --- a/html/account/index.php +++ b/html/account/index.php @@ -1,6 +1,11 @@ diff --git a/html/login/index.php b/html/login/index.php index 6128271a..6dfde443 100755 --- a/html/login/index.php +++ b/html/login/index.php @@ -1,6 +1,10 @@ @@ -64,10 +69,6 @@ $pdo = sqlConnect($sqlDatabaseHost, $sqlDatabaseName, $sqlDatabaseUser, $sqlData
prepare($sqlRequest); @@ -105,7 +106,9 @@ $pdo = sqlConnect($sqlDatabaseHost, $sqlDatabaseName, $sqlDatabaseUser, $sqlData echo ('
'); echo ('
'); - echo ($parsedown->text($articleMarkdownContent)); + $pageContent = markdownContent($rootFilePath . 'content/articles/' . $articleID . '.md', $rootFilePath); + + echo($pageContent); echo ('
'); echo (''); diff --git a/html/settings/deleteaccount.php b/html/settings/deleteaccount.php index 7b176126..a6c33724 100755 --- a/html/settings/deleteaccount.php +++ b/html/settings/deleteaccount.php @@ -1,6 +1,9 @@ getMessage();?> \ No newline at end of file diff --git a/include/functions.php b/include/functions.php deleted file mode 100755 index b95f66c6..00000000 --- a/include/functions.php +++ /dev/null @@ -1,217 +0,0 @@ - Number of different themes - $darkTheme = $darkThemes[$newTheme]; - $lightTHeme = $lightThemes[$newTheme]; - - } else if (isset($_COOKIE['theme'])) { - $theme = (int)$_COOKIE['theme'] % 2; - $darkTheme = $darkThemes[$theme]; - $lightTheme = $lightThemes[$theme]; - } - - $status = ""; - - function markdownContent($filePath, $rootFilePath) { - $markdownContent = file_get_contents($filePath); - require_once $rootFilePath . 'include/parsedown.php'; - $parsedown = new Parsedown(); - return $parsedown->text($markdownContent); - } - - function fillHead($rootPageURL, $pageTitle, $darkTheme, $lightTheme) { - - echo (''); - echo (''); - echo (''); - echo (''); - - echo (''); - - echo ('' . $pageTitle . ''); - } - - function fillHeader($rootPageURL, $headerTitle, $headerSubtitle) { - - echo ('
'); - - echo (''); - echo (''); - echo (''); - - echo ('
'); - - echo ('
'); - - echo ('
'); - echo ('
' . $headerTitle . '
'); - echo ('
' . $headerSubtitle . '
'); - echo ('
'); - - echo ('
'); - } - - function fillNav($rootPageURL) { - - echo (''); - echo (''); - - if ($_SESSION['userLevel'] >= 3) { - echo (''); - } - - if(isset($_SESSION['userID'])) { - echo (''); - echo (''); - echo (''); - } else { - echo (''); - } - } - - function fillFooter($footerText) { - echo($footerText); - } - - function sqlConnect($dbHost, $dbName, $dbUser, $dbPass) { - try { - $pdo = new PDO('mysql:host=' . $dbHost . ';dbname=' . $dbName . ';charset=UTF8mb4', $dbUser, $dbPass); - $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - - } catch(Exception $e) { - require('error.php'); - die(); - } - - return $pdo; - } - - function userWidget($userPPURL, $userDisplayName, $userName, $userCertification, $badges, $rootPageURL) { - - echo (''); - echo ('
'); - - echo ('
'); - echo (''); - echo ('
'); - - echo (''); - - echo ('
'); - echo ('
'); - } - - function listArticles($result, $rootPageURL) { - - foreach($result as $article) { - $pubDateTime = strtotime($article['date']); - $pubDate = date('d/m/Y', $pubDateTime); - $articleID = $article['ID']; - $articleTitle = $article['title']; - $articleResume = $article['resume']; - $miniatureURL = empty($article['miniature']) ? $rootPageURL . "src/img/empty.jpg" : $article['miniature']; - if(isset($article['username']) && isset($article['display_name'])) { - $authorLink = ' | ' . $article['display_name'] . ''; - } else { - $authorLink = ''; - } - - echo('
'); - - echo(''); - echo('
'); - - echo(''); - - echo('
'); - echo('
'); - - echo('
'); - echo('
n° ' . $articleID . ' | ' . $pubDate . '
'); - - echo(''); - echo('
' . $articleTitle . '
'); - echo('
'); - - echo('
' . $articleResume . '
'); - - echo('
'); - echo('
'); - } - } - - function textInput($type, $shapePath, $name, $placeholder, $value) { - - echo ('
'); - echo (''); - echo (''); - echo ('
'); - } - - function fileInput($name) { - echo ('
'); - echo (''); - echo ('
'); - } - - function selectInput($name, $label, $options, $defaultValue) { - echo('
'); - echo(''); - echo(''); - echo('
'); - } - -?> \ No newline at end of file diff --git a/include/init.php b/include/init.php new file mode 100644 index 00000000..6e49cebd --- /dev/null +++ b/include/init.php @@ -0,0 +1,30 @@ + Number of different themes + $darkTheme = $darkThemes[$newTheme]; + $lightTHeme = $lightThemes[$newTheme]; + +} else if (isset($_COOKIE['theme'])) { + $theme = (int)$_COOKIE['theme'] % 2; + $darkTheme = $darkThemes[$theme]; + $lightTheme = $lightThemes[$theme]; +} + +$status = ""; + +?> \ No newline at end of file diff --git a/include/inputs.php b/include/inputs.php new file mode 100644 index 00000000..daa9389d --- /dev/null +++ b/include/inputs.php @@ -0,0 +1,33 @@ +'); + echo (''); + echo (''); + echo (''); +} + +function fileInput($name) { + echo ('
'); + echo (''); + echo ('
'); +} + +function selectInput($name, $label, $options, $defaultValue) { + echo('
'); + echo(''); + echo(''); + echo('
'); +} +?> \ No newline at end of file diff --git a/include/main-functions.php b/include/main-functions.php new file mode 100755 index 00000000..3c8d833b --- /dev/null +++ b/include/main-functions.php @@ -0,0 +1,21 @@ +text($markdownContent); +} + +function sqlConnect($dbHost, $dbName, $dbUser, $dbPass) { + try { + $pdo = new PDO('mysql:host=' . $dbHost . ';dbname=' . $dbName . ';charset=UTF8mb4', $dbUser, $dbPass); + $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + } catch(Exception $e) { + die('
getMessage();?>
'); + } + + return $pdo; +} +?> \ No newline at end of file diff --git a/include/objects.php b/include/objects.php new file mode 100644 index 00000000..9e18a17a --- /dev/null +++ b/include/objects.php @@ -0,0 +1,72 @@ +'); + echo ('
'); + + echo ('
'); + echo (''); + echo ('
'); + + echo ('
'); + + echo ('
'); + echo ($userDisplayName); + if ($userCertification > 0) { + echo (''); + echo ('' . $badges[$userCertification] . ''); + echo (''); + } + echo ('
'); + + echo ('
@' . $userName . '
'); + + echo ('
'); + + echo ('
'); + echo (''); +} + + +function listArticles($result, $rootPageURL) { + + foreach($result as $article) { + + $pubDateTime = strtotime($article['date']); + $pubDate = date('d/m/Y', $pubDateTime); + $articleID = $article['ID']; + $articleTitle = $article['title']; + $articleResume = $article['resume']; + $miniatureURL = empty($article['miniature']) ? $rootPageURL . "src/img/empty.jpg" : $article['miniature']; + if(isset($article['username']) && isset($article['display_name'])) { + $authorLink = ' | ' . $article['display_name'] . ''; + } else { + $authorLink = ''; + } + + echo('
'); + + echo(''); + echo('
'); + + echo(''); + + echo('
'); + echo('
'); + + echo('
'); + echo('
n° ' . $articleID . ' | ' . $pubDate . '
'); + + echo(''); + echo('
' . $articleTitle . '
'); + echo('
'); + + echo('
' . $articleResume . '
'); + + echo('
'); + echo('
'); + } +} + +?> \ No newline at end of file diff --git a/include/panels.php b/include/panels.php new file mode 100644 index 00000000..f5cb41e1 --- /dev/null +++ b/include/panels.php @@ -0,0 +1,74 @@ +'); + echo (''); + echo (''); + echo (''); + + echo (''); + + echo ('' . $pageTitle . ''); +} + + +function fillHeader($rootPageURL, $headerTitle, $headerSubtitle) { + + echo ('
'); + + echo (''); + echo (''); + echo (''); + + echo ('
'); + + echo ('
'); + + echo ('
'); + echo ('
' . $headerTitle . '
'); + echo ('
' . $headerSubtitle . '
'); + echo ('
'); + + echo ('
'); +} + + +function fillNav($rootPageURL) { + + echo (''); + echo (''); + + if ($_SESSION['userLevel'] >= 3) { + echo (''); + } + + if(isset($_SESSION['userID'])) { + echo (''); + echo (''); + echo (''); + } else { + echo (''); + } +} + + +function fillFooter($footerText) { + echo($footerText); +} + +?> \ No newline at end of file