From 7ce686c152416dc3a240861840f9c18791e38762 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 10 Dec 2002 20:35:20 +0000 Subject: o Permission improvements: + Removed the "post content" permission and replaced it by more fine-grained permissions such as "maintain static pages", "maintain personal blog", "maintain stories", etc. o Usability improvements to teasers: + Teaser forms are no more. Teasers are extracted automatically but can also be instructed using a delimiter "---". Furthermore, when a post it too short for a teaser, the user won't be bother with teaser stuff anymore. + Added an option to set the teaser length, or to disable teasers all together. + When previewing a post, both the short (if any) and the full version of a post are shown. This addresses a common complaint; for example, when writing a book page there was no way you could preview the short version of your post. + Forum posts can be teasered now. This is particularly helpful in the context of drupal.org where we promote forum topics. o Bugfix: replaced all PHP short tags (uid && user_access("access Blogger API")) { - if (user_access("post content")) { - /* - ** Check for title tags, if not generate one. - */ + /* + ** Check for title tags, if not generate one. + */ - if (eregi("(.*)", $cparams[4], $title)) { - $title = strip_tags($title[0]); - $cparams[4] = ereg_replace(".*", "", $cparams[4]); - } - else { - $title = bloggerapi_title($cparams[4]); - } - - $teaser = node_teaser($cparams[4]); - - /* - ** Maps params to node array or call another function - */ + if (eregi("(.*)", $cparams[4], $title)) { + $title = strip_tags($title[0]); + $cparams[4] = ereg_replace(".*", "", $cparams[4]); + } + else { + $title = bloggerapi_title($cparams[4]); + } - switch ($method) { - case "newPost": - return array("type" => "blog", "title" => $title, "teaser" => $teaser, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0); - break; - case "editPost": - $node = node_load(array("nid" => $cparams[1])); - if ($node->uid == $user->uid) { - return array("nid" => $cparams[1], "type" => "blog", "title" => $title, "teaser" => $teaser, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0); - } - else { - return bloggerapi_error("Error updating node"); - } - break; - case "getUsersBlogs": - return bloggerapi_user_blogs(); - break; - case "getUserInfo": - return bloggerapi_user_info(); - break; - case "getPost": - return bloggerapi_node_load($cparams[1]); - break; - case "getRecentPosts": - return bloggerapi_node_recent($cparams[4]); - break; - case "deletePost": - return bloggerapi_node_delete($cparams[1]); - break; - case "distribute": - break; - default: - return bloggerapi_error("Error in the authentication process"); - break; - } + /* + ** Maps params to node array or call another function + */ + + switch ($method) { + case "newPost": + return array("type" => "blog", "title" => $title, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0); + break; + case "editPost": + $node = node_load(array("nid" => $cparams[1])); + if ($node->uid == $user->uid) { + return array("nid" => $cparams[1], "type" => "blog", "title" => $title, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0); + } + else { + return bloggerapi_error("Error updating node"); + } + break; + case "getUsersBlogs": + return bloggerapi_user_blogs(); + break; + case "getUserInfo": + return bloggerapi_user_info(); + break; + case "getPost": + return bloggerapi_node_load($cparams[1]); + break; + case "getRecentPosts": + return bloggerapi_node_recent($cparams[4]); + break; + case "deletePost": + return bloggerapi_node_delete($cparams[1]); + break; + case "distribute": + break; + default: + return bloggerapi_error("Error in the authentication process"); + break; } - } else { + } + else { return bloggerapi_error("Error in the authentication process"); } } @@ -381,7 +378,7 @@ function bloggerapi_help() {

Introduction

Blogger, the well-known public weblog service, provides an application programing interface (API) to allow remote procedure calls (RPC) to the Blogger service. Drupal supports this Blogger API, which means that many remote clients (e.g. Radio, TextRouter, Blogbuddy, w.bloggar, PerlyBlog), may post to Drupal. These clients provide a bevy of interesting capabilities like offline composing, spellcheck, and WYSIWYG editing; many folks prefer to blog with a client application over typical web forms. By supporting the Blogger API, Drupal grows grander than a web site engine, it's a content accepting machine™. -

The Blogger RPC API uses the XML-RPC protocol for communicating with the outside world. XML-RPC, originally developed by Dave Winer of UserLand Software, is a simple XML-based RPC specification ideally suited to the web. Drupal also uses XML-RPC for several other tasks (e.g. notifiying weblogs.com of blog updates and making/accepting "user", "op" => "help")) ?> requests)

+

The Blogger RPC API uses the XML-RPC protocol for communicating with the outside world. XML-RPC, originally developed by Dave Winer of UserLand Software, is a simple XML-based RPC specification ideally suited to the web. Drupal also uses XML-RPC for several other tasks (e.g. notifiying weblogs.com of blog updates and making/accepting "user", "op" => "help")) ?> requests)

Blogger API implementation

@@ -404,7 +401,7 @@ function bloggerapi_help() {

Installation and usage

-

To install the Blogger API module, enable the module in the site configuration - modules tab in the administration pages. Also make sure you have your permissions set correctly for accessing the Blogger API, the relevant settings can be found under the user management tab in the administration menu. Check the checkbox behind the line "access Blogger API" for the roles that are allowed to use the Blogger API. Make sure those roles have the right to "post content" as well.

+

To install the Blogger API module, enable the module in the site configuration - modules tab in the administration pages. Also make sure you have your permissions set correctly for accessing the Blogger API, the relevant settings can be found under the user management tab in the administration menu. Check the checkbox behind the line "access Blogger API" for the roles that are allowed to use the Blogger API.

Once the API is enabled you can download one of the above mentioned Blogger API clients and get blogging.

Setup of the client

-- cgit v1.2.3