summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-11-09 19:03:35 +0000
committerDries Buytaert <dries@buytaert.net>2005-11-09 19:03:35 +0000
commitdac42f83c8786350bd42ef65172e61f30cb6fd31 (patch)
tree08660fc89cd51c387e667c5742abfdea46950254
parent3d13a38502150ec82f0088ff9f3950169b57f6d9 (diff)
downloadbrdo-dac42f83c8786350bd42ef65172e61f30cb6fd31.tar.gz
brdo-dac42f83c8786350bd42ef65172e61f30cb6fd31.tar.bz2
- Patch #36079 by ax/chx: various blogapi.module fixes.
-rw-r--r--includes/xmlrpc.inc1
-rw-r--r--modules/blogapi.module10
-rw-r--r--modules/blogapi/blogapi.module10
3 files changed, 13 insertions, 8 deletions
diff --git a/includes/xmlrpc.inc b/includes/xmlrpc.inc
index e2216e7e6..a645ff488 100644
--- a/includes/xmlrpc.inc
+++ b/includes/xmlrpc.inc
@@ -340,6 +340,7 @@ function xmlrpc_date($time) {
$xmlrpc_date->minute = substr($time, 12, 2);
$xmlrpc_date->second = substr($time, 15, 2);
}
+ $xmlrpc_date->iso8601 = $time;
return $xmlrpc_date;
}
diff --git a/modules/blogapi.module b/modules/blogapi.module
index 1e906bd08..ec19448f1 100644
--- a/modules/blogapi.module
+++ b/modules/blogapi.module
@@ -231,7 +231,8 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
node_save($node);
if ($node->nid) {
watchdog('content', t('%type: added %title using blog API.', array('%type' => '<em>'. t($node->type) .'</em>', '%title' => theme('placeholder', $node->title))), WATCHDOG_NOTICE, l(t('view'), "node/$node->nid"));
- return $node->nid;
+ // blogger.newPost returns a string so we cast the nid to a string by putting it in double quotes:
+ return "$node->nid";
}
return blogapi_error(t('Error storing post.'));
@@ -312,7 +313,7 @@ function blogapi_blogger_get_post($appkey, $postid, $username, $password) {
/**
* Blogging API callback. Removes the specified blog node.
*/
-function blogapi_blogger_delete_post($appkey, $postid, $username, $password, $content, $publish) {
+function blogapi_blogger_delete_post($appkey, $postid, $username, $password, $publish) {
$user = blogapi_validate_user($username, $password);
if (!$user->uid) {
return blogapi_error($user);
@@ -341,6 +342,7 @@ function blogapi_blogger_get_recent_posts($appkey, $blogid, $username, $password
else {
$result = db_query_range("SELECT n.nid, n.title, n.created, u.name FROM {node} n, {users} u WHERE n.uid = u.uid AND n.type = '%s' AND n.uid = %d ORDER BY n.created DESC", $type, $user->uid, 0, $number_of_posts);
}
+ $blogs = array ();
while ($blog = db_fetch_object($result)) {
$blogs[] = _blogapi_get_post($blog, $bodies);
}
@@ -621,7 +623,7 @@ function blogapi_rsd() {
<apis>
<api name="MetaWeblog" preferred="false" apiLink="$xmlrpc" blogID="$blogid" />
<api name="Blogger" preferred="true" apiLink="$xmlrpc" blogID="$blogid" />
- <api name="Movabletype" preferred="false" apiLink="$xmlrpc" blogID="$blogid" />
+ <api name="MovableType" preferred="false" apiLink="$xmlrpc" blogID="$blogid" />
</apis>
</service>
</rsd>
@@ -682,7 +684,7 @@ function _blogapi_mt_extra(&$node, $struct) {
// dateCreated
if ($struct['dateCreated']) {
- $node->created = mktime($struct['dateCreated']->hour, $struct['dateCreated']->minute, $struct['dateCreated']->second, $struct['dateCreated']->month, $struct['dateCreated']->day, $struct['dateCreated']->year);
+ $node->date = $struct['dateCreated']->iso8601;
}
if ($was_array) {
diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module
index 1e906bd08..ec19448f1 100644
--- a/modules/blogapi/blogapi.module
+++ b/modules/blogapi/blogapi.module
@@ -231,7 +231,8 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
node_save($node);
if ($node->nid) {
watchdog('content', t('%type: added %title using blog API.', array('%type' => '<em>'. t($node->type) .'</em>', '%title' => theme('placeholder', $node->title))), WATCHDOG_NOTICE, l(t('view'), "node/$node->nid"));
- return $node->nid;
+ // blogger.newPost returns a string so we cast the nid to a string by putting it in double quotes:
+ return "$node->nid";
}
return blogapi_error(t('Error storing post.'));
@@ -312,7 +313,7 @@ function blogapi_blogger_get_post($appkey, $postid, $username, $password) {
/**
* Blogging API callback. Removes the specified blog node.
*/
-function blogapi_blogger_delete_post($appkey, $postid, $username, $password, $content, $publish) {
+function blogapi_blogger_delete_post($appkey, $postid, $username, $password, $publish) {
$user = blogapi_validate_user($username, $password);
if (!$user->uid) {
return blogapi_error($user);
@@ -341,6 +342,7 @@ function blogapi_blogger_get_recent_posts($appkey, $blogid, $username, $password
else {
$result = db_query_range("SELECT n.nid, n.title, n.created, u.name FROM {node} n, {users} u WHERE n.uid = u.uid AND n.type = '%s' AND n.uid = %d ORDER BY n.created DESC", $type, $user->uid, 0, $number_of_posts);
}
+ $blogs = array ();
while ($blog = db_fetch_object($result)) {
$blogs[] = _blogapi_get_post($blog, $bodies);
}
@@ -621,7 +623,7 @@ function blogapi_rsd() {
<apis>
<api name="MetaWeblog" preferred="false" apiLink="$xmlrpc" blogID="$blogid" />
<api name="Blogger" preferred="true" apiLink="$xmlrpc" blogID="$blogid" />
- <api name="Movabletype" preferred="false" apiLink="$xmlrpc" blogID="$blogid" />
+ <api name="MovableType" preferred="false" apiLink="$xmlrpc" blogID="$blogid" />
</apis>
</service>
</rsd>
@@ -682,7 +684,7 @@ function _blogapi_mt_extra(&$node, $struct) {
// dateCreated
if ($struct['dateCreated']) {
- $node->created = mktime($struct['dateCreated']->hour, $struct['dateCreated']->minute, $struct['dateCreated']->second, $struct['dateCreated']->month, $struct['dateCreated']->day, $struct['dateCreated']->year);
+ $node->date = $struct['dateCreated']->iso8601;
}
if ($was_array) {