From 2c69095a1edf7474073451285238659d0f62ce3f Mon Sep 17 00:00:00 2001 From: Appleman1234 Date: Sun, 25 Sep 2022 13:30:13 +1000 Subject: PHP8.1 fixes from Rector --- templates/themes/basic/info.php | 38 ++++++++------------------------------ templates/themes/basic/theme.php | 7 +------ 2 files changed, 9 insertions(+), 36 deletions(-) (limited to 'templates/themes/basic') diff --git a/templates/themes/basic/info.php b/templates/themes/basic/info.php index 0b8ba98b..982010ef 100644 --- a/templates/themes/basic/info.php +++ b/templates/themes/basic/info.php @@ -1,44 +1,22 @@ 'Site title', - 'name' => 'title', - 'type' => 'text' - ); + $theme['config'][] = ['title' => 'Site title', 'name' => 'title', 'type' => 'text']; - $theme['config'][] = Array( - 'title' => 'Slogan', - 'name' => 'subtitle', - 'type' => 'text', - 'comment' => '(optional)' - ); + $theme['config'][] = ['title' => 'Slogan', 'name' => 'subtitle', 'type' => 'text', 'comment' => '(optional)']; - $theme['config'][] = Array( - 'title' => 'File', - 'name' => 'file', - 'type' => 'text', - 'default' => $config['file_index'], - 'comment' => '(eg. "index.html")' - ); + $theme['config'][] = ['title' => 'File', 'name' => 'file', 'type' => 'text', 'default' => $config['file_index'], 'comment' => '(eg. "index.html")']; - $theme['config'][] = Array( - 'title' => '# of recent entries', - 'name' => 'no_recent', - 'type' => 'text', - 'default' => 0, - 'size' => 3, - 'comment' => '(number of recent news entries to display; "0" is infinite)' - ); + $theme['config'][] = ['title' => '# of recent entries', 'name' => 'no_recent', 'type' => 'text', 'default' => 0, 'size' => 3, 'comment' => '(number of recent news entries to display; "0" is infinite)']; // Unique function name for building everything $theme['build_function'] = 'basic_build'; @@ -47,7 +25,7 @@ if (!function_exists('build_install')) { function build_install($settings) { if (!is_numeric($settings['no_recent']) || $settings['no_recent'] < 0) - return Array(false, '' . utf8tohtml($settings['no_recent']) . ' is not a non-negative integer.'); + return [false, '' . utf8tohtml($settings['no_recent']) . ' is not a non-negative integer.']; } } diff --git a/templates/themes/basic/theme.php b/templates/themes/basic/theme.php index 6ba09ce6..4d79d73f 100644 --- a/templates/themes/basic/theme.php +++ b/templates/themes/basic/theme.php @@ -28,12 +28,7 @@ $query = query("SELECT * FROM ``news`` ORDER BY `time` DESC" . ($settings['no_recent'] ? ' LIMIT ' . $settings['no_recent'] : '')) or error(db_error()); $news = $query->fetchAll(PDO::FETCH_ASSOC); - return Element('themes/basic/index.html', Array( - 'settings' => $settings, - 'config' => $config, - 'boardlist' => createBoardlist(), - 'news' => $news - )); + return Element('themes/basic/index.html', ['settings' => $settings, 'config' => $config, 'boardlist' => createBoardlist(), 'news' => $news]); } }; -- cgit v1.3