You are here

function agenda_variable_set in Agenda 6

Same name and namespace in other branches
  1. 6.2 agenda.module \agenda_variable_set()
  2. 7.2 agenda.module \agenda_variable_set()
  3. 7 agenda.module \agenda_variable_set()

Set a variable

Parameters

int $delta The ID of the agenda:

string $parameter The parameter required:

string $value The value:

1 call to agenda_variable_set()
agenda_admin_configure_submit in ./agenda.admin.php
Save all the settings into our agenda settings table

File

./agenda.module, line 248

Code

function agenda_variable_set($delta, $parameter, $value) {
  $bid = db_result(db_query("SELECT bid FROM {agenda} WHERE bid=%d AND name='%s'", $delta, $parameter));
  if (!$bid) {
    $query = "INSERT INTO {agenda} (value,bid,name) VALUES ('%s', %d, '%s')";
  }
  else {
    $query = "UPDATE {agenda} SET value='%s' WHERE bid=%d AND name='%s'";
  }
  return db_query($query, $value, $delta, $parameter);
}