Index: modules/blogapi.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blogapi.module,v retrieving revision 1.5 diff -u -r1.5 blogapi.module --- modules/blogapi.module 22 Dec 2003 11:28:07 -0000 1.5 +++ modules/blogapi.module 22 Mar 2004 19:51:17 -0000 @@ -2,6 +2,13 @@ // $Id: blogapi.module,v 1.5 2003/12/22 11:28:07 dries Exp $ +function blogapi_settings() { + $types = array(); + $types = array("blog" => "blog", "story" => "story"); + $output .= form_select(t("Node type for blog entries"), "blogapi_nodetype", variable_get("blogapi_nodetype", "blog"), $types, t("New nodes added through the blog api will be of this node type.")); + return $output; +} + function blogapi_help($section) { switch ($section) { case 'admin/help#blogapi': @@ -108,7 +115,7 @@ return blogapi_error(t("Terminated request because of suspicious input data.")); } - $node = node_validate(array('type' => 'blog', + $node = node_validate(array('type' => variable_get("blogapi_nodetype", "blog"), 'uid' => $user->uid, 'name' => $user->name, 'title' => $title, @@ -229,7 +236,7 @@ } function blogapi_get_category_list($req_params) { - $vocabularies = module_invoke('taxonomy', 'get_vocabularies', 'blog', 'vid'); + $vocabularies = module_invoke('taxonomy', 'get_vocabularies', variable_get("blogapi_nodetype", "blog"), 'vid'); if ($vocabularies) { $categories = array(); foreach ($vocabularies as $vocabulary) { @@ -301,7 +308,7 @@ return blogapi_error($user); } - $result = db_query_range("SELECT n.nid, n.title, n.body, n.created, u.name FROM {node} n, {users} u WHERE n.uid=u.uid AND n.type = 'blog' AND n.uid = %d ORDER BY n.created DESC", $user->uid, 0, $params[3]); + $result = db_query_range("SELECT n.nid, n.title, n.body, n.created, u.name FROM {node} n, {users} u WHERE n.uid=u.uid AND n.type = '" . variable_get("blogapi_nodetype", "blog") . "' AND n.uid = %d ORDER BY n.created DESC", $user->uid, 0, $params[3]); while ($blog = db_fetch_object($result)) { $blogs[] = new xmlrpcval(array('userid' => new xmlrpcval($blog->name, 'string'), 'dateCreated' => new xmlrpcval(iso8601_encode($blog->created), "dateTime.iso8601"),