\n"; $output .= "Name:
\n"; $output .= "
\n"; $output .= "A unique name for this category like 'announcement', 'article', 'column', 'review', etc.

\n"; $output .= "Content type:
\n"; foreach ($types as $key=>$value) $options1 .= ""; $output .= "
\n"; $output .= "The content type to bind or associate this category with.

\n"; $output .= "Comment:
\n"; foreach (node_comment_status() as $key=>$value) $options2 .= ""; $output .= "
\n"; $output .= "By default, allow or dissallow users to post comments in this category.

\n"; $output .= "Promote:
\n"; foreach (node_promote_status() as $key=>$value) $options3 .= ""; $output .= "
\n"; $output .= "By default, promote new submissions in this category to the front page.

\n"; $output .= "Submission:
\n"; foreach (node_submission_status() as $key=>$value) $options4 .= ""; $output .= "
\n"; foreach ($threshold_post as $value) $options5 .= ""; $output .= "\n"; foreach ($threshold_dump as $value) $options6 .= ""; $output .= "\n"; foreach ($threshold_expire as $value) $options7 .= ""; $output .= "
\n"; $output .= "What to do with new submissions in this category?
Specify the post, dump and expiration threshold for moderation purpose.

\n"; if ($edit[cid]) { $output .= "\n"; $output .= "\n"; $output .= "\n"; } else { $output .= "\n"; } $output .= "\n"; return $output; } function category_overview() { $result = db_query("SELECT * FROM category ORDER BY name"); $output .= "\n"; $output .= " \n"; while ($category = db_fetch_object($result)) { $output .= " \n"; } $output .= "
nametypecommentpromotesubmissionsoperations
". check_output($category->name) ."". check_output($category->type) ."". node_comment_status($category->comment) ."". node_promote_status($category->promote) ."". node_submission_status($category->submission) ."". ($category->submission ? "
post: $category->post, dump: $category->dump, expire: $category->expire" : "") ."
cid\">edit category
\n"; return $output; } // ---- topic ---- function topic_form($edit = array()) { $output .= "

\n"; $output .= "Name:
\n"; $output .= "
\n"; $output .= "A unique name for this topic like 'science', 'internet', 'culture', etc.

\n"; $output .= "Parent:
\n"; foreach (topic_tree() as $key=>$value) $options .= ""; $output .= "
\n"; $output .= "The parent topic this topic belongs in.

\n"; if ($edit[tid]) { $output .= "\n"; $output .= "\n"; $output .= "\n"; } else { $output .= "\n"; } return $output; } function topic_overview() { $tree = topic_tree(); $output .= "\n"; $output .= " \n"; foreach ($tree as $id=>$name) { $output .= " \n"; } $output .= "
nameoperations
". check_output($name) ."edit topic
\n"; return $output; } // ----- structure ----- function structure_overview() { $output .= "

Categories

\n"; $output .= category_overview(); $output .= "

Topics

\n"; $output .= topic_overview(); return $output; } function structure_admin() { global $id, $op, $type, $edit; print "add new category | add new topic | overview
\n"; switch ($type) { case "category": switch ($op) { case "add": print category_form(); break; case "edit": print category_form(category_get_array("cid", $id)); break; case "view": print category_view($id); break; case "Delete category": print status(category_del($edit[cid])); print structure_overview(); break; case "Save category": print status(category_save($edit)); print structure_overview(); break; default: print structure_overview(); } break; case "topic": switch ($op) { case "add": print topic_form(); break; case "edit": print topic_form(topic_get_array("tid", $id)); break; case "view": print topic_view($id); break; case "Delete topic": print status(topic_del($edit[tid])); print structure_overview(); break; case "Save topic": print status(topic_save($edit)); print structure_overview(); break; default: print structure_overview(); } break; default: print structure_overview(); } } ?>