POUR L'ENTETE DANS WIKI/ACTIONS/HEADER.PHP/LIGNE 61 <?php if (!$this->HasAccess('write', $comment['tag'])) { ?> <style type="text/css"> .handout { display: none; } </style> <?php } ?> POUR LE BAS DE PAGE DANS WIKI /HANDLERS/PAGE/SHOW.PHP/LIGNE 101 <?php if ($this->config[comments_disable]=="0") { if ($HasAccessRead) { // load comments for this page $comments = $this->LoadComments($this->tag); $commentspam = $this->LoadCommentspam($this->tag); // store comments display in session $tag = $this->GetPageTag(); if (!isset($_SESSION["show_comments"][$tag])) $_SESSION["show_comments"][$tag] = ($this->UserWantsComments() ? "1" : "0"); if (isset($_REQUEST["show_comments"])){ switch($_REQUEST["show_comments"]) { case "0": $_SESSION["show_comments"][$tag] = 0; break; case "1": $_SESSION["show_comments"][$tag] = 1; break; } } // display comments! if ($this->page && $_SESSION["show_comments"][$tag]) { // display comments header ?> <div class="commentsheader"> Commentaires [<a href="<?php echo $this->href("", "", "show_comments=0") ?>">Cacher commentaires/formulaire</a>] </div> <?php // display comments themselves if ($comments) { foreach ($comments as $comment) { echo "<br /><a name=\"",$comment["tag"],"\"></a>\n" ; echo "<div class=\"comment\">\n" ; //Ajouter pour l'édition et suppression des commentaires if ($this->HasAccess('write', $comment['tag']) || $this->UserIsOwner($comment['tag']) || $this->UserIsOwner() || ($this->GetUserName()== $this->config[admin_wiki]) ) { echo '<div class="commenteditlink">'; if ($this->HasAccess('write', $comment['tag'])) { echo '<a href="',$this->href('edit',$comment['tag']),'">Éditer ce commentaire</a>'; } if ($this->UserIsOwner($comment['tag']) || $this->UserIsOwner() || ($this->GetUserName()== $this->config[admin_wiki])) { echo '<br />','<a href="',$this->href('deletecomment',$comment['tag']),'"';?> onclick="return confirm('Voulez-vous vraiment supprimer ce commentaire?');" <?php echo '>Supprimer ce commentaire</a>'; } //echo "$comment[comment_on]"; echo "</div>\n"; } //FIn de edition suppression commentaire echo $this->Format($comment["body"]),"\n" ; echo "<div class=\"commentinfo\">\n-- ",$this->Format($comment["user"])," (".$comment["time"],")\n</div>\n" ; echo "</div>\n" ; } } if ($commentspam && ($this->GetUserName()== $this->config[admin_wiki]) && ($this->config[comments_spam_enable]==1)) { foreach ($commentspam as $spam) { echo "<br /><a name=\"",$spam["tag"],"\"></a>\n" ; echo "<div class=\"commentspam\">\n" ; //Ajouter pour l'édition et suppression des commentaires if ($this->GetUserName()== $this->config[admin_wiki]) { echo '<div class="commenteditlink">'; if ($this->GetUserName()== $this->config[admin_wiki]) { echo '<br />','<a href="',$this->href('deletespam',$spam['tag']),'"';?> onclick="return confirm('Voulez-vous vraiment supprimer ce commentaire?');" <?php echo '>Supprimer ce commentaire</a>'; } echo "</div>\n"; } //FIn de edition suppression commentaire echo $this->Format($spam["body"]),"\n" ; echo "<div class=\"commentinfo\">\n-- ",$this->Format($spam["user"])," (".$spam["time"],")\n</div>\n" ; echo "</div>\n" ; } } echo "<br />" ; // display comment form echo "<div class=\"commentform\">\n" ; if ($this->HasAccess("comment")) { $c1 = rand(0,9); $c2 = rand(0,9); $calcul = ($c1 + $c2); //echo $calcul; ?> Ajouter un commentaire à cette page<? if ($this->config[ask_question_comment]=="1") { ?> <span class="question">(n'oubliez pas de donner la réponse au calcul)</span><? } ?>:<br /> <?php echo $this->FormOpen("addcomment"); ?> <textarea name="body" rows="6" style="width: 99%" value="<? echo $_POST[body]; ?>"></textarea><br /> <? if ($this->config[ask_question_comment]=="1") { echo "<span class=\"question\">$c1 + $c2 =</span>"; ?> <input name="rep" id="rep" type="text" size="3" maxlength="5" /> <input name="calcul" value="<?php echo $calcul; ?>" type="hidden" /> <? } ?> <input type="submit" value="Ajouter Commentaire" accesskey="s" /> <?php echo $this->FormClose(); ?> <?php } echo "</div>\n" ; } else { ?> <div class="commentsheader"> <?php switch (count($comments)) { case 0: echo "Il n'y a pas de commentaire sur cette page." ; break; case 1: echo "Il y a un commentaire sur cette page." ; break; default: echo "Il y a ",count($comments)," commentaires sur cette page." ; } ?> [<a href="<?php echo $this->href("", "", "show_comments=1") ?>">Afficher commentaires/formulaire</a>] </div> <?php } } } echo $this->Footer(); ?>