1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-01-19 01:24:05 +01:00

allow wildcard for catalog theme

This commit is contained in:
Lorenzo Yario 2024-07-14 03:26:06 -07:00 committed by GitHub
parent 89a31794d9
commit dba38b10d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,15 @@
<?php <?php
require 'info.php'; require 'info.php';
function get_all_boards() {
$boards = [];
$query = query("SELECT uri FROM ``boards``") or error(db_error());
while ($board = $query->fetch(PDO::FETCH_ASSOC)) {
$boards[] = $board['uri'];
}
return $boards;
}
function catalog_build($action, $settings, $board) { function catalog_build($action, $settings, $board) {
global $config; global $config;
@ -13,6 +22,11 @@
$boards = explode(' ', $settings['boards']); $boards = explode(' ', $settings['boards']);
if (in_array('*', $boards)) {
$boards = get_all_boards();
}
if ($action == 'all') { if ($action == 'all') {
foreach ($boards as $board) { foreach ($boards as $board) {
$b = new Catalog(); $b = new Catalog();