$result=db_query_range("SELECT n.nid, n.title, r.body, r.format, n.comment, n.created, u.name FROM {node} n, {node_revisions} r, {users} u WHERE n.uid = u.uid AND n.vid = r.vid AND n.type = '%s' AND n.uid = %d ORDER BY n.created DESC",$type,$user->uid,0,$number_of_posts);
$result=db_query_range("SELECT n.nid, n.title, r.body, r.format, n.comment, n.created, u.name FROM {node} n, {node_revisions} r, {users} u WHERE n.uid = u.uid AND n.vid = r.vid AND n.type = '%s' AND n.uid = %d ORDER BY n.created DESC",$blogid,$user->uid,0,$number_of_posts);
}
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);
$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",$blogid,$user->uid,0,$number_of_posts);
}
$blogs=array();
while($blog=db_fetch_object($result)){
...
...
@@ -381,8 +390,12 @@ function blogapi_metaweblog_new_media_object($blogid, $username, $password, $fil
@@ -685,13 +698,21 @@ function _blogapi_get_post($node, $bodies = TRUE) {
return$xmlrpcval;
}
function_blogapi_blogid($id){
if(is_numeric($id)){
return'blog';
}
else{
return$id;
/**
* Validate blog ID, which maps to a content type in Drupal.
*
* Only content types configured to work with Blog API are supported.
*
* @return
* TRUE if the content type is supported and the user has permission
* to post, or a blogapi_error() XML construct otherwise.
*/
function_blogapi_validate_blogid($blogid){
$types=_blogapi_get_node_types();
if(in_array($blogid,$types,TRUE)){
returnTRUE;
}
returnblogapi_error(t("Blog API module is not configured to support the %type content type, or you don't have sufficient permissions to post this type of content.",array('%type'=>$blogid)));
}
function_blogapi_get_node_types(){
...
...
@@ -705,5 +726,3 @@ function _blogapi_get_node_types() {