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
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 // Ward Cunningham has deprecated these, but I already
42 // implented them. You are discouraged from using them.
43 if (! empty($r1)) { $pagehash["r1"] = $r1; }
44 if (! empty($r2)) { $pagehash["r2"] = $r2; }
45 if (! empty($r3)) { $pagehash["r3"] = $r3; }
46 if (! empty($r4)) { $pagehash["r4"] = $r4; }
48 InsertPage($dbi, $pagename, $pagehash);
49 UpdateRecentChanges($dbi, $pagename);
50 WikiHeader("Thanks for $pagename Edits");
55 echo "<a href=\"$ScriptUrl?$pagename\">$pagename</a><br>\n";
58 Your careful attention to detail is much appreciated.<br>
59 <img src="<? echo "$SignatureImg"; ?>"><br>
60 p.s. Be sure to <em>Reload</em> your old pages.<br>
63 if ($WikiDataBase == "/tmp/wikidb") {
64 echo "<h2>Warning: the Wiki DBM file still lives in the ";
65 echo "/tmp directory. Please read the INSTALL file and move ";
66 echo "the DBM file to a permanent location or risk losing ";
67 echo "all the pages!</h2>\n";