Retour [./2.19_2/index.php]
show/hide
0
1 <?php
2 // TigerWiki 2 (Version 2.19 - 2006-11-02)
3 // Copyleft (C) Arsenic 2005-2006, licence GNU/GPL (disponible sur www.gnu.org)
4 // http://chabel.org/ - root chez chabel point org
5 $WIKI_VERSION = "TigerWiki 2.19+2";
6
7 //Fichier de configuration
8 include("_config.php");
9
10 // Trouver la page a afficher
11 if (! $PAGE_TITLE = stripslashes($_GET["page"]))
12 {
13 if ($_GET["action"] == "search")
14 if ($_GET["query"] != "")
15 $PAGE_TITLE = "$SEARCH_RESULTS \"$_GET[query]\"";
16 else
17 $PAGE_TITLE = $LIST . " (" . count(glob("$PAGES_DIR/*.*")) . ")";
18 elseif ($_GET["action"] == "recent")
19 $PAGE_TITLE = "$RECENT_CHANGES";
20 elseif ($_GET["action"] == "upload") // JJL upload
21 $PAGE_TITLE = $UPLOAD_BUTTON;
22 else
23 $PAGE_TITLE = "$START_PAGE";
24 }
25 if ($_GET["page"] == $UPLOAD_BUTTON)
26 $action="upload";
27 else
28 $action = $_GET["action"];
29
30 if (isset($_GET["time"]))
31 $gtime = $_GET["time"];
32 $datetw = date("Y/m/d H:i", mktime(date("H") + $LOCAL_HOUR));
33
34 // Arreter les acces malicieux via repertoire et accents
35 if (preg_match("/\//", $PAGE_TITLE))
36 $PAGE_TITLE = $START_PAGE;
37 if (preg_match("/\//", $gtime))
38 $gtime = '';
39
40 // Ecrire les modifications, s'il y a lieu
41 if ($_POST["content"] != "")
42 {
43 if ($_SERVER["REQUEST_METHOD"] == "POST")
44 {
45 if ($_POST["sc"] == $PASSWORD || $_COOKIE['AutorisationTigerWiki'] == md5($PASSWORD))
46 {
47 setcookie('AutorisationTigerWiki', md5($PASSWORD), time() + 365*24*3600);
48 if (! $file = @fopen($PAGES_DIR . stripslashes($_POST["page"]) . ".txt", "w"))
49 die("Could not write page!");
50 if (get_magic_quotes_gpc())
51 fputs($file, trim(stripslashes($_POST["content"])));
52 else
53 fputs($file, trim($_POST["content"]));
54 fclose($file);
55 if ($BACKUP_DIR <> '')
56 {
57 $complete_dir_s = $BACKUP_DIR . $_POST["page"] . "/";
58 if (! $dir = @opendir($complete_dir_s))
59 {
60 mkdir($complete_dir_s);
61 chmod($complete_dir_s,0777);
62 }
63 if (! $file = @fopen($complete_dir_s . date("Ymd-Hi", mktime(date("H") + $LOCAL_HOUR)) . ".bak", "a"))
64 die("Could not write backup of page!");
65 fputs($file, "\n// " . $datetw . " / " . " " . $_SERVER['REMOTE_ADDR'] . "\n");
66 if (get_magic_quotes_gpc())
67 fputs($file, trim(stripslashes($_POST["content"])));
68 else
69 fputs($file, trim($_POST["content"]) . "\n\n");
70 fclose($file);
71 }
72 include("ModuleRSS.php");
73 header("location: ./?page=" . urlencode(stripslashes($_POST[page])));
74 }
75 else
76 {
77 header("location: ./?page=" . $_POST[page]."&action=edit&error=1");
78 }
79 }
80 }
81 elseif (isset($_POST["content"]) && $_POST["content"] == "")
82 {
83 if ($_POST["sc"] == $PASSWORD || $_COOKIE['AutorisationTigerWiki'] == md5($PASSWORD))
84 {
85 setcookie('AutorisationTigerWiki', md5($PASSWORD), time() + 365*24*3600);
86 unlink($PAGES_DIR . stripslashes($_POST["page"]) . ".txt");
87 }
88 else
89 header("location: ./?page=".$_POST["page"]."&action=edit&error=1");
90 }
91
92 // Lecture et analyse du modèle de page
93 if (! $file = @fopen("template.html", "r"))
94 die("'template.html' is missing!");
95 $template = fread($file, filesize("template.html"));
96 fclose($file);
97
98 // Lecture du contenu et de la date de modification de la page
99 if (($file = @fopen($PAGES_DIR . $PAGE_TITLE . ".txt", "r")) || $action <> "")
100 {
101 if (file_exists($PAGES_DIR . $PAGE_TITLE . ".txt"))
102 $TIME = date("Y/m/d H:i", @filemtime($PAGES_DIR . $PAGE_TITLE . ".txt") + $LOCAL_HOUR * 3600);
103 $CONTENT = "\n" . @fread($file, @filesize($PAGES_DIR . $PAGE_TITLE . ".txt")) . "\n";
104 // Restaurer une page
105 if (isset($_GET["page"]) && isset($gtime) && $_GET["restore"] == 1)
106 if ($file = @fopen($BACKUP_DIR . $PAGE_TITLE . "/" . $gtime, "r"))
107 $CONTENT = "\n" . @fread($file, @filesize($BACKUP_DIR . $PAGE_TITLE . "/" . $gtime)) . "\n";
108 @fclose($file);
109 $CONTENT = preg_replace("/\\$/Umsi", "$", $CONTENT);
110 $CONTENT = preg_replace("/\\\/Umsi", "\", $CONTENT);
111 }
112 else
113 {
114 if (!file_exists($PAGES_DIR . $PAGE_TITLE . ".txt"))
115 $CONTENT = "\n" . $DEFAULT_CONTENT;
116 else
117 $action = "edit";
118 }
119
120 // Déterminer le mode d'accès
121 if ($action == "edit" || $action == "search" || $action == "recent" || $action == "upload")
122 $html = preg_replace('/{EDIT}/', $EDIT_BUTTON, $template);
123 elseif (is_writable($PAGES_DIR . $PAGE_TITLE . ".txt") || !file_exists($PAGES_DIR . $PAGE_TITLE . ".txt"))
124 $html = preg_replace('/{EDIT}/', "<a href=\"./?page=".$PAGE_TITLE."&action=edit\" accesskey=\"5\">$EDIT_BUTTON</a>", $template);
125 else
126 $html = preg_replace('/{EDIT}/', $PROTECTED_BUTTON, $template);
127 if ($action == "recent" || $action == "upload")
128 $html = preg_replace('/{RECENT_CHANGES}/', $RECENT_CHANGES, $html);
129 else
130 $html = preg_replace('/{RECENT_CHANGES}/', "<a href=\"./?action=recent\" accesskey=\"3\">$RECENT_CHANGES</a>", $html);
131
132
133 // Remplacer les variables par des valeurs (dans le style de page)
134 $html = preg_replace('/{PAGE_TITLE_BRUT}/', $PAGE_TITLE, $html);
135 if ($action != "" && $action != "recent" && $action != "search" && $action != "upload")
136 $html = preg_replace('/{PAGE_TITLE}/', "<a href=\"./?page=".$PAGE_TITLE."\">".$PAGE_TITLE."</a>", $html);
137 else
138 $html = preg_replace('/{PAGE_TITLE}/', $PAGE_TITLE, $html);
139 if ($PAGE_TITLE == $START_PAGE && $action <> "search")
140 $html = preg_replace('/{HOME}/', $HOME_BUTTON, $html);
141 else
142 $html = preg_replace('/{HOME}/', "<a href=\"./?page=".$START_PAGE."\" accesskey=\"1\">$HOME_BUTTON</a>", $html);
143 $html = preg_replace('/{WIKI_TITLE}/', $WIKI_TITLE, $html);
144 $html = preg_replace('/{LAST_CHANGE}/', $LAST_CHANGES." :", $html);
145 if ($action != "edit")
146 $html = preg_replace('/{HELP}/', "", $html);
147 else
148 $html = preg_replace('/{HELP}/', "(<a href=\"./?page=$HELP_BUTTON\" accesskey=\"2\">$HELP_BUTTON</a>)", $html);
149 $html = preg_replace('/{SEARCH}/', "<form method=\"get\" action=\"./?page=".$_GET[page]."\"><div><input type=\"hidden\" name=\"action\" value=\"search\" /><input type=\"text\" name=\"query\" value=\"$_GET[query]\" /> <input type=\"submit\" value=\"$SEARCH_BUTTON\" accesskey=\"q\" /></div></form>", $html);
150 if ($action == "edit")
151 {
152 $html = preg_replace('/{HISTORY}/', "/ <a href=\"?page=".$PAGE_TITLE."&action=history\" accesskey=\"6\">".$HISTORY_BUTTON."</a> / <a href=./?action=upload>".$UPLOAD_BUTTON."</a><br />", $html);
153 $CONTENT = "<form method=\"post\" action=\"./\"><textarea name=\"content\" cols=\"83\" rows=\"30\" style=\"width: 100%;\">$CONTENT</textarea><input type=\"hidden\" name=\"page\" value=\"".$PAGE_TITLE."\" /><br /><p align=\"right\">";
154 if ($PASSWORD != "" && $_COOKIE['AutorisationTigerWiki'] != md5($PASSWORD))
155 $CONTENT .= $MDP." : <input type=\"password\" name=\"sc\" />";
156 $CONTENT .= " <input type=\"submit\" value=\"$DONE_BUTTON\" accesskey=\"s\" /></p></div></form>";
157 }
158 elseif ($action != "history")
159 $html = preg_replace('/{HISTORY}/', "", $html);
160
161 // Liste des versions historiques d'une page
162 if ($action == "history" && !isset($gtime))
163 {
164 $html = preg_replace('/{HISTORY}/', "/ ".$HISTORY_BUTTON, $html);
165 $complete_dir = $BACKUP_DIR . $_GET["page"] . "/";
166 if ($opening_dir = @opendir($complete_dir))
167 {
168 while (false !== ($filename = @readdir($opening_dir)))
169 $files[] = $filename;
170 sort ($files);
171 for ($cptfiles = 2; $files[$cptfiles] != ''; $cptfiles++)
172 $affichage = $affichage."<a href=\"?page=".$_GET["page"]."&action=history&time=".$files[$cptfiles]."\">".$files[$cptfiles]."</a><br />";
173 $html = preg_replace('/{CONTENT}/', $affichage, $html);
174 }
175 else
176 $html = preg_replace('/{CONTENT}/', $NO_HISTORY, $html);
177 }
178
179 // Affichage d'un fichier historique
180 if ($action == "history" && isset($gtime))
181 {
182 $complete_dir = $BACKUP_DIR . $PAGE_TITLE . "/";
183 if ($file = @fopen($BACKUP_DIR . $PAGE_TITLE . "/" . $gtime, "r"))
184 {
185 $html = preg_replace('/{HISTORY}/', "/ <a href=\"?page=".$PAGE_TITLE."&action=history\">".$HISTORY_BUTTON."</a> (<a href=\"?page=".$PAGE_TITLE."&action=edit&time=".$gtime."&restore=1\">".$RESTORE."</a>)", $html);
186 $CONTENT = @fread($file, @filesize($complete_dir . $gtime)) . "\n";
187 }
188 else
189 $html = preg_replace('/{HISTORY}/', "/ <a href=\"?page=".$PAGE_TITLE."&action=history\">".$HISTORY_BUTTON."</a> (-)", $html);
190 }
191
192 // affichage/gestion des fichiers uploadés
193 if ($action == "upload")
194 {
195 // Set current dir
196 if (isset($_GET['current']))
197 {
198 $current = str_replace("..","",urldecode($_GET['current']));
199 }
200 elseif (isset($_POST['current']))
201 $current = str_replace("..","",urldecode($_POST['current']));
202 else
203 $current = trim($DATA_DIR,"/");
204 $current = trim($current," ./"); // remove /.. at the end
205 $affichage .= "Choississez le fichier à uploader en cliquant sur <i>Parcourir</i>. Entrez votre mot de passe et cliquez sur <i>Envoyer</i><br/>Si vous êtes identifié, vous pouvez effacer un fichier en cliquant sur †<hr/>";
206 // Copie du fichier
207 // $affichage .= var_export($_FILES,true);
208 if(!empty($_FILES['fichier']['tmp_name']))
209 { //Un fichier a été envoyé, nous pouvons le traiter
210 if ($_POST["sc"] == $PASSWORD || $_COOKIE['AutorisationTigerWiki'] == md5($PASSWORD))
211 { // password is ok
212 setcookie('AutorisationTigerWiki', md5($PASSWORD), time() + 365*24*3600);
213 if(is_uploaded_file($_FILES['fichier']['tmp_name']))
214 {
215 move_uploaded_file($_FILES['fichier']['tmp_name'],$current."/".$_FILES['fichier']['name'] );
216 }
217 //~ else
218 //~ $affichage .= "not upload";
219 }
220 else
221 {
222 header("location: ./?action=".$action."&error=1");
223 }
224 }
225 //~ else
226 //~ $affichage .= "no file";
227
228 // Creation de repertoire
229 $repertoire = trim(str_replace("..","",$_POST["repertoire"])," ./");
230 if ($repertoire != "")
231 {
232 if ($_POST["sc"] == $PASSWORD || $_COOKIE['AutorisationTigerWiki'] == md5($PASSWORD))
233 { // password is ok
234 setcookie('AutorisationTigerWiki', md5($PASSWORD), time() + 365*24*3600);
235 mkdir($current."/".$repertoire);
236 }
237 else
238 {
239 header("location: ./?action=".$action."&error=1");
240 }
241 }
242
243 if (isset($_GET['del']))
244 { // Fichier à effacer
245 if ($_COOKIE['AutorisationTigerWiki'] == md5($PASSWORD))
246 { // cookie is ok
247 $dir = trim(urldecode(str_replace("..","",$_GET['del']))," ./");
248 if (is_dir($dir))
249 @rmdir($dir);
250 else
251 @unlink($dir);
252 }
253 else
254 {
255 header("location: ./?action=".$action."&error=1");
256 }
257 }
258
259 // liste des fichiers
260 if ($opening_dir = @opendir($current))
261 {
262 $affichage .= "<h3>".$current."</h3>";
263
264 while (false !== ($filename = @readdir($opening_dir)))
265 if (($filename != '.') and !($filename=='..' and $current==trim($DATA_DIR,"/")))
266 $files[] = $filename;
267 if ($files)
268 sort ($files);
269 for ($cptfiles = 0; $files[$cptfiles] != ''; $cptfiles++)
270 {
271 if ($files[$cptfiles] == "..")
272 $path = substr($current,0,strrpos($current,'/'));
273 else
274 $path = $current."/".$files[$cptfiles];
275 if (is_dir($path))
276 { // repertoire
277 $affichage = $affichage.'<a href="./?action='.$action."¤t=".urlencode($path).'">'.$files[$cptfiles].'/</a>';
278 }
279 else
280 {
281 $affichage = $affichage.'<a href="'.$path.'">'.$files[$cptfiles].'</a>';
282 }
283 if (($_COOKIE['AutorisationTigerWiki'] == md5($PASSWORD)) and ($files[$cptfiles] != ".."))
284 // authentifié donc peut effacer
285 $affichage .= ' (</font><a title="delete" href="./?action=upload&del='.urlencode($path)."¤t=".urlencode($current).'">†</a>)';
286 $affichage .= '<br />';
287
288 }
289 }
290 else
291 $affichage = $NO_DATA;
292 // formulaire d'upload
293 $affichage .= "<br/><form method=\"post\" action=\"./?action=".$action."\" enctype= \"multipart/form-data\"><p align=\"right\">";
294 if ($PASSWORD != "" && $_COOKIE['AutorisationTigerWiki'] != md5($PASSWORD))
295 $affichage .= $MDP." : <input type=\"password\" name=\"sc\" /> <br />";
296 $affichage .= '<input type="hidden" name="current" value="'.$current.'" /> <br/>';
297 $affichage .= $FILE.' : <input type="file" name="fichier" /> <br/>';
298 $affichage .= $DIR.' : <input type="text" name="repertoire" /> <br/>';
299 $affichage .= " <input type=\"submit\" value=\"$SEND_BUTTON\" accesskey=\"s\" /></p></div></form>";
300
301 $html = preg_replace('/{CONTENT}/', $affichage, $html);
302 }
303
304 // Erreur du mot de passe
305 if ($_GET['error'] == 1)
306 $html = preg_replace('/{ERROR}/', $ERROR, $html);
307 else
308 $html = preg_replace('/{ERROR}/', "", $html);
309
310 // Effacement du cookie
311 if ($_GET['erasecookie'] == 1)
312 setcookie('AutorisationTigerWiki');
313
314 // Page de recherche
315 if ($action == "search")
316 {
317 $dir = opendir(getcwd() . "/$PAGES_DIR");
318 while ($file = readdir($dir))
319 {
320 if (preg_match("/.txt/", $file))
321 {
322 $handle = fopen($PAGES_DIR . $file, "r");
323 @$content = fread($handle, filesize($PAGES_DIR . $file));
324 fclose($handle);
325 if (preg_match("/$_GET[query]/i", $content) || preg_match("/$_GET[query]/i", "$PAGES_DIR/$file"))
326 {
327 $file = substr($file, 0, strlen($file) - 4);
328 $CONTENT .= "<a href=\"./?page=$file\">$file</a><br />";
329 }
330 }
331 }
332 }
333
334 // Changements récents
335 elseif ($action == "recent")
336 {
337 $dir = opendir(getcwd() . "/$PAGES_DIR");
338 while ($file = readdir($dir))
339 if (preg_match("/.txt/", $file))
340 $filetime[$file] = filemtime($PAGES_DIR . $file);
341 arsort($filetime);
342 $filetime = array_slice($filetime, 0, 10);
343 foreach ($filetime as $filename => $timestamp)
344 {
345 $filename = substr($filename, 0, strlen($filename) - 4);
346 $CONTENT .= "<a href=\"./?page=$filename\">$filename</a> (" . strftime("$TIME_FORMAT", $timestamp + $LOCAL_HOUR * 3600) . ")<br />";
347 }
348 }
349
350 // Formatage de page
351 elseif ($action <> "edit")
352 {
353
354 if (preg_match("/%html%\s/", $CONTENT))
355
356 $CONTENT = preg_replace("/%html%\s/", "", $CONTENT);
357 else
358 {
359 $CONTENT = htmlentities($CONTENT);
360 $CONTENT = preg_replace("/&#036;/Umsi", "$", $CONTENT);
361 $CONTENT = preg_replace("/&#092;/Umsi", "\", $CONTENT);
362 // JJL fleches (c) (r)
363 $CONTENT = preg_replace("/<\-\->/Umsi", "↔", $CONTENT);
364 $CONTENT = preg_replace("/-\->/Umsi", "→", $CONTENT);
365 $CONTENT = preg_replace("/<\--/Umsi", "←", $CONTENT);
366 $CONTENT = preg_replace("/\([cC]\)/Umsi", "©", $CONTENT);
367 $CONTENT = preg_replace("/\([rR]\)/Umsi", "®", $CONTENT);
368
369 $CONTENT = preg_replace("/\^(.)/Umsie", "'&#'.ord('\\1').';'", $CONTENT);
370 $CONTENT = preg_replace('#\[(.+)\|([0-9a-zA-Z\.\'\s\#/~\-_%=\?\&,\+]*)\]#U', '<a href="$2" class="url">$1</a>', $CONTENT);
371 $CONTENT = preg_replace('#\[(.+)\|h(ttps?://[0-9a-zA-Z\.\#/~\-_%=\?\&,\+]*)\]#U', '<a href="xx$2" class="url">$1</a>', $CONTENT);
372 $CONTENT = preg_replace('#\[h(ttps?://[0-9a-zA-Z\.\&\#\:/~\-_%=?]*\.(jpg|gif|png))\]#i', '<img src="xx$1" />', $CONTENT);
373 $CONTENT = preg_replace('#\[([0-9a-zA-Z\.\&\#\:/~\-_%=?]*\.(jpg|gif|png))\]#i', '<img src="$1" />', $CONTENT);
374 $CONTENT = preg_replace('#(https?://[0-9a-zA-Z\.\&\#\:/~\-_%=?]*)#i', '<a href="$0" class="url">$1</a>', $CONTENT);
375 $CONTENT = preg_replace('#xxttp#', 'http', $CONTENT);
376 preg_match_all("/\[([^\/]+)\]/U", $CONTENT, $matches, PREG_PATTERN_ORDER); //Pour bloquer les liens accentués : "/\[([0-9a-zA-Z\- :\.,\(\)\']+)\]/U"
377 foreach ($matches[1] as $match)
378 if (file_exists(html_entity_decode($PAGES_DIR."$match.txt")))
379 $CONTENT = str_replace("[$match]", "<a href=\"./?page=".$match."\">$match</a>", $CONTENT);
380 else
381 $CONTENT = str_replace("[$match]", "<a class=\"pending\" href=\"./?page=".$match."\">$match</a>", $CONTENT);
382 $CONTENT = preg_replace('#(\[\?(.+)\]*)#i', '<a href="http://fr.wikipedia.org/wiki/$0" class="url">$0</a>', $CONTENT);
383 $CONTENT = preg_replace('#([0-9a-zA-Z\./~\-_]+@[0-9a-z\./~\-_]+)#i', '<a href="mailto:$0">$0</a>', $CONTENT);
384 $CONTENT = preg_replace('/^\*\*\*(.*)(\n)/Um', "<ul><ul><ul><li>$1</li></ul></ul></ul>$2", $CONTENT);
385 $CONTENT = preg_replace('/^\*\*(.*)(\n)/Um', "<ul><ul><li>$1</li></ul></ul>$2", $CONTENT);
386 $CONTENT = preg_replace('/^\*(.*)(\n)/Um', "<ul><li>$1</li></ul>$2", $CONTENT);
387 $CONTENT = preg_replace('/^\#\#\#(.*)(\n)/Um', "<ol><ol><ol><li>$1</li></ol></ol></ol>$2", $CONTENT);
388 $CONTENT = preg_replace('/^\#\#(.*)(\n)/Um', "<ol><ol><li>$1</li></ol></ol>$2", $CONTENT);
389 $CONTENT = preg_replace('/^\#(.*)(\n)/Um', "<ol><li>$1</li></ol>$2", $CONTENT);
390
391 $CONTENT = preg_replace('/(<\/ol>\n*<ol>|<\/ul>\n*<ul>)/', "", $CONTENT);
392 $CONTENT = preg_replace('/(<\/ol>\n*<ol>|<\/ul>\n*<ul>)/', "", $CONTENT);
393 $CONTENT = preg_replace('/(<\/ol>\n*<ol>|<\/ul>\n*<ul>)/', "", $CONTENT);
394
395
396 $CONTENT = preg_replace('/^!!!(.*)(\n)/Um', '<h1>$1</h1>$2', $CONTENT);
397 $CONTENT = preg_replace('/^!!(.*)(\n)/Um', '<h2>$1</h2>$2', $CONTENT);
398 $CONTENT = preg_replace('/^!(.*)(\n)/Um', '<h3>$1</h3>$2', $CONTENT);
399 while (preg_match('/^ /Um', $CONTENT))
400 $CONTENT = preg_replace('/^( +) ([^ ])/Um', '$1 $2', $CONTENT);
401 $CONTENT = preg_replace('/^ /Um', ' ', $CONTENT);
402 $CONTENT = preg_replace('/----*(\r\n|\r|\n)/m', '<hr />', $CONTENT);
403 $CONTENT = preg_replace('/\n/', '<br />', $CONTENT);
404 $CONTENT = preg_replace('#</ul>(<br />)*#', "</ul>", $CONTENT);
405 $CONTENT = preg_replace('#</ol>(<br />)*#', "</ol>", $CONTENT);
406
407 $CONTENT = preg_replace('#</li><ul><li>*#', "<ul><li>", $CONTENT);
408 $CONTENT = preg_replace('#</ul></ul>*#', "</ul></li></ul>", $CONTENT);
409 $CONTENT = preg_replace('#</ul></ul>*#', "</ul></li></ul>", $CONTENT);
410 $CONTENT = preg_replace('#</li></ul><li>*#', "</li></ul></li><li>", $CONTENT);
411
412 $CONTENT = preg_replace('#</li><ol><li>*#', "<ol><li>", $CONTENT);
413 $CONTENT = preg_replace('#</ol></ol>*#', "</ol></li></ol>", $CONTENT);
414 $CONTENT = preg_replace('#</ol></ol>*#', "</ol></li></ol>", $CONTENT);
415 $CONTENT = preg_replace('#</li></ol><li>*#', "</li></ol></li><li>", $CONTENT);
416
417 $CONTENT = preg_replace('#(</h[123]>)<br />#', "$1", $CONTENT);
418 $CONTENT = preg_replace("/{(.+)}/Ue", "'<pre><code>' . preg_replace('#<br />#', '', '\\1') . '</code></pre>'", $CONTENT);
419 $CONTENT = preg_replace("/'''''(.*)'''''/Um", '<strong><em>$1</em></strong>', $CONTENT);
420 $CONTENT = preg_replace("/'''(.*)'''/Um", '<strong>$1</strong>', $CONTENT);
421 $CONTENT = preg_replace("/''(.*)''/Um", '<em>$1</em>', $CONTENT);
422 // JJL chaine barree/soulignée
423 $CONTENT = preg_replace("/'--(.*)--'/Um", '<strike>$1</strike>', $CONTENT);
424 $CONTENT = preg_replace("/'__(.*)__'/Um", '<u>$1</u>', $CONTENT);
425 $CONTENT = substr($CONTENT, 6, strlen($CONTENT) - 6);
426 $CONTENT = html_entity_decode($CONTENT);
427 }
428 }
429 if ($action != "" && $action != "edit" || (!file_exists($PAGES_DIR . $PAGE_TITLE . ".txt")))
430 $TIME = "-";
431 $html = preg_replace("/{CONTENT}/", $CONTENT, $html);
432 $html = preg_replace("/{LANG}/", $LANG, $html);
433 $html = preg_replace("/{WIKI_VERSION}/", $WIKI_VERSION, $html);
434 $html = preg_replace("/{CHARSET}/", $CHARSET, $html);
435 $html = preg_replace('/{TIME}/', $TIME, $html);
436 $html = preg_replace('/{DATE}/', $datetw, $html);
437 $html = preg_replace('/{IP}/', $_SERVER['REMOTE_ADDR'], $html);
438 if ($_COOKIE['AutorisationTigerWiki'] != "")
439 $html = preg_replace('/{COOKIE}/', '-- <a href="./?page='.$PAGE_TITLE.'&erasecookie=1">'.$ERASE_COOKIE.'</a>', $html);
440 else
441 $html = preg_replace('/{COOKIE}/', '', $html);
442
443 // Affichage de la page
444 echo $html;
445
446 ?>
447
448