mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
Update functions.php
This commit is contained in:
parent
829c0046e5
commit
cb8ccb7426
1 changed files with 3 additions and 0 deletions
|
@ -898,13 +898,16 @@ function bb_get_config($table, $from_db = false, $update_cache = true)
|
||||||
{
|
{
|
||||||
if ($from_db or !$cfg = CACHE('bb_config')->get("config_{$table}")) {
|
if ($from_db or !$cfg = CACHE('bb_config')->get("config_{$table}")) {
|
||||||
$cfg = [];
|
$cfg = [];
|
||||||
|
|
||||||
foreach (DB()->fetch_rowset("SELECT * FROM $table") as $row) {
|
foreach (DB()->fetch_rowset("SELECT * FROM $table") as $row) {
|
||||||
$cfg[$row['config_name']] = $row['config_value'];
|
$cfg[$row['config_name']] = $row['config_value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($update_cache) {
|
if ($update_cache) {
|
||||||
CACHE('bb_config')->set("config_{$table}", $cfg);
|
CACHE('bb_config')->set("config_{$table}", $cfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $cfg;
|
return $cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue