function nodejs_send_role_message in Node.js integration 6
Same name and namespace in other branches
- 8 nodejs.module \nodejs_send_role_message()
- 7 nodejs.module \nodejs_send_role_message()
Send a message to users in a role.
Parameters
string $role_name:
string $subject:
string $body:
File
- ./
nodejs.module, line 174
Code
function nodejs_send_role_message($role_name, $subject, $body) {
$data = db_query("SELECT u.uid FROM {users} as u LEFT JOIN {users_roles} as ur on ur.uid = u.uid LEFT JOIN {role} as r on ur.rid = r.rid");
while ($row = db_fetch_object($data)) {
$uids[] = $row->uid;
}
nodejs_send_user_message_multiple($uids, $subject, $body);
}