1 <!-- $Id: wiki_pageinfo.php3,v 1.3 2000-06-26 20:10:05 ahollosi Exp $ -->
2 <!-- Display the internal structure of a page. Steve Wainstead, June 2000 -->
4 $encname = htmlspecialchars($info);
5 $html = "<form action=\"$ScriptUrl\" METHOD=GET>\n" .
6 "<input name=\"info\" value=\"$encname\">" .
7 " Enter a page name\n" .
8 "<input type=submit value=Go><br>\n" .
9 "<input type=checkbox name=showpagesource";
11 if ($showpagesource == "on") {
14 $html .= "> Show the page source and references\n</form>\n";
16 // don't bother unless we were asked
18 GeneratePage('MESSAGE', $html, "PageInfo", 0);
22 function ViewpageProps($name)
24 global $dbi, $showpagesource, $datetimeformat;
26 $pagehash = RetrievePage($dbi, $name);
27 if ($pagehash == -1) {
28 $table = "Page name '$name' is not in the database<br>\n";
31 $table = "<table border=1 bgcolor=white>\n";
33 while (list($key, $val) = each($pagehash)) {
34 if ($key > 0 || !$key) #key is an array index
36 if ((gettype($val) == "array") && ($showpagesource == "on")) {
37 $val = implode($val, "$FieldSeparator#BR#$FieldSeparator\n");
38 $val = htmlspecialchars($val);
39 $val = str_replace("$FieldSeparator#BR#$FieldSeparator", "<br>", $val);
41 elseif (($key == 'lastmodified') || ($key == 'created'))
42 $val = date($datetimeformat, $val);
44 $val = htmlspecialchars($val);
46 $table .= "<tr><td>$key</td><td>$val</td></tr>\n";
54 $html .= "<P><B>Current version</B></p>";
55 // $dbi = OpenDataBase($WikiDataBase); --- done by index.php3
56 $html .= ViewPageProps($info);
58 $html .= "<P><B>Archived version</B></p>";
59 $dbi = OpenDataBase($ArchiveDataBase);
60 $html .= ViewPageProps($info);
62 GeneratePage('MESSAGE', $html, "PageInfo: '$info'", 0);