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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
<?php
try
{
// On se connecte à MySQL
$bdd = new PDO('mysql:host=localhost;dbname=blog_forteroche;charset=utf8', 'root', '');
}
catch(Exception $e)
{
// En cas d'erreur, on affiche un message et on arrête tout
die('Erreur : '.$e->getMessage());
}
// Si tout va bien, on peut continuer
// On récupère tout le contenu de la table jeux_video
$reponse = $bdd->query('SELECT id,user_id, title,chapter, content, DATE_FORMAT(creationDate, \'%d/%m/%Y\') AS creation_date_fr FROM posts ORDER BY creationDate ');?>
<!DOCTYPE html>
<html>
<head>
"></script>
<script src="https://cloud.tinymce.com/stable/tinymce.min.js?apiKey=i9qtcs3a3bdsajmuw9vustqee9f5wd2z1pnc8mpv2bjzzzn0"></script>
<script>
tinymce.init({
selector: "textarea"
, selector: "textarea:not(.mceNoEditor)"
, theme: 'modern'
, plugins: 'lists advlist image imagetools'
});
</script>
</head>
<title>
<?= $title ?>
</title>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<?php if (!$_SESSION) { ?>
<ul class="nav navbar-nav">
<li><a href="#about" class="billet">Billet simple pour l'Alaska</a></li>
<li><a href="index.php"><i class="fa fa-home"></i>Accueil</a></li>
<li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="index.php?action=chapterList" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Chapitres
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<?php while ($data = $posts->fetch())
{
?>
<a action="" class="dropdown-item" href="#">
<?php echo $data['chapter']; ?>
</a>
<?php
}
$reponse->closeCursor(); // Termine le traitement de la requête ?>
</div>
</li>
<li><a href="index.php?action=connect"><i class="fa fa-sign-in" aria-hidden="true"></i>Connexion</a></li>
</ul>
<?php } else { ?>
<ul class="nav navbar-nav">
<li><a href="#about" class="billet">Billet simple pour l'Alaska</a></li>
<li><a href="index.php"><i class="fa fa-home"></i>Accueil</a></li>
<li><a href="index.php?action=board">Board</a></li>
<li><a href="index.php?action=deconnexion"><i class="fa fa-sign-in" aria-hidden="true"></i>Déconnexion</a></li>
</ul>
<?php } ?>
</div>
</div>
</nav>
<div>
<?= $content ?>
</div>
<footer id="footer" class="navbar-fixed-bottom">
<p>©forteroche</p>
</footer>
</body>
</html> |
Partager