diff options
author | friendica <info@friendica.com> | 2013-06-14 16:54:58 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-06-14 16:54:58 -0700 |
commit | 765d6e0a97f135755d6ec1322f6e3272bc0ae620 (patch) | |
tree | ac7d0691343a0c0951ff19b1ee46cd21afaf3c4c /include/config.php | |
parent | 9b67e114ad9da2b5e0456709affd20d9c760e4ae (diff) | |
download | volse-hubzilla-765d6e0a97f135755d6ec1322f6e3272bc0ae620.tar.gz volse-hubzilla-765d6e0a97f135755d6ec1322f6e3272bc0ae620.tar.bz2 volse-hubzilla-765d6e0a97f135755d6ec1322f6e3272bc0ae620.zip |
push refresh messages, performance work on conversations and configs, doc updates
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..92fae165b 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(! 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>!"; +// } } |