Commit dda4e903 authored by Dries's avatar Dries

CHANGES:

- Added moderator support to topics.
parent c1c39439
......@@ -90,7 +90,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 => (category_submission($node[cid]) ? $status[queued] : $status[posted]) , score => 0, votes => 0, comment => category_comment($node[cid]), promote => category_promote($node[cid]), moderate => "", timestamp => time()), $node);
$node = array_merge(array(title => "?", author => $user->id, type => "?", pid => 0, cid => 0, tid => 0, log => "node created", status => (category_submission($node[cid]) ? $status[queued] : $status[posted]) , score => 0, votes => 0, comment => category_comment($node[cid]), promote => category_promote($node[cid]), moderate => topic_moderate($node[tid]), timestamp => time()), $node);
// prepare queries:
$f1 = array();
......
......@@ -124,6 +124,12 @@ function topic_name($tid, $name = 0) {
return ($topic->pid) ? topic_name($topic->pid, $name) : $name;
}
// return moderators for topic $tid:
function topic_moderate($tid) {
$topic = topic_get_object("tid", $tid);
return $topic->moderate;
}
// renders a HTML form to select one or more topics:
function topic_form_select($edit = array(), $size = 1) {
foreach (topic_tree() as $tid=>$name) {
......
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