You are here

function user_badges_cron in User Badges 7.3

Same name and namespace in other branches
  1. 7.4 user_badges.module \user_badges_cron()
  2. 7 user_badges.autoassignrole.inc \user_badges_cron()
  3. 7.2 user_badges.autoassignrole.inc \user_badges_cron()

Implements hook_cron(). Enables User Badges to work along with Auto Assign Role. Notes: - this is a quite fast solution in order to solve Auto Assign Role issue.

  • do not forget to set up your cron

File

./user_badges.autoassignrole.inc, line 13
Actions for User Badges module.

Code

function user_badges_cron() {
  $results = db_query('SELECT * FROM {user_badges_roles}');
  $roles = array();
  foreach ($results as $result) {
    $roles[$result->rid] = $result->bid;
  }
  user_badges_save_roles($roles);

  // Yuck!
}