You are here

function blogapi_blogger_get_users_blogs in Blog API 7

Same name and namespace in other branches
  1. 8 modules/blogapi_blogger/blogapi_blogger.module \blogapi_blogger_get_users_blogs()
  2. 7.2 modules/blogapi_blogger/blogapi_blogger.module \blogapi_blogger_get_users_blogs()

Blogging API callback. Finds the URL of a user's blog.

1 string reference to 'blogapi_blogger_get_users_blogs'
blogapi_xmlrpc in ./blogapi.module
Implement hook_xmlrpc().

File

./blogapi.module, line 186
Enable users to post using applications that support XML-RPC blog APIs.

Code

function blogapi_blogger_get_users_blogs($appid, $username, $password) {
  $user = blogapi_validate_user($username, $password);
  if ($user->uid) {
    $types = _blogapi_get_node_types();
    $structs = array();
    foreach ($types as $type) {
      $structs[] = array(
        'url' => url('user/' . $user->uid, array(
          'absolute' => TRUE,
        )),
        'blogid' => $type,
        'blogName' => $user->name . ": " . $type,
      );
    }
    return $structs;
  }
  else {
    return blogapi_error($user);
  }
}