1 <!-- $Id: wiki_pageinfo.php3,v 1.4 2000-07-15 21:00:38 ahollosi Exp $ -->
2 <!-- Display the internal structure of a page. Steve Wainstead, June 2000 -->
4 if (get_magic_quotes_gpc()) {
5 $info = stripslashes($info);
8 $encname = htmlspecialchars($info);
9 $html = "<form action=\"$ScriptUrl\" METHOD=GET>\n" .
10 "<input name=\"info\" value=\"$encname\">" .
11 " Enter a page name\n" .
12 "<input type=submit value=Go><br>\n" .
13 "<input type=checkbox name=showpagesource";
15 if ($showpagesource == "on") {
18 $html .= "> Show the page source and references\n</form>\n";
20 // don't bother unless we were asked
22 GeneratePage('MESSAGE', $html, "PageInfo", 0);
26 function ViewpageProps($name)
28 global $dbi, $showpagesource, $datetimeformat;
30 $pagehash = RetrievePage($dbi, $name);
31 if ($pagehash == -1) {
32 $table = "Page name '$name' is not in the database<br>\n";
35 $table = "<table border=1 bgcolor=white>\n";
37 while (list($key, $val) = each($pagehash)) {
38 if ($key > 0 || !$key) #key is an array index
40 if ((gettype($val) == "array") && ($showpagesource == "on")) {
41 $val = implode($val, "$FieldSeparator#BR#$FieldSeparator\n");
42 $val = htmlspecialchars($val);
43 $val = str_replace("$FieldSeparator#BR#$FieldSeparator", "<br>", $val);
45 elseif (($key == 'lastmodified') || ($key == 'created'))
46 $val = date($datetimeformat, $val);
48 $val = htmlspecialchars($val);
50 $table .= "<tr><td>$key</td><td>$val</td></tr>\n";
58 $html .= "<P><B>Current version</B></p>";
59 // $dbi = OpenDataBase($WikiDataBase); --- done by index.php3
60 $html .= ViewPageProps($info);
62 $html .= "<P><B>Archived version</B></p>";
63 $dbi = OpenDataBase($ArchiveDataBase);
64 $html .= ViewPageProps($info);
66 GeneratePage('MESSAGE', $html, "PageInfo: '$info'", 0);