summaryrefslogtreecommitdiff
path: root/modules/structure.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-04-19 19:59:48 +0000
committerDries Buytaert <dries@buytaert.net>2001-04-19 19:59:48 +0000
commit3f1979aa3cfa2d50789e88bd0a857dec6babb44b (patch)
tree00a5170b8db220163950343292e0e7f966c80549 /modules/structure.module
parenta6e6dfb9219ebea34331ad46c9c43d53f7c3ca6f (diff)
downloadbrdo-3f1979aa3cfa2d50789e88bd0a857dec6babb44b.tar.gz
brdo-3f1979aa3cfa2d50789e88bd0a857dec6babb44b.tar.bz2
- Addition: made it so that comments can be enabled/disabled on
a node per node basis, rather then on a category per category basis. The default settings for each individual category can be changed though. Example: it can be setup so that - by default - all stories posted to the category "article" will have comments enabled but stories submitted to "announcement" not. Different configuration schemes can easily be added later. Requires a SQL update, see 2.00-to-x.xx.sql/database.mysql. - Addition: made submit.php only use categories that users can actually submit new content to.
Diffstat (limited to 'modules/structure.module')
-rw-r--r--modules/structure.module9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/structure.module b/modules/structure.module
index 6e921ec0d..5fa361bd9 100644
--- a/modules/structure.module
+++ b/modules/structure.module
@@ -2,7 +2,6 @@
$module = array("admin" => "structure_admin");
-$cstatus = array("disabled", "enabled");
$mstatus = array("post new submissions", "moderate new submissions");
function content_types($name, $module) {
@@ -11,7 +10,7 @@ function content_types($name, $module) {
}
function category_form($edit = array()) {
- global $types, $cstatus, $mstatus;
+ global $types, $mstatus;
$threshold_post = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100);
$threshold_dump = array(-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -20, -25, -30);
@@ -31,7 +30,7 @@ function category_form($edit = array()) {
$output .= "<SMALL><I>The content type to bind or associate this category with.</I></SMALL><P>\n";
$output .= "<B>Comment settings:</B><BR>\n";
- foreach ($cstatus as $key=>$value) $options2 .= "<OPTION VALUE=\"$key\"". ($edit[comment] == $key ? " SELECTED" : "") .">". check_select($value) ."</OPTION>";
+ foreach (comment_status() as $key=>$value) $options2 .= "<OPTION VALUE=\"$key\"". ($edit[comment] == $key ? " SELECTED" : "") .">". check_select($value) ."</OPTION>";
$output .= "<SELECT NAME=\"edit[comment]\">$options2</SELECT><BR>\n";
$output .= "<SMALL><I>Allow or dissallow users to post comments in this category.</I></SMALL><P>\n";
@@ -65,14 +64,14 @@ function category_form($edit = array()) {
}
function category_overview() {
- global $cstatus, $mstatus;
+ global $mstatus;
$result = db_query("SELECT * FROM category ORDER BY name");
$output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
$output .= " <TR><TH>name</TH><TH>type</TH><TH>comments</TH><TH>submissions</TH><TH>operations</TH></TR>\n";
while ($category = db_fetch_object($result)) {
- $output .= " <TR><TD>". check_output($category->name) ."</TD><TD>". check_output($category->type) ."</TD><TD>". check_output($cstatus[$category->comment]) ."</TD><TD>". check_output($mstatus[$category->submission]) ."". ($category->submission ? "<BR><SMALL>post: $category->post, dump: $category->dump, expire: $category->expire</SMALL>" : "") ."</TD><TD><A HREF=\"admin.php?mod=structure&type=category&op=edit&id=$category->cid\">edit category</A></TD></TR>\n";
+ $output .= " <TR><TD>". check_output($category->name) ."</TD><TD>". check_output($category->type) ."</TD><TD>". comment_status($category->comment) ."</TD><TD>". check_output($mstatus[$category->submission]) ."". ($category->submission ? "<BR><SMALL>post: $category->post, dump: $category->dump, expire: $category->expire</SMALL>" : "") ."</TD><TD><A HREF=\"admin.php?mod=structure&type=category&op=edit&id=$category->cid\">edit category</A></TD></TR>\n";
}
$output .= "</TABLE>\n";
return $output;