You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.5 KiB
41 lines
1.5 KiB
<?php // minipage administration
|
|
|
|
require("../db.php3");
|
|
|
|
// connect to the db and generate a list of minipages
|
|
$connection = connect($host, $dbname);
|
|
if($connection) {
|
|
$query = "select id,content,title,changed from page order by id";
|
|
$result = query($connection, $query);
|
|
$count = numrows($result);
|
|
// stuff the db query into an html comment
|
|
print("<!--\n query = $query\n-->\n");
|
|
// display our intro and motd files
|
|
include("intro.php3");
|
|
if(is_readable("motd.php3")) include("motd.php3");
|
|
// begin a table of links
|
|
print("<div class=center>\n<table border=1 cellspacing=0 cellpadding=5>\n");
|
|
print("<tr class=header>\n <th>Content</th>\n <th>Page Title</th>");
|
|
print("<th>Last Changed</th></tr>\n");
|
|
if($count) { // if we returned a list of pages...
|
|
for($row=0; $row < $count; $row++) {
|
|
$shade = (($row & 1) ? "dark" : "light");
|
|
$page = fetch_object($result, $row);
|
|
print("<tr class=$shade>\n ");
|
|
print("<td class=right><a href=\"page_edit.php3?pid=$page->id\">");
|
|
print("$page->content</a></td>\n ");
|
|
$title = (($page->title) ? $page->title : "   ");
|
|
print("<td class=left>$title</td>\n");
|
|
print("<td class=center>$page->changed</td></tr>\n");
|
|
}
|
|
} else {
|
|
print("<td colspan=2>No pages are available</td>\n");
|
|
}
|
|
print("</table>\n<br clear=all>\n<div class=\"footer\">\n<hr>\n");
|
|
require("../footer.php3");
|
|
print("</body>\n</html>");
|
|
} else {
|
|
print("<div class=center>\n<h2>Database Error</h2>\n");
|
|
print("<h2>Failed to connect to database: $dbname</h2>\n");
|
|
}
|
|
?>
|