You are here

function _avatar_selection_save_avatar_info in Avatar Selection 5

Same name and namespace in other branches
  1. 5.2 avatar_selection.module \_avatar_selection_save_avatar_info()
  2. 6 avatar_selection.admin.inc \_avatar_selection_save_avatar_info()
  3. 7 avatar_selection.admin.inc \_avatar_selection_save_avatar_info()
2 calls to _avatar_selection_save_avatar_info()
avatar_selection_edit_form_submit in ./avatar_selection.module
avatar_selection_images_form_submit in ./avatar_selection.module

File

./avatar_selection.module, line 694

Code

function _avatar_selection_save_avatar_info($filepath, $access, $og = "") {
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      $result = db_query("REPLACE INTO {avatar_selection} (avatar, access, og_access) VALUES('%s', '%s', '%s')", $filepath, $access, $og);
      break;
    case 'pgsql':
      $result = db_query("DELETE FROM {avatar_selection} WHERE avatar = '%s'", $filepath);
      $result = db_query("INSERT INTO {avatar_selection} (avatar, access, og_access) VALUES('%s', '%s', '%s')", $file->filepath, $access, $og);
      break;
  }
}