Blame | Last modification | View Log | RSS feed
<?php/*show.phpCopyright (c) 2002, Hendrik Mans <hendrik@mans.de>Copyright 2002, 2003 David DELONCopyright 2002, 2003 Charles NEPOTECopyright 2003 Eric DELORDCopyright 2003 Eric FELDSTEINAll rights reserved.Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditionsare met:1. Redistributions of source code must retain the above copyrightnotice, this list of conditions and the following disclaimer.2. Redistributions in binary form must reproduce the above copyrightnotice, this list of conditions and the following disclaimer in thedocumentation and/or other materials provided with the distribution.3. The name of the author may not be used to endorse or promote productsderived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ORIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIESOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUTNOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANYTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OFTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*///vérification de sécuritéif (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {die ("accès direct interdit");}echo $this->Header();?><div class="page"><?phpif ($HasAccessRead=$this->HasAccess("read")){if (!$this->page){echo "Cette page n'existe pas encore, voulez vous la <a href=\"".$this->href("edit")."\">créer</a> ?" ;}else{// comment header?if ($this->page["comment_on"]){echo "<div class=\"commentinfo\">Ceci est un commentaire sur ",$this->ComposeLinkToPage($this->page["comment_on"], "", "", 0),", posté par ",$this->Format($this->page["user"])," à ",$this->page["time"],"</div>";}if ($this->page["latest"] == "N"){echo "<div class=\"revisioninfo\">Ceci est une version archivée de <a href=\"",$this->href(),"\">",$this->GetPageTag(),"</a> à ",$this->page["time"],".</div>";}// display pageecho $this->Format($this->page["body"], "wakka");// if this is an old revision, display some buttonsif (($this->page["latest"] == "N") && $this->HasAccess("write")){$latest = $this->LoadPage($this->tag);?><br /><?php echo $this->FormOpen("edit") ?><input type="hidden" name="previous" value="<?php echo $latest["id"] ?>"><input type="hidden" name="body" value="<?php echo htmlentities($this->page["body"]) ?>"><input type="submit" value="Rééditer cette version archivée"><?php echo $this->FormClose(); ?><?php}}}else{echo "<i>Vous n'êtes pas autorisé à lire cette page</i>" ;}?><hr class="hr_clear" /></div><?phpif ($HasAccessRead){// load comments for this page$comments = $this->LoadComments($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 themselvesif ($comments){foreach ($comments as $comment){echo "<a name=\"",$comment["tag"],"\"></a>\n" ;echo "<div class=\"comment\">\n" ;echo $this->Format($comment["body"]),"\n" ;echo "<div class=\"commentinfo\">\n-- ",$this->Format($comment["user"])," (".$comment["time"],")\n</div>\n" ;echo "</div>\n" ;}}// display comment formecho "<div class=\"commentform\">\n" ;if ($this->HasAccess("comment")){?>Ajouter un commentaire à cette page:<br /><?php echo $this->FormOpen("addcomment"); ?><textarea name="body" rows="6" style="width: 100%"></textarea><br /><input type="submit" value="Ajouter Commentaire" accesskey="s"><?php echo $this->FormClose(); ?><?php}echo "</div>\n" ;}else{?><div class="commentsheader"><?phpswitch (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();?>