aowow/endpoints/latest-comments/latest-comments.php
Sarjuuk c44bf4f575 Config/Misc
* hardcode sql limits within their respective components instead of
   having them configurable
 * creating a new DBTypeList defaults it to being unlimited
   * SQL_LIMIT_NONE (0) > removed as it only existed for consistency
   * SQL_LIMIT_DEFAULT (300) > frontend / Listview::DEFAULT_SIZE
   * SQL_LIMIT_SEARCH (500) > Search::DEFAULT_MAX_RESULTS
   * SQL_LIMIT_QUICKSEARCH (10) > Search::SUGGESTIONS_MAX_RESULTS
2025-12-30 03:20:09 +01:00

46 lines
1.5 KiB
PHP

<?php
namespace Aowow;
if (!defined('AOWOW_REVISION'))
die('illegal access');
class LatestcommentsBaseResponse extends TemplateResponse
{
protected string $template = 'list-page-generic';
protected string $pageName = 'latest-comments';
protected ?int $activeTab = parent::TAB_TOOLS;
protected array $breadcrumb = [1, 8, 2]; // Tools > Util > Latest Comments
protected function generate() : void
{
$this->h1 = Lang::main('utilities', 2);
$this->h1Link = '?'.$this->pageName.'&rss' . (Lang::getLocale()->value ? '&locale='.Lang::getLocale()->value : '');
$this->rss = Cfg::get('HOST_URL').'/?' . $this->pageName . '&amp;rss' . (Lang::getLocale()->value ? '&amp;locale='.Lang::getLocale()->value : '');
/*********/
/* Title */
/*********/
array_unshift($this->title, $this->h1);
/****************/
/* Main Content */
/****************/
$this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]);
$comments = CommunityContent::getCommentPreviews(['comments' => true, 'replies' => false], resultLimit: Listview::DEFAULT_SIZE);
$this->lvTabs->addListviewTab(new Listview(['data' => $comments], 'commentpreview'));
$replies = CommunityContent::getCommentPreviews(['comments' => false, 'replies' => true], resultLimit: Listview::DEFAULT_SIZE);
$this->lvTabs->addListviewTab(new Listview(['data' => $replies], 'replypreview'));
parent::generate();
}
}
?>