mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Fixed: Automatic conversion of false to array is deprecated (#750)
This commit is contained in:
parent
c31d64ddfb
commit
eb604a566e
1 changed files with 9 additions and 2 deletions
|
@ -12,9 +12,11 @@ require __DIR__ . '/pagestart.php';
|
|||
// Generate relevant output
|
||||
if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
|
||||
$module = [];
|
||||
if (!$module = CACHE('bb_cache')->get('admin_module_' . $user->id)) {
|
||||
|
||||
// Scan modules
|
||||
if (!CACHE('bb_cache')->get('admin_module_' . $user->id)) {
|
||||
$dir = opendir('.');
|
||||
$setmodules = 1;
|
||||
$setmodules = true;
|
||||
while ($file = readdir($dir)) {
|
||||
if (preg_match('/^admin_.*?\.php$/', $file)) {
|
||||
include './' . $file;
|
||||
|
@ -22,9 +24,14 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
|
|||
}
|
||||
unset($setmodules);
|
||||
closedir($dir);
|
||||
|
||||
// Set modules into cache
|
||||
CACHE('bb_cache')->set('admin_module_' . $user->id, $module, 600);
|
||||
}
|
||||
|
||||
// Get modules from cache
|
||||
$module = CACHE('bb_cache')->get('admin_module_' . $user->id);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'TPL_ADMIN_NAVIGATE' => true,
|
||||
'U_FORUM_INDEX' => '../index.php',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue