summaryrefslogtreecommitdiff
path: root/templates/themes/categories
diff options
context:
space:
mode:
authorAppleman1234 <applemansigloo@gmail.com>2022-09-25 13:30:13 +1000
committerAppleman1234 <applemansigloo@gmail.com>2022-09-25 13:30:13 +1000
commit2c69095a1edf7474073451285238659d0f62ce3f (patch)
tree5dee476605402c66dc2853d0836b29f6aedae62b /templates/themes/categories
parente9a61e2fbbd930eaa80d6a5f33420cedc59d748c (diff)
PHP8.1 fixes from Rector
Diffstat (limited to 'templates/themes/categories')
-rw-r--r--templates/themes/categories/info.php47
-rw-r--r--templates/themes/categories/theme.php17
2 files changed, 14 insertions, 50 deletions
diff --git a/templates/themes/categories/info.php b/templates/themes/categories/info.php
index 62d8f6bb..003d30a5 100644
--- a/templates/themes/categories/info.php
+++ b/templates/themes/categories/info.php
@@ -1,8 +1,8 @@
<?php
- $theme = Array();
+ $theme = [];
// Theme name
- $theme['name'] = 'Categories';
+ $theme['name'] = \Categories::class;
// Description (you can use Tinyboard markup here)
$theme['description'] =
'Group-ordered, category-aware modification of the Frameset theme, with removable sidebar frame.
@@ -11,44 +11,17 @@ Requires $config[\'categories\'].';
$theme['version'] = 'v0.3';
// Theme configuration
- $theme['config'] = Array();
+ $theme['config'] = [];
- $theme['config'][] = Array(
- 'title' => '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' => 'Main HTML file',
- 'name' => 'file_main',
- 'type' => 'text',
- 'default' => $config['file_index'],
- 'comment' => '(eg. "index.html")'
- );
+ $theme['config'][] = ['title' => 'Main HTML file', 'name' => 'file_main', 'type' => 'text', 'default' => $config['file_index'], 'comment' => '(eg. "index.html")'];
- $theme['config'][] = Array(
- 'title' => 'Sidebar file',
- 'name' => 'file_sidebar',
- 'type' => 'text',
- 'default' => 'sidebar.html',
- 'comment' => '(eg. "sidebar.html")'
- );
+ $theme['config'][] = ['title' => 'Sidebar file', 'name' => 'file_sidebar', 'type' => 'text', 'default' => 'sidebar.html', 'comment' => '(eg. "sidebar.html")'];
- $theme['config'][] = Array(
- 'title' => 'News file',
- 'name' => 'file_news',
- 'type' => 'text',
- 'default' => 'news.html',
- 'comment' => '(eg. "news.html")'
- );
+ $theme['config'][] = ['title' => 'News file', 'name' => 'file_news', 'type' => 'text', 'default' => 'news.html', 'comment' => '(eg. "news.html")'];
// Unique function name for building everything
$theme['build_function'] = 'categories_build';
@@ -59,8 +32,8 @@ Requires $config[\'categories\'].';
global $config;
if (!isset($config['categories'])) {
- return Array(false, '<h2>Prerequisites not met!</h2>' .
- 'This theme requires $config[\'boards\'] and $config[\'categories\'] to be set.');
+ return [false, '<h2>Prerequisites not met!</h2>' .
+ 'This theme requires $config[\'boards\'] and $config[\'categories\'] to be set.'];
}
}
}
diff --git a/templates/themes/categories/theme.php b/templates/themes/categories/theme.php
index 1ccfe451..d76fd7fc 100644
--- a/templates/themes/categories/theme.php
+++ b/templates/themes/categories/theme.php
@@ -29,7 +29,7 @@
public static function homepage($settings) {
global $config;
- return Element('themes/categories/frames.html', Array('config' => $config, 'settings' => $settings));
+ return Element('themes/categories/frames.html', ['config' => $config, 'settings' => $settings]);
}
// Build news page
@@ -39,12 +39,7 @@
$query = query("SELECT * FROM ``news`` ORDER BY `time` DESC") or error(db_error());
$news = $query->fetchAll(PDO::FETCH_ASSOC);
- return Element('themes/categories/news.html', Array(
- 'settings' => $settings,
- 'config' => $config,
- 'news' => $news,
- 'boardlist' => createBoardlist(false)
- ));
+ return Element('themes/categories/news.html', ['settings' => $settings, 'config' => $config, 'news' => $news, 'boardlist' => createBoardlist(false)]);
}
// Build sidebar
@@ -58,15 +53,11 @@
$title = boardTitle($board);
if (!$title)
$title = $board; // board doesn't exist, but for some reason you want to display it anyway
- $board = Array('title' => $title, 'uri' => sprintf($config['board_path'], $board));
+ $board = ['title' => $title, 'uri' => sprintf($config['board_path'], $board)];
}
}
- return Element('themes/categories/sidebar.html', Array(
- 'settings' => $settings,
- 'config' => $config,
- 'categories' => $categories
- ));
+ return Element('themes/categories/sidebar.html', ['settings' => $settings, 'config' => $config, 'categories' => $categories]);
}
};