From 777c2129b6d263225d2b17ef408b09f544bc3578 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 27 Oct 2003 21:13:40 +0000 Subject: - Bugfix: made the bloggerapi respect the default promote setting. Patch by Remco. TODO: the same should be done for the fields "comment", "moderate" and so on. - Improvement: made posts/updates through the Blogger API show up on the admin main page. Modified patch from Remco. --- modules/bloggerapi.module | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/bloggerapi.module b/modules/bloggerapi.module index 75d58d0d3..0123290a2 100644 --- a/modules/bloggerapi.module +++ b/modules/bloggerapi.module @@ -38,7 +38,7 @@ function bloggerapi_newPost($params) { $nid = node_save($node); if ($nid) { - watchdog("special", "$node->type: added '$node->title', via Blogger API"); + watchdog("special", "$node->type: added '$node->title' using the Blogger API", l(t("view post"), "node/view/$nid")); return new xmlrpcresp(new xmlrpcval("$nid", "string")); } else { @@ -58,7 +58,7 @@ function bloggerapi_editPost($params) { if (!$node->error) { $nid = node_save($node); if ($nid) { - watchdog("special", "$node->type: updated '$node->title', via Blogger API"); + watchdog("special", "$node->type: updated '$node->title' using the Blogger API", l(t("view post"), "node/view/$nid")); return new xmlrpcresp(new xmlrpcval($nid, "string")); } else { @@ -144,17 +144,23 @@ function bloggerapi_driver($method, $params = 0, $error = 0) { $title = bloggerapi_title($cparams[4]); } + /* + ** Check if we can set promote. + */ + + $promote = variable_get("node_promote_blog", "0"); + /* ** Maps params to node array or call another function */ switch ($method) { case "newPost": - return array("type" => "blog", "uid" => $user->uid, "name" => $user->name, "title" => $title, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0); + return array("type" => "blog", "uid" => $user->uid, "name" => $user->name, "title" => $title, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => $promote, "revision" => 0); case "editPost": $node = node_load(array("nid" => $cparams[1])); if ($node->uid == $user->uid) { - return array("nid" => $cparams[1], "uid" => $user->uid, "type" => "blog", "name" => $user->name, "title" => $title, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0); + return array("nid" => $cparams[1], "uid" => $user->uid, "type" => "blog", "name" => $user->name, "title" => $title, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => $promote, "revision" => 0); } else { return bloggerapi_error("Error updating node"); -- cgit v1.2.3