diff options
author | Thomas Willingham <founder@kakste.com> | 2013-06-16 14:59:17 +0100 |
---|---|---|
committer | Thomas Willingham <founder@kakste.com> | 2013-06-16 14:59:17 +0100 |
commit | 33696cc8392daeb08d011aa3b1209f3b121898ea (patch) | |
tree | 466d48f5abc1a4ec1dbf83543471a8ac89428516 /include/config.php | |
parent | 466a6d5227fbaf0a36cd76b5603cb42bb1b7462b (diff) | |
parent | c4c80a2e472173dfed9b982c6705ccfbb6e6cdab (diff) | |
download | volse-hubzilla-33696cc8392daeb08d011aa3b1209f3b121898ea.tar.gz volse-hubzilla-33696cc8392daeb08d011aa3b1209f3b121898ea.tar.bz2 volse-hubzilla-33696cc8392daeb08d011aa3b1209f3b121898ea.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/config.php')
-rw-r--r-- | include/config.php | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/include/config.php b/include/config.php index 5db0a3d05..dc4470823 100644 --- a/include/config.php +++ b/include/config.php @@ -129,19 +129,35 @@ function del_config($family,$key) { function load_pconfig($uid,$family) { global $a; - $r = q("SELECT * FROM `pconfig` WHERE `cat` = '%s' AND `uid` = %d", - dbesc($family), - intval($uid) - ); - if(count($r)) { + + if(($uid) && (! array_key_exists($uid,$a->config))) + $a->config[$uid] = array(); + + if($family) { + $r = q("SELECT * FROM `pconfig` WHERE `cat` = '%s' AND `uid` = %d", + dbesc($family), + intval($uid) + ); + } + else { + $r = q("SELECT * FROM `pconfig` WHERE `uid` = %d", + intval($uid) + ); + } + + if($r) { foreach($r as $rr) { $k = $rr['k']; - $a->config[$uid][$family][$k] = $rr['v']; + $c = $rr['cat']; + if(! array_key_exists($c,$a->config[$uid])) + $a->config[$uid][$c] = array(); + $a->config[$uid][$c][$k] = $rr['v']; } - } else if ($family != 'config') { + } +// else if ($family != 'config') { // Negative caching - $a->config[$uid][$family] = "!<unset>!"; - } +// $a->config[$uid][$family] = "!<unset>!"; +// } } |