diff --git a/app/Filament/Resources/Section/SectionResource.php b/app/Filament/Resources/Section/SectionResource.php index 23d0f46f..37db01bb 100644 --- a/app/Filament/Resources/Section/SectionResource.php +++ b/app/Filament/Resources/Section/SectionResource.php @@ -79,6 +79,7 @@ class SectionResource extends Resource Forms\Components\CheckboxList::make('custom_fields') ->options(TorrentCustomField::getCheckboxOptions()) ->label(__('label.search_box.custom_fields')) + ->columns(4) , Forms\Components\TextInput::make('custom_fields_display_name') ->label(__('label.search_box.custom_fields_display_name')) diff --git a/app/Models/SearchBox.php b/app/Models/SearchBox.php index 06950b86..c336855c 100644 --- a/app/Models/SearchBox.php +++ b/app/Models/SearchBox.php @@ -87,7 +87,7 @@ class SearchBox extends NexusModel $other = $data['other'] ?? []; $data["extra->" . self::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST] = in_array(self::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST, $other) ? 1 : 0; $data["extra->" . self::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST] = in_array(self::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST, $other) ? 1 : 0; - + $data['custom_fields'] = array_filter($data['custom_fields']); return $data; } diff --git a/app/Models/TorrentCustomField.php b/app/Models/TorrentCustomField.php index d80f713d..a3366853 100644 --- a/app/Models/TorrentCustomField.php +++ b/app/Models/TorrentCustomField.php @@ -8,6 +8,8 @@ class TorrentCustomField extends NexusModel { protected $table = 'torrents_custom_fields'; + public $timestamps = true; + protected $fillable = [ 'name', 'label', 'type', 'required', 'is_single_row', 'options', 'help', 'display', 'priority' ]; @@ -21,7 +23,5 @@ class TorrentCustomField extends NexusModel } return $result; } - public $timestamps = true; - } diff --git a/include/functions.php b/include/functions.php index 5f16eb78..ab1af39a 100644 --- a/include/functions.php +++ b/include/functions.php @@ -6063,8 +6063,19 @@ function build_search_box_category_table($mode, $checkboxValue, $categoryHrefPre foreach ($chunk as $item) { if ($item->mode != -1) { $checked = ''; - if (str_contains($checkedValues, "[cat{$item->id}]") || str_contains($checkedValues, "cat{$item->id}=1")) { - $checked = " checked"; + if ($checkedValues) { + if ( + str_contains($checkedValues, "[cat{$item->id}]") + || str_contains($checkedValues, "cat{$item->id}=1") + || str_contains($checkedValues, "cat={$item->id}") + ) { + $checked = " checked"; + } + } elseif (!empty($options['user_notifs'])) { + $userNotifsKey = sprintf('[%s%s]', 'cat', $item->id); + if (str_contains($options['user_notifs'], $userNotifsKey)) { + $checked = ' checked'; + } } $icon = $item->icon; $iconFolder = trim($icon->folder, '/'); @@ -6126,8 +6137,14 @@ TD; $afterInput = $item->name; } $checked = ''; - if (str_contains($checkedValues, "[{$namePrefix}{$item->id}]") || str_contains($checkedValues, "{$namePrefix}{$item->id}=1")) { - $checked = ' checked'; + if ($checkedValues) { + if ( + str_contains($checkedValues, "[{$namePrefix}{$item->id}]") + || str_contains($checkedValues, "{$namePrefix}{$item->id}=1") + || str_contains($checkedValues, "{$namePrefix}={$item->id}") + ) { + $checked = ' checked'; + } } elseif (!empty($options['user_notifs'])) { $userNotifsKey = sprintf('[%s%s]', substr($torrentField, 0, 3), $item->id); if (str_contains($options['user_notifs'], $userNotifsKey)) { diff --git a/public/complains.php b/public/complains.php index 9c994922..71fd3744 100644 --- a/public/complains.php +++ b/public/complains.php @@ -110,9 +110,11 @@ if($_SERVER['REQUEST_METHOD'] === 'POST'){ begin_frame($lang_complains['text_new_body']); printf('%s:%s
%s %s', $lang_complains['text_added'], gettime($complain['added']), $lang_complains['text_new_email'], htmlspecialchars($complain['email'])); if($isAdmin) { - printf(' [%s]', urlencode($complain['email']), $lang_complains['text_search_account']); if ($user) { + printf(' [%s]', $user->id, $user->username); printf(' [%s]', urlencode($user->username), $lang_complains['text_view_band_log']); + } else { + printf(' [%s]', urlencode($complain['email']), $lang_complains['text_search_account']); } printf('
IP: ' . htmlspecialchars($complain['ip'])); } diff --git a/public/js/common.js b/public/js/common.js index 66baa26d..70726393 100644 --- a/public/js/common.js +++ b/public/js/common.js @@ -308,7 +308,7 @@ function SetChecked(chkName,ctrlName,checkall_name,uncheckall_name,start,count) } for( i=begin ; i