You are here

function _blog_post_exists in Drupal 7

Same name and namespace in other branches
  1. 6 modules/blog/blog.module \_blog_post_exists()

Helper function to determine if a user has blog posts already.

1 call to _blog_post_exists()
blog_page_user_access in modules/blog/blog.module
Access callback for user blog pages.

File

modules/blog/blog.module, line 182
Enables multi-user blogs.

Code

function _blog_post_exists($account) {
  return (bool) db_select('node', 'n')
    ->fields('n', array(
    'nid',
  ))
    ->condition('type', 'blog')
    ->condition('uid', $account->uid)
    ->condition('status', 1)
    ->range(0, 1)
    ->addTag('node_access')
    ->execute()
    ->fetchField();
}