mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 13:24:01 -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
|
// Generate relevant output
|
||||||
if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
|
if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
|
||||||
$module = [];
|
$module = [];
|
||||||
if (!$module = CACHE('bb_cache')->get('admin_module_' . $user->id)) {
|
|
||||||
|
// Scan modules
|
||||||
|
if (!CACHE('bb_cache')->get('admin_module_' . $user->id)) {
|
||||||
$dir = opendir('.');
|
$dir = opendir('.');
|
||||||
$setmodules = 1;
|
$setmodules = true;
|
||||||
while ($file = readdir($dir)) {
|
while ($file = readdir($dir)) {
|
||||||
if (preg_match('/^admin_.*?\.php$/', $file)) {
|
if (preg_match('/^admin_.*?\.php$/', $file)) {
|
||||||
include './' . $file;
|
include './' . $file;
|
||||||
|
@ -22,9 +24,14 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
|
||||||
}
|
}
|
||||||
unset($setmodules);
|
unset($setmodules);
|
||||||
closedir($dir);
|
closedir($dir);
|
||||||
|
|
||||||
|
// Set modules into cache
|
||||||
CACHE('bb_cache')->set('admin_module_' . $user->id, $module, 600);
|
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(
|
$template->assign_vars(array(
|
||||||
'TPL_ADMIN_NAVIGATE' => true,
|
'TPL_ADMIN_NAVIGATE' => true,
|
||||||
'U_FORUM_INDEX' => '../index.php',
|
'U_FORUM_INDEX' => '../index.php',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue