hook_count_user_subscriptions($count, $uid)
subscriptions_og/docs/hooks.php, line 224
Declare a subscription plugin count handler.
When subscriptions module generates page user overview, it calls every plug-in available to provide the amount of subscriptions a user have. Note that this implementation uses _module_types() in order of construct resulting array.
subscriptions_page_user_overview()
$count It is the array where we can store our count. WARNING! must not be overriten, but only inserted with your plugin array key.
$uid User account ID to filter subscriptions used to count.
Array with count of current plugin subscriptions.
| Name | Description |
|---|---|
| Hooks | Allow modules to interact with the Drupal core. |
<?php
function hook_count_user_subscriptions($count, $uid) {
$type = _module_types();
$fields = $type['group']['fields'];
$_query = "
SELECT count(*)
FROM {subscriptions}
WHERE
module = 'node' AND
field = 'group_nid' AND
recipient_uid = %d
";
$count[$fields[0]][$fields[1]] = db_result(db_query($_query, $uid));
return $count;
}
?>