function set_config($family,$key,$value) {
global $a;
- $a->config[$family][$key] = $value;
if(get_config($family,$key,true) === false) {
$ret = q("INSERT INTO `config` ( `cat`, `k`, `v` ) VALUES ( '%s', '%s', '%s' ) ",
dbesc($family),
dbesc($key)
);
+
+ $a->config[$family][$key] = $value;
+
if($ret)
return $value;
return $ret;
return $a->config[$uid][$family][$key];
}
}
+
$ret = q("SELECT `v` FROM `pconfig` WHERE `uid` = %d AND `cat` = '%s' AND `k` = '%s' LIMIT 1",
intval($uid),
dbesc($family),
dbesc($key)
);
+
if(count($ret)) {
$a->config[$uid][$family][$key] = $ret[0]['v'];
return $ret[0]['v'];
function set_pconfig($uid,$family,$key,$value) {
global $a;
- $a->config[$uid][$family][$key] = $value;
if(get_pconfig($uid,$family,$key,true) === false) {
$ret = q("INSERT INTO `pconfig` ( `uid`, `cat`, `k`, `v` ) VALUES ( %d, '%s', '%s', '%s' ) ",
dbesc($key)
);
+ $a->config[$uid][$family][$key] = $value;
+
if($ret)
return $value;
return $ret;