-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtp_blog_myth_display_article_view.html.php
More file actions
53 lines (52 loc) · 2.53 KB
/
Copy pathtp_blog_myth_display_article_view.html.php
File metadata and controls
53 lines (52 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
session_start();
include_once "tp_blog_myth_db_func.php";
include_once "tp_blog_myth_verif_session.php";
if (!isset($_GET["article"])) {
header("Location: index.php");
}
$currentArticle = selectArticle($_GET["article"]);
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<title><?=htmlspecialchars($currentArticle->titre_article)?> - HEKATONCHEIRES</title>
<link rel="icon" type="image/png" sizes="32x32" href="assets/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/img/favicon-16x16.png">
<link rel="stylesheet" href="assets/style/style.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css">
<script src="assets/script/bulmaScript.js" defer></script>
</head>
<body>
<?php include_once "tp_blog_myth_header.html.php";?>
<div class="container is-fluid">
<?php if (!empty($currentArticle)) {
$currentArticleDate = new DateTime($currentArticle->date_article); ?>
<?php if ($login && $isAdmin == 1) { ?>
<div class="is-flex is-justify-content-end delete-article-div">
<a class="button mt-5 is-danger is-light" href="tp_blog_myth_delete_confirm_view.html.php?article=<?=$currentArticle->id_article?>">Supprimer l'article</a>
</div>
<?php } ?>
<div class="p-3 columns is-flex is-flex-direction-column is-align-items-center">
<div class="is-flex pt-5 pb-3 is-flex-direction-column is-align-items-center max-width-max-content">
<h1 class="is-size-3 has-text-centered"><?=htmlspecialchars($currentArticle->titre_article)?></h1>
<div>
<small><?=htmlspecialchars("Publié par ".$currentArticle->pseudo_user." le ".$currentArticleDate->format("d/m/Y à H:i"))?></small>
</div>
</div>
<div>
<img class="article-img" src="assets/img/<?=$currentArticle->image_article?>">
</div>
<div class="column is-four-fifths">
<p class="p-5"><?=nl2br(htmlspecialchars($currentArticle->contenu_article))?></p>
</div>
</div>
<?php } else { ?>
<div class="notification mt-5 is-danger is-light">
Cet article n'existe pas ou a été supprimé. <a href="index.php" class="has-text-weight-semibold">Retour à la liste des articles</a>
</div>
<?php } ?>
</div>