You are here

function tvi_update_settings in Taxonomy Views Integrator 6

Same name and namespace in other branches
  1. 7 includes/tvi.query.inc \tvi_update_settings()

Saves settings information for a taxonomy vocabulary or term to the database.

1 call to tvi_update_settings()
tvi_submit_handler in includes/tvi.admin.inc
Save the view taxonomy data to the database.

File

includes/tvi.query.inc, line 44
TVI Database Interface

Code

function tvi_update_settings($settings) {

  // Do not use db_affected_rows(), which may fail with old versions
  // of MySQL, returning 0 when data are unchanged.
  $update = array();
  if (db_result(db_query("SELECT COUNT(*) FROM {tvi_settings} WHERE type = '%s' AND xid = %d", $settings->type, $settings->xid))) {
    $update = array(
      'type',
      'xid',
    );
  }
  return drupal_write_record('tvi_settings', $settings, $update);
}