Commit fd641644 authored by Dries's avatar Dries

Surprise, surprise. After nothing but code, a large batch of changes:

 - removed droplets
 - added (optional) admin_blocks module
 - added (optional) affiliate module
 - added (optional) about module (only placeholder, under construction)
 - fixed some tiny bugs (e.g. quote bug in search.php)
 - partionally rewrote some modules to be big, bad and better
 - partionally rewrote some modules to be more uniform
 - added GNU GPL license to CVS

Also:
 - installed PHP 4.0.4 on my localhost and now working
   towards PHP 4.0.4 compatibility.
 - I think I'll baptize the engine "drupal".  If you have a
   better idea, try convincing me ASAP.

Todo:
 - more testing (also with PHP 4.0.4)
 - make "project"-module: download, info, blah blah
 - complete documentation
parent 10381949
This diff is collapsed.
......@@ -20,8 +20,8 @@ function module($name, $module) {
<HEAD><TITLE><? echo $site_name; ?> administration center</TITLE></HEAD>
<STYLE>
body { font-family: helvetica, arial; }
h1 { font-size: 14pt; font-weight: bold; color: #990000; }
h2 { font-family: helvetica, arial; font-size: 12pt; font-weight: bold; }
h1 { font-size: 18pt; font-weight: bold; color: #990000; }
h2 { font-family: helvetica, arial; font-size: 18pt; font-weight: bold; }
h3 { font-family: helvetica, arial; font-size: 14pt; font-weight: bold; }
th { font-family: helvetica, arial; text-align: center; background-color: #CCCCCC; color: #995555; }
td { font-family: helvetica, arial; }
......@@ -29,7 +29,8 @@ function module($name, $module) {
<BODY BGCOLOR="#FFFFFF" LINK="#005599" VLINK="#004499" ALINK="#FF0000">
<H1>Administration center</H1>
<?
ksort($repository);
module_iterate("module");
?>
......@@ -39,8 +40,8 @@ function module($name, $module) {
module_execute($mod, "admin");
?>
</BODY>
</HTML>
</BODY>
</HTML>
<?
}
......
......@@ -8,4 +8,5 @@ function export($name, $module) {
}
module_iterate("export");
?>
\ No newline at end of file
......@@ -4,7 +4,6 @@
include_once "includes/database.inc";
include_once "includes/watchdog.inc";
include_once "includes/function.inc";
include_once "includes/droplet.inc";
include_once "includes/module.inc";
include_once "includes/theme.inc";
include_once "includes/user.inc";
......
<?
function droplet_get($name) {
$result = db_query("SELECT * FROM droplets WHERE name = '$name'");
if ($droplet = db_fetch_object($result)) {
return eval($droplet->code);
}
else {
watchdog("error", "droplet '$name' does not exist");
}
}
function droplet_add($name, $help, $code, $message = "") {
$result = db_query("INSERT INTO droplets (name, help, code) VALUES ('". check_input($name) ."', '". check_input($help) ."', '". check_code($code) ."')");
}
function droplet_delete($id) {
$result = db_query("DELETE FROM droplets WHERE id = $id");
}
?>
......@@ -45,7 +45,7 @@ function submission_number() {
function theme_main_blocks($theme) {
global $PHP_SELF, $user, $id;
global $id, $PHP_SELF, $user;
switch (strtok($PHP_SELF, ".")) {
case "/discussion":
......@@ -53,6 +53,14 @@ function theme_main_blocks($theme) {
if ($story->status == 1) theme_moderation_results($theme, $story);
else theme_new_headlines($theme);
break;
case "/index":
theme_account($theme);
$result = db_query("SELECT * FROM blocks WHERE status = 2");
while ($block = db_fetch_object($result)) {
$blocks = module_execute($block->module, "block");
$theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]);
}
break;
default:
theme_account($theme);
}
......@@ -63,8 +71,8 @@ function theme_user_blocks($theme) {
if ($user->id && strstr($PHP_SELF, "index.php")) {
$result = db_query("SELECT * FROM layout l LEFT JOIN blocks b ON l.block = b.name WHERE l.user = '$user->id' AND l.weight > 0 AND b.status = '1' ORDER BY weight");
while ($block = db_fetch_object($result)) {
$blocks = module_execute($block->module, "block");
$theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]);
$blocks = module_execute($block->module, "block");
$theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]);
}
}
}
......
<?
$module = array("admin" => "about_admin");
function about_admin() {
print "under construction";
}
?>
\ No newline at end of file
......@@ -17,7 +17,7 @@ function account_display($order = "username") {
$result = db_query("SELECT u.id, u.userid, u.". strtok($sort[$order], " ") .", u.url FROM users u ORDER BY $sort[$order]");
// Generate output:
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR>\n";
$output .= " <TH ALIGN=\"right\" COLSPAN=\"". (sizeof($show) + 2) ."\">\n";
$output .= " <FORM ACTION=\"admin.php?mod=account\" METHOD=\"post\">\n";
......
<?
$module = array("block" => "ab_block",
"admin" => "ab_admin");
function ab_block() {
$result = db_query("SELECT * FROM admin_blocks");
$i = 0;
while ($block = db_fetch_object($result)) {
$blocks[$i]["subject"] = check_output($block->subject);
$blocks[$i]["content"] = check_output(eval($block->content));
$blocks[$i]["info"] = check_output($block->info);
$blocks[$i]["link"] = check_output($block->link);
$i++;
}
return $blocks;
}
function ab_admin_display() {
$result = db_query("SELECT * FROM admin_blocks");
while ($block = db_fetch_object($result)) {
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= " <TR><TH>Subject:</TH><TD>". check_output($block->subject) ."</TD></TR>\n";
$output .= " <TR><TH>Content:</TH><TD>". nl2br(htmlentities($block->content)) ."</TD></TR>\n";
$output .= " <TR><TH>Information:</TH><TD><I>". check_output($block->info) ."</I></TD></TR>\n";
$output .= " <TR><TH>Link:</TH><TD>". format_url($block->link) ."</TD></TR>\n";
$output .= " <TR><TH>Operations:</TH><TD><A HREF=\"admin.php?mod=admin-block&op=edit&id=$block->id\">edit</A>, <A HREF=\"admin.php?mod=admin-block&op=delete&id=$block->id\">delete</A></TD></TR>\n";
$output .= "</TABLE>\n";
$output .= "<BR><BR>\n";
}
$output .= "<FORM ACTION=\"admin.php?mod=admin-block\" METHOD=\"post\">\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= " <TR><TH>Subject:</TH><TD><INPUT TYPE=\"text\" NAME=\"subject\" SIZE=\"35\"></TD></TR>\n";
$output .= " <TR><TH>Content:</TH><TD><TEXTAREA NAME=\"content\" COLS=\"50\" ROWS=\"5\"></TEXTAREA></TD></TR>\n";
$output .= " <TR><TH>Information:</TH><TD><INPUT TYPE=\"text\" NAME=\"info\" SIZE=\"35\"></TD></TR>\n";
$output .= " <TR><TH>Link:</TH><TD><INPUT TYPE=\"text\" NAME=\"link\" SIZE=\"35\"></TD></TR>\n";
$output .= " <TR><TH>Operations:</TH><TD><INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Add admin block\"></TD></TR>\n";
$output .= "</TABLE>\n";
$output .= "</FORM>\n";
print $output;
}
function ab_admin_add($subject, $content, $info, $link) {
db_query("INSERT INTO admin_blocks (subject, content, info, link) VALUES ('". check_input($subject) ."', '". check_code($content) ."', '". check_input($info) ."', '". check_input($link) ."')");
}
function ab_admin_delete($id) {
db_query("DELETE FROM admin_blocks WHERE id = $id");
}
function ab_admin_rehash() {
global $repository;
module_rehash_blocks("admin-block", $repository["admin-block"]);
}
function ab_admin_edit($id) {
$result = db_query("SELECT * FROM admin_blocks WHERE id = $id");
if ($block = db_fetch_object($result)) {
$output .= "<FORM ACTION=\"admin.php?mod=admin-block\" METHOD=\"post\">\n";
$output .= "<P>\n";
$output .= " <B>Subject:</B><BR>\n";
$output .= " <INPUT TYPE=\"text\" NAME=\"subject\" VALUE=\"". check_field($block->subject) ."\">\n";
$output .= "</P>\n";
$output .= "<P>\n";
$output .= "<B>Content:</B><BR>\n";
$output .= "<TEXTAREA NAME=\"content\" COLS=\"50\" ROWS=\"5\">$block->content</TEXTAREA>\n";
$output .= "</P>\n";
$output .= "<B>Information:</B><BR>\n";
$output .= "<INPUT TYPE=\"text\" NAME=\"info\" VALUE=\"$block->info\">\n";
$output .= "</P>\n";
$output .= "<P>\n";
$output .= "<B>Link:</B><BR>\n";
$output .= "<INPUT TYPE=\"text\" NAME=\"link\" VALUE=\"$block->link\">\n";
$output .= "</P>\n";
$output .= "<P>\n";
$output .= "<INPUT TYPE=\"hidden\" NAME=\"id\" VALUE=\"$id\">\n";
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save admin block\"><BR>\n";
$output .= "</P>\n";
$output .= "</FORM>\n";
}
print $output;
}
function ab_admin_save($id, $subject, $content, $info, $link) {
db_query("UPDATE admin_blocks SET subject = '". check_input($subject) ."', content = '". check_code($content) ."', info = '". check_input($info) ."', link = '". check_input($link) ."' WHERE id = '$id'");
watchdog("message", "modified admin block `$subject'");
}
function ab_admin() {
global $op, $id, $subject, $content, $info, $link;
switch ($op) {
case "Add admin block":
ab_admin_add($subject, $content, $info, $link);
ab_admin_display();
ab_admin_rehash();
break;
case "Save admin block":
ab_admin_save($id, $subject, $content, $info, $link);
ab_admin_display();
ab_admin_rehash();
break;
case "edit":
ab_admin_edit($id);
break;
case "delete":
ab_admin_delete($id);
ab_admin_rehash();
// fall through
default:
ab_admin_display();
}
}
?>
\ No newline at end of file
<?
$module = array("block" => "affiliate_block",
"admin" => "affiliate_admin");
function affiliate_block() {
global $site_url;
$result = db_query("SELECT * FROM affiliates ORDER BY name");
$content .= "<SCRIPT>\n";
$content .= " <!--//\n";
$content .= " function gotosite(site) {\n";
$content .= " if (site != \"\") {\n";
$content .= " parent.location = site\n";
$content .= " }\n";
$content .= " }\n";
$content .= " //-->\n";
$content .= "</SCRIPT>\n";
$content .= "<FORM ACTION=\"\" METHOD=\"post\">\n";
$content .= " <SELECT NAME=\"affiliate\" ONCHANGE=\"gotosite(this.options[this.selectedIndex].value)\">\n";
$content .= " <OPTION VALUE=\"$site_url\">select a site</OPTION>\n";
while ($affiliate = db_fetch_object($result)) {
$content .= " <OPTION VALUE=\"$affiliate->link\">$affiliate->name</OPTION>\n";
}
$content .= " </SELECT>\n";
$content .= "</FORM>\n";
$blocks[0]["subject"] = "Affiliates";
$blocks[0]["content"] = $content;
$blocks[0]["info"] = "Affiliates (selection)";
unset($content);
$result = db_query("SELECT * FROM affiliates ORDER BY name");
while ($affiliate = db_fetch_object($result)) {
$content .= "<LI><A HREF=\"$affiliate->link\">$affiliate->name</A></LI>\n";
}
$blocks[1]["subject"] = "Affiliates";
$blocks[1]["content"] = $content;
$blocks[1]["info"] = "Affiliates (sequential)";
return $blocks;
}
function affiliate_admin_add($name, $link, $contact) {
db_query("INSERT INTO affiliates (name, link, contact) VALUES ('". check_input($name) ."', '". check_input($link) ."', '". check_input($contact) ."')");
}
function affiliate_admin_del($id) {
db_query("DELETE FROM affiliates WHERE id = '$id'");
}
function affiliate_admin_display() {
$result = db_query("SELECT * FROM affiliates ORDER BY name");
$output .= "<FORM ACTION=\"admin.php?mod=affiliate\" METHOD=\"post\">\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>name</TH><TH>link</TH><TH>contact</TH><TH>operations</TH></TR>\n";
while ($affiliate = db_fetch_object($result)) {
$output .= " <TR><TD>$affiliate->name</TD><TD>". format_url($affiliate->link) ."</TD><TD>". format_email($affiliate->contact) ."</TD><TD ALIGN=\"center\"><A HREF=\"admin.php?mod=affiliate&op=delete&id=$affiliate->id\">delete</A></TD></TR>\n";
}
$output .= " <TR><TD><INPUT TYPE=\"text\" NAME=\"name\"></TD><TD><INPUT TYPE=\"text\" NAME=\"link\"></TD><TD><INPUT TYPE=\"text\" NAME=\"contact\"></TD><TD><INPUT NAME=\"op\" TYPE=\"submit\" VALUE=\"Add affiliate\"></TD></TR>\n";
$output .= "</TABLE>\n";
$output .= "</FORM>\n";
print $output;
}
function affiliate_admin() {
global $op, $id, $name, $link, $contact;
switch($op) {
case "Add affiliate":
affiliate_admin_add($name, $link, $contact);
affiliate_admin_display();
break;
case "delete":
affiliate_admin_del($id);
affiliate_admin_display();
break;
default:
affiliate_admin_display();
}
}
?>
\ No newline at end of file
......@@ -26,7 +26,7 @@ function ban_display($category = "") {
$result = db_query("SELECT * FROM bans WHERE type = $category ORDER BY mask");
// Generate output:
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR>\n";
$output .= " <TH COLSPAN=\"3\">\n";
$output .= " <FORM ACTION=\"admin.php?mod=ban\" METHOD=\"post\">\n";
......
......@@ -43,7 +43,8 @@ function block_admin_display() {
$module = ($repository[$block->module]["admin"]) ? "<A HREF=\"admin.php?mod=$block->module\">$block->module</A>" : $block->module;
$status .= "<SELECT NAME=\"edit[$block->name]\">\n";
$status .= " <OPTION VALUE=\"1\"". (($block->status == 1) ? " SELECTED" : "") .">enabled</OPTION>\n";
$status .= " <OPTION VALUE=\"2\"". (($block->status == 2) ? " SELECTED" : "") .">enabled: always</OPTION>\n";
$status .= " <OPTION VALUE=\"1\"". (($block->status == 1) ? " SELECTED" : "") .">enabled: custom</OPTION>\n";
$status .= " <OPTION VALUE=\"0\"". (($block->status == 0) ? " SELECTED" : "") .">disabled</OPTION>\n";
$status .= "</SELECT>\n";
......
......@@ -43,7 +43,8 @@ function block_admin_display() {
$module = ($repository[$block->module]["admin"]) ? "<A HREF=\"admin.php?mod=$block->module\">$block->module</A>" : $block->module;
$status .= "<SELECT NAME=\"edit[$block->name]\">\n";
$status .= " <OPTION VALUE=\"1\"". (($block->status == 1) ? " SELECTED" : "") .">enabled</OPTION>\n";
$status .= " <OPTION VALUE=\"2\"". (($block->status == 2) ? " SELECTED" : "") .">enabled: always</OPTION>\n";
$status .= " <OPTION VALUE=\"1\"". (($block->status == 1) ? " SELECTED" : "") .">enabled: custom</OPTION>\n";
$status .= " <OPTION VALUE=\"0\"". (($block->status == 0) ? " SELECTED" : "") .">disabled</OPTION>\n";
$status .= "</SELECT>\n";
......
......@@ -45,9 +45,9 @@ function comment_display($order = "date") {
$result = db_query("SELECT c.*, u.userid FROM comments c LEFT JOIN users u ON u.id = c.author ORDER BY c.$fields[$order] LIMIT 50");
// Display comments:
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR>\n";
$output .= " <TH ALIGN=\"right\" COLSPAN=\"5\">\n";
$output .= " <TH ALIGN=\"right\" COLSPAN=\"3\">\n";
$output .= " <FORM ACTION=\"admin.php?mod=comment\" METHOD=\"post\">\n";
$output .= " <SELECT NAME=\"order\">\n";
foreach ($fields as $key=>$value) {
......
......@@ -45,9 +45,9 @@ function comment_display($order = "date") {
$result = db_query("SELECT c.*, u.userid FROM comments c LEFT JOIN users u ON u.id = c.author ORDER BY c.$fields[$order] LIMIT 50");
// Display comments:
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR>\n";
$output .= " <TH ALIGN=\"right\" COLSPAN=\"5\">\n";
$output .= " <TH ALIGN=\"right\" COLSPAN=\"3\">\n";
$output .= " <FORM ACTION=\"admin.php?mod=comment\" METHOD=\"post\">\n";
$output .= " <SELECT NAME=\"order\">\n";
foreach ($fields as $key=>$value) {
......
......@@ -249,9 +249,9 @@ function diary_admin_display($order = "date") {
$result = db_query("SELECT d.*, u.userid FROM diaries d LEFT JOIN users u ON u.id = d.author ORDER BY d.$fields[$order] LIMIT 50");
// Display stories:
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR>\n";
$output .= " <TH ALIGN=\"right\" COLSPAN=\"5\">\n";
$output .= " <TH ALIGN=\"right\" COLSPAN=\"3\">\n";
$output .= " <FORM ACTION=\"admin.php?mod=diary\" METHOD=\"post\">\n";
$output .= " <SELECT NAME=\"order\">\n";
foreach ($fields as $key=>$value) {
......
<?
$module = array("page" => "documentation_page");
$module = array("page" => "documentation",
"admin" => "documentation");
function documentation_page() {
function documentation() {
?>
<H1>Documentation</H1>
<SMALL><I>$Id$</I></SMALL>
<H2>Chapter 1: installation guide</H2>
......
<?
$module = array("admin" => "droplet_admin");
include_once "includes/droplet.inc";
function droplet_display() {
$result = db_query("SELECT * FROM droplets");
### Generate output:
while ($block = db_fetch_object($result)) {
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\">Name:</TD><TD>". check_output($block->name) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\">Help:</TD><TD>". check_output($block->help) ."</TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\">Code:</TD><TD><CODE>". nl2br(htmlentities($block->code)) ."</CODE></TD></TR>\n";
$output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\">Operations:</TD><TD><A HREF=\"admin.php?mod=droplet&op=edit&id=$block->id\">edit</A>, <A HREF=\"admin.php?mod=droplet&op=delete&id=$block->id\">delete</A></TD></TR>\n";
$output .= "</TABLE>\n";
$output .= "<BR><BR>\n";
}
$output .= "<H3>Add new block:</H3>\n";
$output .= "<FORM ACTION=\"admin.php?mod=droplet\" METHOD=\"post\">\n";
$output .= "<B>Name:</B><BR>\n";
$output .= "<INPUT TYPE=\"text\" NAME=\"name\" SIZE=\"35\"><P>\n";
$output .= "<B>Help:</B><BR>\n";
$output .= "<TEXTAREA NAME=\"help\" COLS=\"50\" ROWS=\"5\"></TEXTAREA><P>\n";
$output .= "<B>Code:</B><BR>\n";
$output .= "<TEXTAREA NAME=\"code\" COLS=\"50\" ROWS=\"5\"></TEXTAREA><P>\n";
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Add block\"><BR>\n";
$output .= "</FORM>\n";
$output .= "<BR><HR>\n";
print $output;
}
function droplet_edit($id) {
$result = db_query("SELECT * FROM droplets WHERE id = $id");
if ($block = db_fetch_object($result)) {
$output .= "<FORM ACTION=\"admin.php?mod=droplet\" METHOD=\"post\">\n";
$output .= "<B>Name:</B><BR>\n";
$output .= "<INPUT TYPE=\"text\" NAME=\"name\" VALUE=\"". check_field($block->name) ."\" SIZE=\"35\"><P>\n";
$output .= "<B>Help:</B><BR>\n";
$output .= "<TEXTAREA NAME=\"help\" COLS=\"50\" ROWS=\"5\">$block->help</TEXTAREA><P>\n";
$output .= "<B>Code:</B><BR>\n";
$output .= "<TEXTAREA NAME=\"code\" COLS=\"50\" ROWS=\"5\">$block->code</TEXTAREA><P>\n";
$output .= "<INPUT TYPE=\"hidden\" NAME=\"id\" VALUE=\"$id\">\n";
$output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save block\"><BR>\n";
$output .= "</FORM>\n";
$output .= "<BR><HR>\n";
}
print $output;
}
function droplet_save($id, $name, $help, $code) {
db_query("UPDATE droplets SET name = '". check_input($name) ."', help = '". check_input($help) ."', code = '". check_code($code) ."' WHERE id = $id");
watchdog("message", "modified block `$name'.");
}
function droplet_admin() {
global $op, $id, $name, $help, $code;
switch ($op) {
case "Add block":
droplet_add($name, $help, $code);
droplet_display();
break;
case "Save block":
droplet_save($id, $name, $help, $code);
droplet_display();
break;
case "edit":
droplet_edit($id);
break;
case "delete":
droplet_delete($id);
// fall through
default:
droplet_display();
}
}
?>
\ No newline at end of file
......@@ -69,12 +69,14 @@ function headline_block() {
$result = db_query("SELECT * FROM channel");
while ($channel = db_fetch_object($result)) {
$backend = new Backend($channel->id);
$content = "";
for (reset($backend->headline); $headline = current($backend->headline); next($backend->headline)) {
$content .= "<LI>$headline</LI>\n";
if ($backend->headline) {
for (reset($backend->headline); $headline = current($backend->headline); next($backend->headline)) {
$content .= "<LI>$headline</LI>\n";
}
}
$blocks[$channel->id]["subject"] = $backend->site;
$blocks[$channel->id]["content"] = $content;
$blocks[$channel->id]["info"] = "$backend->site headline";
......@@ -142,7 +144,6 @@ function headline_admin() {
break;
case "delete":
$backend = new backend($id);
$backend->dump();
$backend->delete();
headline_admin_main();
break;
......@@ -160,6 +161,8 @@ function headline_export($uri) {
if ($uri[2] == "headlines.rdf") {
watchdog("message", "grabbed 'headlines.rdf'");
header("Content-Type: text/plain");
print "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
......
......@@ -98,7 +98,7 @@ function story_display($order = "date") {
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON u.id = s.author ORDER BY s.$fields[$order]");
### Display stories:
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR>\n";
$output .= " <TH ALIGN=\"right\" COLSPAN=\"5\">\n";
$output .= " <FORM ACTION=\"admin.php?mod=story\" METHOD=\"post\">\n";
......
......@@ -98,7 +98,7 @@ function story_display($order = "date") {
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON u.id = s.author ORDER BY s.$fields[$order]");
### Display stories:
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR>\n";
$output .= " <TH ALIGN=\"right\" COLSPAN=\"5\">\n";
$output .= " <FORM ACTION=\"admin.php?mod=story\" METHOD=\"post\">\n";
......
......@@ -15,7 +15,7 @@ function watchdog_display($order = "date") {
$result = db_query("SELECT l.*, u.userid FROM watchdog l LEFT JOIN users u ON l.user = u.id ORDER BY l.$fields[$order]");
### Generate output:
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR>\n";
$output .= " <TH ALIGN=\"right\" COLSPAN=\"4\">\n";
$output .= " <FORM ACTION=\"admin.php?mod=watchdog\" METHOD=\"post\">\n";
......
......@@ -15,7 +15,7 @@ function watchdog_display($order = "date") {
$result = db_query("SELECT l.*, u.userid FROM watchdog l LEFT JOIN users u ON l.user = u.id ORDER BY l.$fields[$order]");
### Generate output:
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n";
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR>\n";
$output .= " <TH ALIGN=\"right\" COLSPAN=\"4\">\n";
$output .= " <FORM ACTION=\"admin.php?mod=watchdog\" METHOD=\"post\">\n";
......
......@@ -26,7 +26,6 @@ function wishlist_page() {
<H3>Engine</H3>
<UL>
<LI>blocks and flexible block placement strategies by means of "layout managers" (cfr. Java) and tightly integrated with the module support</LI>
<LI>post/edit hash - magic cookie: to prevent malicious external access and to prevent duplicate posts because of hitting the "reload" button</LI>
<LI>URL validator</LI>
<LI>more adaptive submission queue</LI>
......@@ -42,7 +41,6 @@ function wishlist_page() {
<H3>Modules</H3>
<UL>
<LI>RDF/XML/RSS syndication import/export</LI>
<LI>messaging between administrators/users</LI>
<LI>links/bookmarks manager</LI>
<LI>public userlist</LI>
......@@ -52,7 +50,9 @@ function wishlist_page() {
<LI>daily/weekly e-mail digest - mailing list</LI>
<LI>daily/weekly site rapports - mailing list</LI>
<LI>featured stories - story index grouped by category</LI>
<LI>e-commerce/shop extension</LI>
<LI>e-commerce/shop extension</LI>
<LI>automatically post scheduled stories</LI>
<LI>review system</LI>
</UL>
<H3>Public release</H3>
......
......@@ -51,7 +51,7 @@
while ($entry = db_fetch_object($result)) {
$num++;
$output .= "<P>$num) <B><A HREF=\"discussion.php?id=$entry->id\">$entry->subject</A></B> (". format_plural($entry->comments, "comment", comments) .")<BR><SMALL>by ". format_username($entry->userid) ."</B>, posted on ". format_date($entry->timestamp) .".</SMALL></P>\n";
$output .= "<P>$num) <B><A HREF=\"discussion.php?id=$entry->id\">". check_output($entry->subject) ."</A></B> (". format_plural($entry->comments, "comment", comments) .")<BR><SMALL>by ". format_username($entry->userid) ."</B>, posted on ". format_date($entry->timestamp) .".</SMALL></P>\n";
}
if ($num == 0) $output .= "<P>Your search did <B>not</B> match any articles in our database: <UL><LI>Try using fewer words.</LI><LI>Try using more general keywords.</LI><LI>Try using different keywords.</LI></UL></P>\n";
......
......@@ -4,7 +4,9 @@ function submit_enter() {
global $anonymous, $categories, $allowed_html, $theme, $user;
### Guidlines:
$output .= droplet_get("submit_information");
$output .= "<P>Got some news or some thoughts you would like to share? Fill out this form and they will automatically get whisked away to our submission queue where our moderators will frown at it, poke at it and hopefully post it. Every registered user is automatically a moderator and can vote whether or not your sumbission should be carried to the front page for discussion.</P>\n";
$output .= "<P>Note that we do not revamp or extend your submission so it is up to you to make sure your submission is well-written: if you don't care enough to be clear and complete, your submission is likely to be moderated down by our army of moderators. Try to be complete, aim for clarity, organize and structure your text, and try to carry out your statements with examples. It is also encouraged to extend your submission with arguments that flow from your unique intellectual capability and experience: offer some insight or explanation as to why you think your submission is interesting. Make sure your submission has some meat on it!</P>\n";
$output .= "<P>However, if you have bugs to report, complaints, personal questions or anything besides a public submission, we would prefer you to mail us instead, or your message is likely to get lost.</P><BR>\n";
### Submission form:
$output .= "<FORM ACTION=\"submit.php\" METHOD=\"post\">\n";
......@@ -135,7 +137,7 @@ function submit_submit($subject, $abstract, $article, $category) {
### Display confirmation message:
$theme->header();
$theme->box("Thank you for your submission.", droplet_get("submit_confirmation"));
$theme->box("Thank you for your submission.", "Thank you for your submission. Your submission has been whisked away to our submission queue where our registered users will frown at it, poke at it and hopefully carry it to the front page for discussion.");
$theme->footer();
}
......
......@@ -16,7 +16,7 @@ class Theme {
var $fgcolor3 = "yellow";
var $hlcolor3 = "yellow";
function header($title) {
function header() {
global $site_name;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
......
......@@ -24,7 +24,7 @@ class Theme {
var $fgcolor3 = "#000000";
var $hlcolor3 = "yellow";
function header($title) {
function header() {
global $site_name;
srand((double)microtime()*1000000);
?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment