Your IP : 216.73.216.229


Current Path : /home/photograt/gerard-clavet-photos.com/AutreJML4/STIP/supportwiki/
Upload File :
Current File : /home/photograt/gerard-clavet-photos.com/AutreJML4/STIP/supportwiki/index.php3.txt

<?php

// Wiki !
// Par plam (220@chez.com - http://forum-scpo.com/wiki)
// Si n�cessaire, cr�er un fichier wiki.db dans le r�pertoire courant

  function format_html($text)
  {
    $text = ereg_replace("\n", "<BR>\n", $text);
    $text = ereg_replace("'''(('?[^\n'])*)'''", "<b>\\1</b>", $text);
    $text = ereg_replace("''(('?[^\n'])*)''", "<i>\\1</i>", $text);
    $text = str_replace("----", "<HR>", $text);
    $text = ereg_replace("[[:<:]][A-Z][a-z]+([A-Z][a-z]+)+[[:>:]]", 
                         "<a href=\"index.php3?name=\\0\">\\0</a>",
			 $text);
    $text = eregi_replace("([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])", "<A HREF=\"\\1://\\2\\3\" TARGET=\"_blank\">\\1://\\2\\3</A>", $text);
    $text = eregi_replace("([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+)", "<A HREF=\"mailto:\\1\">\\1</A>", $text);
    return $text;
  }  

  if ($name == "")
    $name="FrontPage";

  if ($editmode != "done")
  {
    $db = dbmopen("wiki.db", "r");
    $text = dbmfetch($db, $name);
    if ($text == "")  
      $text = "D�crivez $name en cliquant sur le bouton.";
    dbmclose($db);
  }
  else 
  {
    $date = date("d M Y - H:i");
    $text = str_replace("<d>",$date,$text);
    $db = dbmopen("wiki.db", "w");
    dbmreplace($db, $name, $text);
    dbmclose($db);
  }  

  $text = stripslashes($text);
  $htmltext = htmlspecialchars($text);
?>  

<html>
 <head><title><?php print $name; ?></title>
 <STYLE><!--
 body,td,a	{font-family:Arial,Helvetica;}
 a		{color:red;}
 a:hover	{color:blue;text-decoration:none;}
 //--></STYLE></head>
 <body>


  <?php
   if ($editmode == "")
   { ?><br><ul>
     <h1><?php print $name; ?></h1></ul><br>
     <center>
     <TABLE BORDER=0 WIDTH=95% align=center bgcolor="#EEEEEE" cellspacing=0>
     <tr><td>
     <?php
        print format_html($htmltext);
     ?>
   <p><hr noshade>
   <form method="post" action="index.php3">
    <input type="submit" value="Editer la Page">
    <input type="hidden" name="name" value="<?php print $name; ?>">
    <input type="hidden" name="editmode" value="edit">
   </form>
<?php } else if ($editmode == "edit"){ ?>
     <br><ul><h1>Edition de <?php print $name; ?></h1></ul><br>
     <center>
     <TABLE BORDER=0 WIDTH=95% align=center bgcolor="#EEEEEE" cellspacing=0>
     <tr><td>
    <form method="post" action="index.php3">
     <input type="hidden" name="editmode" value="done">
    <input type="hidden" name="name" value="<?php print $name; ?>">
     <textarea rows=18 cols=70 name="text"><?php print $htmltext; ?></textarea><br>
     <input type="submit" value="Enregistrer"></form></td><td valign=top>
     <b>Attention, vous allez modifier cette page !</b><br><br>N'oubliez pas que :<br>
      - ''exemple'' affiche <i>exemple</i><br>
      - '''exemple''' affiche <b>exemple</b><br>
      - quatre tirets (----) dessinent une ligne horizontale<br>
      - &lt;d&gt; inscrit la date et l'heure d'�dition</td></tr><tr><td colspan=2>
    <p><hr noshade>
<?php } else { ?>    
     <br><ul><h1>Merci d'avoir �dit� <?php print $name; ?></h1></ul><br>
     <center>
     <TABLE BORDER=0 WIDTH=95% align=center bgcolor="#EEEEEE" cellspacing=0>
     <tr><td>
     <?php
        print format_html($htmltext);
     ?>   
    <p><hr noshade>
<?php } ?>
	<font size=-1>Retour � <a href="index.php3?name=FrontPage">Frontpage</a></font>
    </p>
      </TD>
     </TR>
    </TABLE>
   </CENTER>     
  </body>
 </html>