1 <!-- $Id: pageinfo.php,v 1.5.4.2 2005-01-07 13:59:58 rurban 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 $enter = gettext ("Enter a page name");
11 $html = "<form action=\"$ScriptUrl\" METHOD=GET>\n" .
12 "<input name=\"info\" value=\"$encname\">" .
14 "<input type=submit value=$go><br>\n" .
15 "<input type=checkbox name=showpagesource";
17 if (isset($showpagesource) && ($showpagesource == "on")) {
21 $html .= gettext ("Show the page source and references");
22 $html .= "\n</form>\n";
24 // don't bother unless we were asked
26 GeneratePage('MESSAGE', $html, gettext("PageInfo"), 0);
30 function ViewpageProps($name, $pagestore)
32 global $dbi, $showpagesource, $datetimeformat, $FieldSeparator;
34 $pagehash = RetrievePage($dbi, $name, $pagestore);
35 if ($pagehash == -1) {
36 $table = sprintf (gettext ("Page name '%s' is not in the database"),
40 $table = "<table border=1 bgcolor=white>\n";
42 while (list($key, $val) = each($pagehash)) {
43 if ($key > 0 || !$key) #key is an array index
45 if ((gettype($val) == "array") && ($showpagesource == "on")) {
46 $val = implode($val, "$FieldSeparator#BR#$FieldSeparator\n");
47 $val = htmlspecialchars($val);
48 $val = str_replace("$FieldSeparator#BR#$FieldSeparator", "<br>", $val);
50 elseif (($key == 'lastmodified') || ($key == 'created'))
51 $val = date($datetimeformat, $val);
52 elseif (gettype($val) != "array")
53 $val = htmlspecialchars($val);
55 $table .= "<tr><td>$key</td><td>$val</td></tr>\n";
64 $html .= gettext ("Current version");
66 // $dbi = OpenDataBase($WikiPageStore); --- done by index.php
67 $html .= ViewPageProps($info, $WikiPageStore);
70 $html .= gettext ("Archived version");
72 // $dbi = OpenDataBase($ArchivePageStore);
73 $html .= ViewPageProps($info, $ArchivePageStore);
75 GeneratePage('MESSAGE', $html, gettext("PageInfo").": '$info'", 0);