2 // This program is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU General Public License
4 // as published by the Free Software Foundation; either version 2
5 // of the License, or (at your option) any later version.
7 require_once(dirname(__FILE__) . "/sql.inc");
8 require_once(dirname(__FILE__) . "/formdata.inc.php");
10 //This will return the user settings from the 'users' table.
11 // $id is the user id number in the 'users' table
12 function getUserSettings($id) {
13 $row = sqlQuery("SELECT dem_expand, ins_expand, not_expand, " .
14 "dis_expand FROM users WHERE id=?", array($id) );
18 //This will set a user setting
19 // $name is the setting name in the 'users' table
20 // $value is the setting value to be set in the 'users' table
21 // $id is the user id number in the 'users' table
22 function setUserSetting($name, $value, $id) {
23 sqlStatement("UPDATE users SET " . add_escape_custom($name) .
24 "=? WHERE id=?", array($value, $id) );