summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-10-27 21:13:40 +0000
committerDries Buytaert <dries@buytaert.net>2003-10-27 21:13:40 +0000
commit777c2129b6d263225d2b17ef408b09f544bc3578 (patch)
tree711c8392e9c2f4c1f4f48c9bc3a40f96a14c5424 /modules
parent43fb74b91075e494641f47bb9567d53da5e80e74 (diff)
downloadbrdo-777c2129b6d263225d2b17ef408b09f544bc3578.tar.gz
brdo-777c2129b6d263225d2b17ef408b09f544bc3578.tar.bz2
- 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.
Diffstat (limited to 'modules')
-rw-r--r--modules/bloggerapi.module14
1 files changed, 10 insertions, 4 deletions
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 {
@@ -145,16 +145,22 @@ function bloggerapi_driver($method, $params = 0, $error = 0) {
}
/*
+ ** 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");