_blog_post_exists

Versions
6 – 7
_blog_post_exists($account)

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

Code

modules/blog/blog.module, line 165

<?php
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();
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.