You are here

function imagepicker_set_user_group_state in Image Picker 6.2

Same name and namespace in other branches
  1. 5.2 imagepicker.module \imagepicker_set_user_group_state()
  2. 7 imagepicker.functions.inc \imagepicker_set_user_group_state()

set group state

2 calls to imagepicker_set_user_group_state()
imagepicker_groups in ./imagepicker.group.inc
@file contains the functions for group management
imagepicker_user_page in ./imagepicker.user.inc
@file my imagepicker in my account

File

./imagepicker.functions.inc, line 1402
Imagepicker functions

Code

function imagepicker_set_user_group_state($state, $gid, $account = FALSE) {
  if ($account) {
    $user = $account;
  }
  else {
    global $user;
  }
  db_query("UPDATE {imagepicker_user_groups} SET state=0 WHERE uid=%d AND state=1", array(
    $user->uid,
  ));
  db_query("UPDATE {imagepicker_user_groups} SET state=%d WHERE gid=%d", array(
    $state,
    $gid,
  ));
}