summaryrefslogtreecommitdiff
path: root/modules/bloggerapi.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2002-12-10 20:35:20 +0000
committerDries Buytaert <dries@buytaert.net>2002-12-10 20:35:20 +0000
commit7ce686c152416dc3a240861840f9c18791e38762 (patch)
treef771ce209303d39fed6915d1f90d5fc0030e3f23 /modules/bloggerapi.module
parenteceead1819b8e480725db17816d1b2af4f3fd768 (diff)
downloadbrdo-7ce686c152416dc3a240861840f9c18791e38762.tar.gz
brdo-7ce686c152416dc3a240861840f9c18791e38762.tar.bz2
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 (<?) with long tags (<?php). o Bugfix: removed hard-coded dependence on comment module. o Bugfix: when the queue module was disabled, it was not possible to approve updated book pages. o Bugfix: applied modified version of Marco's node_teaser() fix.
Diffstat (limited to 'modules/bloggerapi.module')
-rw-r--r--modules/bloggerapi.module105
1 files changed, 51 insertions, 54 deletions
diff --git a/modules/bloggerapi.module b/modules/bloggerapi.module
index e0f00fe27..abfc2e3b8 100644
--- a/modules/bloggerapi.module
+++ b/modules/bloggerapi.module
@@ -156,62 +156,59 @@ function bloggerapi_driver($method, $params = 0, $error = 0) {
}
if ($user->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("<title>(.*)</title>", $cparams[4], $title)) {
- $title = strip_tags($title[0]);
- $cparams[4] = ereg_replace("<title>.*</title>", "", $cparams[4]);
- }
- else {
- $title = bloggerapi_title($cparams[4]);
- }
-
- $teaser = node_teaser($cparams[4]);
-
- /*
- ** Maps params to node array or call another function
- */
+ if (eregi("<title>(.*)</title>", $cparams[4], $title)) {
+ $title = strip_tags($title[0]);
+ $cparams[4] = ereg_replace("<title>.*</title>", "", $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() {
<h3>Introduction</h3>
<p><a href="http://www.blogger.com">Blogger</a>, 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 <a href="http://plant.blogger.com/api/index.html">Blogger API</a>, which means that many remote clients (e.g. <a href="radio.userland.com">Radio</a>, <a href="http://simon.kittle.info/textrouter">TextRouter</a>, <a href="http://blogbuddy.sourceforge.net/">Blogbuddy</a>, <a href="http://www.wbloggar.com/">w.bloggar</a>, <a href="http://www.tswoam.co.uk/index.php?n_go=16">PerlyBlog</a>), 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 <i>content accepting machine</i>&trade;.
-<p>The <a href="http://plant.blogger.com/api/index.html">Blogger RPC API</a> uses the <a href="http://www.xmlrpc.com">XML-RPC</a> protocol for communicating with the outside world. XML-RPC, originally developed by Dave Winer of <a href="http://www.userland.com">UserLand Software</a>, is a simple XML-based RPC specification ideally suited to the web. Drupal also uses XML-RPC for several other tasks (e.g. notifiying <a href="http://www.weblogs.com">weblogs.com</a> of blog updates and making/accepting <? echo lm("Distributed Authentication", array("mod" => "user", "op" => "help")) ?> requests)</p>
+<p>The <a href="http://plant.blogger.com/api/index.html">Blogger RPC API</a> uses the <a href="http://www.xmlrpc.com">XML-RPC</a> protocol for communicating with the outside world. XML-RPC, originally developed by Dave Winer of <a href="http://www.userland.com">UserLand Software</a>, is a simple XML-based RPC specification ideally suited to the web. Drupal also uses XML-RPC for several other tasks (e.g. notifiying <a href="http://www.weblogs.com">weblogs.com</a> of blog updates and making/accepting <?php echo lm("Distributed Authentication", array("mod" => "user", "op" => "help")) ?> requests)</p>
<h3>Blogger API implementation</h3>
@@ -404,7 +401,7 @@ function bloggerapi_help() {
<h3>Installation and usage</h3>
-<p>To install the Blogger API module, enable the module in the <i>site configuration - modules</i> 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 <i>user management</i> 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.</p>
+<p>To install the Blogger API module, enable the module in the <i>site configuration - modules</i> 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 <i>user management</i> 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.</p>
<p>Once the API is enabled you can download one of the above mentioned Blogger API clients and get blogging.</p>
<h3>Setup of the client</h3>