summaryrefslogtreecommitdiff
path: root/includes/node.inc
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 /includes/node.inc
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 'includes/node.inc')
-rw-r--r--includes/node.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/node.inc b/includes/node.inc
index 9a8b9f020..733c38da0 100644
--- a/includes/node.inc
+++ b/includes/node.inc
@@ -6,7 +6,7 @@ $rstatus = array(0 => dumped, 1 => expired, 2 => queued, 3 => posted);
function _node_get($field, $value) {
$result = db_query("SELECT lid, type FROM node WHERE $field = '$value'");
if ($node = db_fetch_object($result)) {
- return db_query("SELECT n.*, l.*, c.name AS category, c.comment, t.name AS topic, u.userid FROM node n LEFT JOIN $node->type l ON n.lid = l.lid AND n.nid = l.nid LEFT JOIN users u ON n.author = u.id LEFT JOIN category c ON n.cid = c.cid LEFT JOIN topic t ON n.tid = t.tid WHERE n.$field = '$value' ORDER BY n.timestamp DESC");
+ return db_query("SELECT n.*, l.*, u.userid FROM node n LEFT JOIN $node->type l ON n.lid = l.lid AND n.nid = l.nid LEFT JOIN users u ON n.author = u.id WHERE n.$field = '$value' ORDER BY n.timestamp DESC");
}
}
@@ -39,7 +39,7 @@ function node_get_comments($nid) {
function node_save($node) {
global $user, $status;
- $rows = array(nid, pid, lid, cid, tid, log, type, title, score, votes, author, status, timestamp);
+ $rows = array(nid, pid, lid, cid, tid, log, type, title, score, votes, author, status, comment, timestamp);
if ($node[nid] > 0) {
$n = node_get_object("nid", $node[nid]);
@@ -74,7 +74,7 @@ function node_save($node) {
throttle("post node", variable_get(max_node_rate, 900));
// setup default values:
- $node = array_merge(array(title => "?", author => $user->id, type => "?", pid => 0, cid => 0, tid => 0, log => "node created", status => $status[queued], score => 0, votes => 0, timestamp => time()), $node);
+ $node = array_merge(array(title => "?", author => $user->id, type => "?", pid => 0, cid => 0, tid => 0, log => "node created", status => $status[queued], score => 0, votes => 0, comment => 1, timestamp => time()), $node);
// prepare queries:
$f1 = array();