function commons_reputation_insert_badges in Drupal Commons 6.2
Insert the default badges
1 call to commons_reputation_insert_badges()
- commons_reputation_install in modules/
features/ commons_reputation/ commons_reputation.install - Implementation of hook_install()
File
- modules/
features/ commons_reputation/ commons_reputation.install, line 27
Code
function commons_reputation_insert_badges($badges) {
$sql = "INSERT INTO {user_badges_badges} (name, image, weight, fixedweight) VALUES ('%s', '%s', %d, %d)";
foreach ($badges as $badge) {
// drupal_write_record() is not working here
db_query($sql, $badge->name, $badge->image, $badge->weight, $badge->fixedweight);
}
}