You are here

function og_populate_uid_global_table in Organic groups 5

Same name and namespace in other branches
  1. 5.7 og.install \og_populate_uid_global_table()
2 calls to og_populate_uid_global_table()
og_enable in ./og.install
og_update_19 in ./og.install

File

./og.install, line 518

Code

function og_populate_uid_global_table() {
  $sql = 'SELECT u.uid FROM {users} u LEFT JOIN {og_uid_global} oug ON u.uid=oug.uid WHERE u.uid > 0 AND oug.og_email IS NULL';
  $result = db_query($sql);
  while ($row = db_fetch_object($result)) {
    $sql = "INSERT INTO {og_uid_global} (uid, og_email) VALUES (%d, %d)";
    db_query($sql, $row->uid, OG_NOTIFICATION_SELECTIVE);
  }
}