Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
300
Merge Requests
300
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
e545feff
Commit
e545feff
authored
Aug 02, 2005
by
Steven Wittens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-
#28053
: left-over blogapi bugs after xmlrpc library switch
parent
e5353cc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
34 deletions
+52
-34
modules/blogapi.module
modules/blogapi.module
+26
-17
modules/blogapi/blogapi.module
modules/blogapi/blogapi.module
+26
-17
No files found.
modules/blogapi.module
View file @
e545feff
...
...
@@ -43,6 +43,11 @@ function blogapi_xmlrpc() {
'blogapi_blogger_edit_post'
,
array
(
'boolean'
,
'string'
,
'string'
,
'string'
,
'string'
,
'string'
,
'boolean'
),
t
(
'Updates the information about an existing post.'
)),
array
(
'blogger.getPost'
,
'blogapi_blogger_get_post'
,
array
(
'struct'
,
'string'
,
'string'
,
'string'
,
'string'
),
t
(
'Returns information about a specific post.'
)),
array
(
'blogger.deletePost'
,
'blogapi_blogger_delete_post'
,
...
...
@@ -129,7 +134,7 @@ function blogapi_xmlrpc() {
* Blogging API callback. Finds the URL of a user's blog.
*/
function
blogapi_blogger_get_users_blogs
()
{
function
blogapi_blogger_get_users_blogs
(
$appid
,
$username
,
$password
)
{
$user
=
blogapi_validate_user
(
$username
,
$password
);
if
(
$user
->
uid
)
{
...
...
@@ -280,6 +285,20 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
return
blogapi_error
(
t
(
'Error storing post.'
));
}
/**
* Blogging API callback. Returns a specified blog node.
*/
function
blogapi_blogger_get_post
(
$appkey
,
$postid
,
$username
,
$password
)
{
$user
=
blogapi_validate_user
(
$username
,
$password
);
if
(
!
$user
->
uid
)
{
return
blogapi_error
(
$user
);
}
$node
=
node_load
(
$postid
);
return
_blogapi_get_post
(
$node
,
true
);
}
/**
* Blogging API callback. Removes the specified blog node.
*/
...
...
@@ -321,18 +340,8 @@ function blogapi_metaweblog_edit_post($postid, $username, $password, $content, $
return
blogapi_blogger_edit_post
(
'0123456789ABCDEF'
,
$postid
,
$username
,
$password
,
$content
,
$publish
);
}
/**
* Blogging API callback. Returns a specified blog node.
*/
function
blogapi_metaweblog_get_post
(
$postid
,
$username
,
$password
)
{
$user
=
blogapi_validate_user
(
$username
,
$password
);
if
(
!
$user
->
uid
)
{
return
blogapi_error
(
$user
);
}
$node
=
node_load
(
$postid
);
return
_blogapi_get_post
(
$node
,
true
);
return
blogapi_blogger_get_post
(
'01234567890ABCDEF'
,
$postid
,
$username
,
$password
);
}
/**
...
...
@@ -356,7 +365,7 @@ function blogapi_metaweblog_new_media_object($blogid, $username, $password, $fil
}
// Return the successful result.
return
array
(
'url'
=>
file_create_url
(
$file
));
return
array
(
'url'
=>
file_create_url
(
$file
)
,
'struct'
);
}
/**
* Blogging API callback. Returns a list of the taxonomy terms that can be
...
...
@@ -381,7 +390,7 @@ function blogapi_metaweblog_get_category_list($blogid, $username, $password) {
return
$categories
;
}
function
blogai_metaweblog_get_recent_posts
(
$blogid
,
$username
,
$password
,
$number_of_posts
)
{
function
bloga
p
i_metaweblog_get_recent_posts
(
$blogid
,
$username
,
$password
,
$number_of_posts
)
{
return
blogapi_blogger_get_recent_posts
(
'0123456789ABCDEF'
,
$blogid
,
$username
,
$password
,
$number_of_posts
,
TRUE
);
}
...
...
@@ -429,7 +438,7 @@ function blogapi_mt_set_post_categories($postid, $username, $password, $categori
$nid
=
$postid
;
$terms
=
array
();
foreach
(
$categories
as
$category
)
{
$terms
[]
=
$category
[
'categoryId'
]
->
scalarval
()
;
$terms
[]
=
$category
[
'categoryId'
];
}
module_invoke
(
'taxonomy'
,
'node_save'
,
$nid
,
$terms
);
return
true
;
...
...
@@ -505,7 +514,7 @@ function blogapi_validate_user($username, $password) {
global
$user
;
$user
=
user_authenticate
(
$username
,
$password
);
if
(
$user
->
uid
)
{
if
(
user_access
(
'edit own blog'
,
$user
))
{
return
$user
;
...
...
@@ -660,7 +669,7 @@ function _blogapi_mt_extra(&$node, $struct) {
// dateCreated
if
(
$struct
[
'dateCreated'
])
{
$node
->
created
=
iso8601_decode
(
$struct
[
'dateCreated'
],
1
);
$node
->
created
=
mktime
(
$struct
[
'dateCreated'
]
->
hour
,
$struct
[
'dateCreated'
]
->
minute
,
$struct
[
'dateCreated'
]
->
second
,
$struct
[
'dateCreated'
]
->
month
,
$struct
[
'dateCreated'
]
->
day
,
$struct
[
'dateCreated'
]
->
year
);
}
if
(
$was_array
)
{
...
...
modules/blogapi/blogapi.module
View file @
e545feff
...
...
@@ -43,6 +43,11 @@ function blogapi_xmlrpc() {
'blogapi_blogger_edit_post'
,
array
(
'boolean'
,
'string'
,
'string'
,
'string'
,
'string'
,
'string'
,
'boolean'
),
t
(
'Updates the information about an existing post.'
)),
array
(
'blogger.getPost'
,
'blogapi_blogger_get_post'
,
array
(
'struct'
,
'string'
,
'string'
,
'string'
,
'string'
),
t
(
'Returns information about a specific post.'
)),
array
(
'blogger.deletePost'
,
'blogapi_blogger_delete_post'
,
...
...
@@ -129,7 +134,7 @@ function blogapi_xmlrpc() {
* Blogging API callback. Finds the URL of a user's blog.
*/
function
blogapi_blogger_get_users_blogs
()
{
function
blogapi_blogger_get_users_blogs
(
$appid
,
$username
,
$password
)
{
$user
=
blogapi_validate_user
(
$username
,
$password
);
if
(
$user
->
uid
)
{
...
...
@@ -280,6 +285,20 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
return
blogapi_error
(
t
(
'Error storing post.'
));
}
/**
* Blogging API callback. Returns a specified blog node.
*/
function
blogapi_blogger_get_post
(
$appkey
,
$postid
,
$username
,
$password
)
{
$user
=
blogapi_validate_user
(
$username
,
$password
);
if
(
!
$user
->
uid
)
{
return
blogapi_error
(
$user
);
}
$node
=
node_load
(
$postid
);
return
_blogapi_get_post
(
$node
,
true
);
}
/**
* Blogging API callback. Removes the specified blog node.
*/
...
...
@@ -321,18 +340,8 @@ function blogapi_metaweblog_edit_post($postid, $username, $password, $content, $
return
blogapi_blogger_edit_post
(
'0123456789ABCDEF'
,
$postid
,
$username
,
$password
,
$content
,
$publish
);
}
/**
* Blogging API callback. Returns a specified blog node.
*/
function
blogapi_metaweblog_get_post
(
$postid
,
$username
,
$password
)
{
$user
=
blogapi_validate_user
(
$username
,
$password
);
if
(
!
$user
->
uid
)
{
return
blogapi_error
(
$user
);
}
$node
=
node_load
(
$postid
);
return
_blogapi_get_post
(
$node
,
true
);
return
blogapi_blogger_get_post
(
'01234567890ABCDEF'
,
$postid
,
$username
,
$password
);
}
/**
...
...
@@ -356,7 +365,7 @@ function blogapi_metaweblog_new_media_object($blogid, $username, $password, $fil
}
// Return the successful result.
return
array
(
'url'
=>
file_create_url
(
$file
));
return
array
(
'url'
=>
file_create_url
(
$file
)
,
'struct'
);
}
/**
* Blogging API callback. Returns a list of the taxonomy terms that can be
...
...
@@ -381,7 +390,7 @@ function blogapi_metaweblog_get_category_list($blogid, $username, $password) {
return
$categories
;
}
function
blogai_metaweblog_get_recent_posts
(
$blogid
,
$username
,
$password
,
$number_of_posts
)
{
function
bloga
p
i_metaweblog_get_recent_posts
(
$blogid
,
$username
,
$password
,
$number_of_posts
)
{
return
blogapi_blogger_get_recent_posts
(
'0123456789ABCDEF'
,
$blogid
,
$username
,
$password
,
$number_of_posts
,
TRUE
);
}
...
...
@@ -429,7 +438,7 @@ function blogapi_mt_set_post_categories($postid, $username, $password, $categori
$nid
=
$postid
;
$terms
=
array
();
foreach
(
$categories
as
$category
)
{
$terms
[]
=
$category
[
'categoryId'
]
->
scalarval
()
;
$terms
[]
=
$category
[
'categoryId'
];
}
module_invoke
(
'taxonomy'
,
'node_save'
,
$nid
,
$terms
);
return
true
;
...
...
@@ -505,7 +514,7 @@ function blogapi_validate_user($username, $password) {
global
$user
;
$user
=
user_authenticate
(
$username
,
$password
);
if
(
$user
->
uid
)
{
if
(
user_access
(
'edit own blog'
,
$user
))
{
return
$user
;
...
...
@@ -660,7 +669,7 @@ function _blogapi_mt_extra(&$node, $struct) {
// dateCreated
if
(
$struct
[
'dateCreated'
])
{
$node
->
created
=
iso8601_decode
(
$struct
[
'dateCreated'
],
1
);
$node
->
created
=
mktime
(
$struct
[
'dateCreated'
]
->
hour
,
$struct
[
'dateCreated'
]
->
minute
,
$struct
[
'dateCreated'
]
->
second
,
$struct
[
'dateCreated'
]
->
month
,
$struct
[
'dateCreated'
]
->
day
,
$struct
[
'dateCreated'
]
->
year
);
}
if
(
$was_array
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment