4 All page saving events take place here. All page info is also
6 This is klugey. But it works. There's probably a slicker way of
10 $pagename = rawurldecode($post);
11 $pagehash = RetrievePage($dbi, $pagename);
13 // if this page doesn't exist yet, now's the time!
14 if (! is_array($pagehash)) {
16 $pagehash["version"] = 0;
18 // archive it if it's a new author
19 if ($pagehash["author"] != $remoteuser) {
20 SaveCopyToArchive($pagename, $pagehash);
24 $pagehash["date"] = GetCurrentDate();
25 $pagehash["version"]++;
26 $pagehash["author"] = $remoteuser;
29 // patch from Grant Morgan <grant@ryuuguu.com> for
31 if(get_magic_quotes_gpc()) { $text = stripslashes($text); }
33 $pagehash["text"] = explode("\n", $text);
35 // convert spaces to tabs at user request
37 $pagehash["text"] = CookSpaces($pagehash["text"]);
41 for ($i = 1; $i <= NUM_LINKS; $i++) {
42 if (! empty(${'r'.$i}))
43 $pagehash['r'.$i] = ${'r'.$i};
46 InsertPage($dbi, $pagename, $pagehash);
47 UpdateRecentChanges($dbi, $pagename);
48 echo WikiHeader("Thanks for $pagename Edits");
52 $enc_name = rawurlencode($pagename);
53 echo "<a href=\"$ScriptUrl?$enc_name\">$pagename</a><br>\n";
56 Your careful attention to detail is much appreciated.<br>
57 <img src="<? echo "$SignatureImg"; ?>"><br>
58 p.s. Be sure to <em>Reload</em> your old pages.<br>
61 if ($WikiDataBase == "/tmp/wikidb") {
62 echo "<h2>Warning: the Wiki DBM file still lives in the ";
63 echo "/tmp directory. Please read the INSTALL file and move ";
64 echo "the DBM file to a permanent location or risk losing ";
65 echo "all the pages!</h2>\n";