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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="design.css" />
<link rel="stylesheet" href="colorbox.css" />
<title>Test design</title>
</head>
<body>
<header><a href="index.php"><img src="img/logo.PNG" /></a>
<nav>
<?php
include('nav.php');
?>
</nav>
<script language="javascript" type="text/javascript" src="modules/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
theme : "advanced",
language : "fr",
mode : "textareas"
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="module/jquery.colorbox.js"></script>
<script>
$(document).ready(function(){
$(".inline").colorbox({inline:true, width:"50%"});
$(".callbacks").colorbox({
onOpen:function(){ alert('onOpen: colorbox is about to open'); },
onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
});
});
</script>
</header>
<div id="clear"></div>
<div id="image">
</div>
<article>
<?php
if(isset($_SESSION['pseudo']))
{
$_SESSION['idarticle'] = $_GET['idarticle'];
?>
<span class="bebas">Ajouter un commentaire</span><br /><br />
<form method="post" action="ajoutcommentaire.php">
<p>
<textarea name="commentaire" cols="15" rows="15"></textarea>
<input type="submit" value="Enregistrer" />
</p>
</form>
<?php
}
?>
<span class="bebas">Commentaires</span><br />
<a href="article-<?php echo $_GET['idarticle'] ?>.html">Retour</a><br />
<?php
include("connexion.php");
$req = $bdd->prepare("SELECT * FROM commentaire WHERE idarticle=? ORDER BY id DESC");
$req->execute(array(htmlspecialchars($_GET['idarticle'])));
$row = $req->rowCount();
if(!($row == 0))
{
while ($d = $req->fetch())
{
$req2 = $bdd->prepare("SELECT photo FROM inscription WHERE pseudo=?");
$req2->execute(array($d['auteur']));
while ($i = $req2->fetch())
{
?>
<span class="leftComment"><img src="<?php echo $i['photo']; ?>" /></span>
<span class="rightComment"><b><?php echo $d['auteur']; ?></b><br />
<?php echo $d['commentaire']; ?>
<em><?php echo $d['date']; ?></em>
<?php
if(isset($_SESSION['rang']) AND ($_SESSION['rang'] == 2) OR isset($_SESSION['pseudo']) AND ($_SESSION['pseudo'] == $d['auteur']))
{
?>
<div style='display:none'>
<div id='inline_content<?php echo $d['id']; ?>' style='padding:10px; background:#fff;'>
<form method="post" action="modcommentaire.php">
<p>
<textarea name="contenu" rows="15" class="commentairemod"><?php echo $d['commentaire']; ?></textarea>
<input type="hidden" name="id" value="<?php echo $d['id']; ?>" /><br />
<input type="hidden" name="idarticle" value="<?php echo $_GET['idarticle']; ?>" />
<input type="submit" value="Modifier" onclick="return(confirm('Modifier le commentaire ?'));"/>
</p>
</form>
</div>
</div><br />
<a class='inline' href="#inline_content<?php echo $d['id']; ?>">Modifier le commentaire</a>
<br /><br /></span>
<span class="separateur"></span><br />
<?php
}
else
{
?><br /><br /></span><span class="separateur"></span><br /><?php
}
}
}
}
else
{
?><span class="bebas">Aucun commentaire posté</span><?php
}
?>
</article>
<div id="clear"></div>
<footer>
Copylol (c) Rauschenberg Productions
</footer>
</body>
</html> |
Partager