You are here

function subscriptions_blog_ui_subscriptions_counts_alter in Subscriptions 7

Same name and namespace in other branches
  1. 2.0.x subscriptions_blog_ui/subscriptions_blog_ui.module \subscriptions_blog_ui_subscriptions_counts_alter()

Implements hook_subscriptions_counts_alter().

Parameters

array $counts: An array indexed by module and type, containing the counts.

int $uid: The ID of the user whose counts should be collected.

Return value

void

File

./subscriptions_blog_ui.module, line 197
Provide a Subscriptions UI for the blog content type subscriptions

Code

function subscriptions_blog_ui_subscriptions_counts_alter(array &$counts, $uid) {
  $counts['node']['blog'] = db_query("SELECT count(*) FROM {subscriptions} WHERE module = 'node' AND field = 'type' AND value = 'blog' AND author_uid <> -1 AND recipient_uid = :recipient_uid", array(
    ':recipient_uid' => $uid,
  ))
    ->fetchField();
}