You are here

function user_stats_isset in User Stats 7

Same name and namespace in other branches
  1. 6 user_stats.module \user_stats_isset()

Checks whether a statistic is set for a given user.

Parameters

$uid: User ID of the user who's statistics should be checked.

$statistic: What statistic to check.

3 calls to user_stats_isset()
user_stats_get_stats in ./user_stats.module
Returns user stats.
user_stats_login_count_update in ./user_stats.module
Manage the login count of a given user.
user_stats_post_count_update in ./user_stats.module
Manage the post count of a given user.

File

./user_stats.module, line 692
User Stats provides commonly requested user statistics for themers. These are:

Code

function user_stats_isset($statistic, $uid) {
  $result = db_query("SELECT COUNT(*)\n    FROM {user_stats_values}\n    WHERE uid = :uid AND name = :name", array(
    ':uid' => $uid,
    ':name' => $statistic,
  ))
    ->fetchField();
  if ($result > 0) {
    return TRUE;
  }
  return FALSE;
}