feat(widgets): forum tabs shared hot payload + terms/boards ajax

Route multi-tab forum topics through HotTopics mini/rank payload and
WidgetAjax style/plate params; wire terms/boards to real REST ajaxpager.
This commit is contained in:
kate522 committed 2026-07-21 11:17:01 +08:00
1 parent a6d02a8592
commit 11920a2dc6
4 files changed
+64 -15

No files matched your search

+6
View File
@@ -204,10 +204,16 @@ class WidgetAjax {
if (!class_exists('\AKSRT\Widgets\WidgetForumHotTopics')) {
return $this->fail();
}
$style = sanitize_key((string) ($request->get_param('style') ?? 'mini'));
if (!in_array($style, ['mini', 'rank'], true)) {
$style = 'mini';
}
$instance = [
'count' => max(1, min(20, (int) ($request->get_param('count') ?? 5))),
'period' => sanitize_key((string) ($request->get_param('period') ?? 'week')),
'orderby' => sanitize_key((string) ($request->get_param('orderby') ?? 'views')),
'style' => $style,
'plate' => max(0, (int) ($request->get_param('plate') ?? $request->get_param('plate_id') ?? 0)),
'paginate' => sanitize_key((string) ($request->get_param('paginate') ?? 'ajax')),
];
$page = max(1, (int) ($request->get_param('page') ?? 1));