Sample hook implementation for user_stats
Phliplip - October 6, 2009 - 10:13
| Project: | User titles |
| Version: | 6.x-1.0-beta2 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
Hi,
If you wish your user_titles to be given on the base of user_stats post count, this is for you.
/**
* Sample hook implementation for user_stats; should be placed in user_stats
*/
if (module_exists('user_stats') && !function_exists('user_stats_user_titles')) {
function user_stats_user_titles($op, $uid = NULL) {
switch ($op) {
case 'register':
return 'user_stats';
case 'name':
return t('User Stats');
case 'description':
return t('Count of post and/or comments');
case 'units':
return t('Posts');
case 'url':
return 'admin/help/user_stats';
case 'get':
return user_stats_get_stats('post_count', $uid);
}
}
}