You are here

function privatemsg_set_setting in Privatemsg 6.2

Same name and namespace in other branches
  1. 7.2 privatemsg.module \privatemsg_set_setting()
6 calls to privatemsg_set_setting()
pm_email_notify_update_6201 in pm_email_notify/pm_email_notify.install
Convert the old table to privatemsg settings API.
pm_email_notify_user in pm_email_notify/pm_email_notify.module
Implements hook_user().
PrivatemsgAPITestCase::testGetLink in ./privatemsg.test
Test various use cases for privatemsg_get_link().
PrivatemsgAPITestCase::testSettings in ./privatemsg.test
Tests for the privatemsg_*_setting() functions.
privatemsg_update_6206 in ./privatemsg.install
Migrate settings from {pm_disable} and delete table.

... See full list

File

./privatemsg.module, line 3054
Allows users to send private messages to other users.

Code

function privatemsg_set_setting($type, $id, $setting, $value) {

  // Based on variable_set().
  db_query("UPDATE {pm_setting} SET value = %d WHERE type = '%s' AND id = %d AND setting = '%s'", $value, $type, $id, $setting);
  if (!db_affected_rows()) {
    db_query("INSERT INTO {pm_setting} (type, id, setting, value) VALUES ('%s', %d, '%s', %d)", $type, $id, $setting, $value);
  }

  // Update static cache.
  $cache =& _privatemsg_setting_static_cache();
  $cache[$setting][$type][$id] = $value;
}