mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Template/Update (Part 16)
* convert amalgamation utility.php into separate endpoints
This commit is contained in:
46
endpoints/latest-comments/latest-comments.php
Normal file
46
endpoints/latest-comments/latest-comments.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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 . '&rss' . (Lang::getLocale()->value ? '&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]);
|
||||
$this->lvTabs->addListviewTab(new Listview(['data' => $comments], 'commentpreview'));
|
||||
|
||||
$replies = CommunityContent::getCommentPreviews(['comments' => false, 'replies' => true]);
|
||||
$this->lvTabs->addListviewTab(new Listview(['data' => $replies], 'replypreview'));
|
||||
|
||||
parent::generate();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
34
endpoints/latest-comments/latest-comments_rss.php
Normal file
34
endpoints/latest-comments/latest-comments_rss.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
class LatestcommentsRssResponse extends TextResponse
|
||||
{
|
||||
use TrRss;
|
||||
|
||||
protected string $contentType = MIME_TYPE_RSS;
|
||||
|
||||
protected function generate() : void
|
||||
{
|
||||
foreach (CommunityContent::getCommentPreviews(dateFmt: false) as $comment)
|
||||
{
|
||||
// todo (low): preview should be html-formated
|
||||
$this->feedData[] = array(
|
||||
'title' => [true, [], Lang::typeName($comment['type']).Lang::main('colon').htmlentities($comment['subject'])],
|
||||
'link' => [false, [], Cfg::get('HOST_URL').'/?go-to-comment&id='.$comment['id']],
|
||||
'description' => [true, [], htmlentities($comment['preview'])."<br /><br />".Lang::main('byUser', [$comment['user'], '']) . Util::formatTimeDiff($comment['date'])],
|
||||
'pubDate' => [false, [], date(DATE_RSS, $comment['date'])],
|
||||
'guid' => [false, [], Cfg::get('HOST_URL').'/?go-to-comment&id='.$comment['id']]
|
||||
// 'domain' => [false, [], null]
|
||||
);
|
||||
}
|
||||
|
||||
$this->result = $this->generateRSS(Lang::main('utilities', 2), 'latest-comments');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
43
endpoints/latest-screenshots/latest-screenshots.php
Normal file
43
endpoints/latest-screenshots/latest-screenshots.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
class LatestscreenshotsBaseResponse extends TemplateResponse
|
||||
{
|
||||
protected string $template = 'list-page-generic';
|
||||
protected string $pageName = 'latest-screenshots';
|
||||
protected ?int $activeTab = parent::TAB_TOOLS;
|
||||
protected array $breadcrumb = [1, 8, 3]; // Tools > Util > Latest Screenshots
|
||||
|
||||
protected function generate() : void
|
||||
{
|
||||
$this->h1 = Lang::main('utilities', 3);
|
||||
$this->h1Link = '?'.$this->pageName.'&rss' . (Lang::getLocale()->value ? '&locale='.Lang::getLocale()->value : '');
|
||||
$this->rss = Cfg::get('HOST_URL').'/?' . $this->pageName . '&rss' . (Lang::getLocale()->value ? '&locale='.Lang::getLocale()->value : '');
|
||||
|
||||
|
||||
/*********/
|
||||
/* Title */
|
||||
/*********/
|
||||
|
||||
array_unshift($this->title, $this->h1);
|
||||
|
||||
|
||||
/****************/
|
||||
/* Main Content */
|
||||
/****************/
|
||||
|
||||
$this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]);
|
||||
|
||||
$data = CommunityContent::getScreenshots();
|
||||
$this->lvTabs->addListviewTab(new Listview(['data' => $data], 'screenshot'));
|
||||
|
||||
parent::generate();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
40
endpoints/latest-screenshots/latest-screenshots_rss.php
Normal file
40
endpoints/latest-screenshots/latest-screenshots_rss.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
class LatestscreenshotsRssResponse extends TextResponse
|
||||
{
|
||||
use TrRss;
|
||||
|
||||
protected string $contentType = MIME_TYPE_RSS;
|
||||
|
||||
protected function generate() : void
|
||||
{
|
||||
foreach (CommunityContent::getScreenshots(dateFmt: false) as $screenshot)
|
||||
{
|
||||
$desc = '<a href="'.Cfg::get('HOST_URL').'/?'.Type::getFileString($screenshot['type']).'='.$screenshot['typeId'].'#screenshots:id='.$screenshot['id'].'"><img src="'.Cfg::get('STATIC_URL').'/uploads/screenshots/thumb/'.$screenshot['id'].'.jpg" alt="" /></a>';
|
||||
if ($screenshot['caption'])
|
||||
$desc .= '<br />'.$screenshot['caption'];
|
||||
$desc .= "<br /><br />".Lang::main('byUser', [$screenshot['user'], '']) . Util::formatTimeDiff($screenshot['date'], true);
|
||||
|
||||
// enclosure/length => filesize('static/uploads/screenshots/thumb/'.$screenshot['id'].'.jpg') .. always set to this placeholder value though
|
||||
$this->feedData[] = array(
|
||||
'title' => [true, [], Lang::typeName($screenshot['type']).Lang::main('colon').htmlentities($screenshot['subject'])],
|
||||
'link' => [false, [], Cfg::get('HOST_URL').'/?'.Type::getFileString($screenshot['type']).'='.$screenshot['typeId'].'#screenshots:id='.$screenshot['id']],
|
||||
'description' => [true, [], $desc],
|
||||
'pubDate' => [false, [], date(DATE_RSS, $screenshot['date'])],
|
||||
'enclosure' => [false, ['url' => Cfg::get('STATIC_URL').'/uploads/screenshots/thumb/'.$screenshot['id'].'.jpg', 'length' => 12345, 'type' => 'image/jpeg'], null],
|
||||
'guid' => [false, [], Cfg::get('HOST_URL').'/?'.Type::getFileString($screenshot['type']).'='.$screenshot['typeId'].'#screenshots:id='.$screenshot['id']],
|
||||
// 'domain' => [false, [], live|ptr]
|
||||
);
|
||||
}
|
||||
|
||||
$this->result = $this->generateRSS(Lang::main('utilities', 3), 'latest-screenshots');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
43
endpoints/latest-videos/latest-videos.php
Normal file
43
endpoints/latest-videos/latest-videos.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
class LatestvideosBaseResponse extends TemplateResponse
|
||||
{
|
||||
protected string $template = 'list-page-generic';
|
||||
protected string $pageName = 'latest-videos';
|
||||
protected ?int $activeTab = parent::TAB_TOOLS;
|
||||
protected array $breadcrumb = [1, 8, 11]; // Tools > Util > Latest Videos
|
||||
|
||||
protected function generate() : void
|
||||
{
|
||||
$this->h1 = Lang::main('utilities', 11);
|
||||
$this->h1Link = '?'.$this->pageName.'&rss' . (Lang::getLocale()->value ? '&locale='.Lang::getLocale()->value : '');
|
||||
$this->rss = Cfg::get('HOST_URL').'/?' . $this->pageName . '&rss' . (Lang::getLocale()->value ? '&locale='.Lang::getLocale()->value : '');
|
||||
|
||||
|
||||
/*********/
|
||||
/* Title */
|
||||
/*********/
|
||||
|
||||
array_unshift($this->title, $this->h1);
|
||||
|
||||
|
||||
/****************/
|
||||
/* Main Content */
|
||||
/****************/
|
||||
|
||||
$this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]);
|
||||
|
||||
$data = CommunityContent::getVideos();
|
||||
$this->lvTabs->addListviewTab(new Listview(['data' => $data], 'video'));
|
||||
|
||||
parent::generate();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
40
endpoints/latest-videos/latest-videos_rss.php
Normal file
40
endpoints/latest-videos/latest-videos_rss.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
class LatestvideosRssResponse extends TextResponse
|
||||
{
|
||||
use TrRss;
|
||||
|
||||
protected string $contentType = MIME_TYPE_RSS;
|
||||
|
||||
protected function generate() : void
|
||||
{
|
||||
foreach (CommunityContent::getvideos(dateFmt: false) as $video)
|
||||
{
|
||||
$desc = '<a href="'.Cfg::get('HOST_URL').'/?'.Type::getFileString($video['type']).'='.$video['typeId'].'#videos:id='.$video['id'].'"><img src="//i3.ytimg.com/vi/'.$video['videoId'].'/default.jpg" alt="" /></a>';
|
||||
if ($video['caption'])
|
||||
$desc .= '<br />'.$video['caption'];
|
||||
$desc .= "<br /><br />".Lang::main('byUser', [$video['user'], '']) . Util::formatTimeDiff($video['date'], true);
|
||||
|
||||
// is enclosure/length .. is this even relevant..?
|
||||
$this->feedData[] = array(
|
||||
'title' => [true, [], Lang::typeName($video['type']).Lang::main('colon').htmlentities($video['subject'])],
|
||||
'link' => [false, [], Cfg::get('HOST_URL').'/?'.Type::getFileString($video['type']).'='.$video['typeId'].'#videos:id='.$video['id']],
|
||||
'description' => [true, [], $desc],
|
||||
'pubDate' => [false, [], date(DATE_RSS, $video['date'])],
|
||||
'enclosure' => [false, ['url' => '//i3.ytimg.com/vi/'.$video['videoId'].'/default.jpg', 'length' => 12345, 'type' => 'image/jpeg'], null],
|
||||
'guid' => [false, [], Cfg::get('HOST_URL').'/?'.Type::getFileString($video['type']).'='.$video['typeId'].'#videos:id='.$video['id']],
|
||||
// 'domain' => [false, [], live|ptr]
|
||||
);
|
||||
}
|
||||
|
||||
$this->result = $this->generateRSS(Lang::main('utilities', 11), 'latest-videos');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
58
endpoints/missing-screenshots/missing-screenshots.php
Normal file
58
endpoints/missing-screenshots/missing-screenshots.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
class MissingscreenshotsBaseResponse extends TemplateResponse
|
||||
{
|
||||
protected string $template = 'list-page-generic';
|
||||
protected string $pageName = 'missing-screenshots';
|
||||
protected ?int $activeTab = parent::TAB_TOOLS;
|
||||
protected array $breadcrumb = [1, 8, 13]; // Tools > Util > Missing Screenshots
|
||||
|
||||
protected function generate() : void
|
||||
{
|
||||
$this->h1 = Lang::main('utilities', 13);
|
||||
|
||||
|
||||
/*********/
|
||||
/* Title */
|
||||
/*********/
|
||||
|
||||
array_unshift($this->title, $this->h1);
|
||||
|
||||
|
||||
/****************/
|
||||
/* Main Content */
|
||||
/****************/
|
||||
|
||||
$this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]);
|
||||
|
||||
// limit to 200 entries each (it generates faster, consumes less memory and should be enough options)
|
||||
$cnd = [[['cuFlags', CUSTOM_HAS_SCREENSHOT, '&'], 0], 200];
|
||||
if (!User::isInGroup(U_GROUP_EMPLOYEE))
|
||||
$cnd[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
|
||||
|
||||
$hasTabs = false;
|
||||
foreach (Type::getClassesFor(Type::FLAG_RANDOM_SEARCHABLE, 'contribute', CONTRIBUTE_SS) as $classStr)
|
||||
{
|
||||
$typeObj = new $classStr($cnd);
|
||||
if ($typeObj->error)
|
||||
continue;
|
||||
|
||||
$this->extendGlobalData($typeObj->getJSGlobals(GLOBALINFO_ANY));
|
||||
$this->lvTabs->addListviewTab(new Listview(['data' => $typeObj->getListviewData()], $typeObj::$brickFile));
|
||||
$hasTabs = true;
|
||||
}
|
||||
|
||||
if (!$hasTabs)
|
||||
$this->lvTabs->addListviewTab(new Listview(['data' => []], 'item'));
|
||||
|
||||
parent::generate();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
110
endpoints/most-comments/most-comments.php
Normal file
110
endpoints/most-comments/most-comments.php
Normal file
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
class MostcommentsBaseResponse extends TemplateResponse
|
||||
{
|
||||
protected string $template = 'list-page-generic';
|
||||
protected string $pageName = 'most-comments';
|
||||
protected ?int $activeTab = parent::TAB_TOOLS;
|
||||
protected array $breadcrumb = [1, 8, 12]; // Tools > Util > Most Comments
|
||||
|
||||
protected array $validCats = [1, 7, 30];
|
||||
|
||||
public function __construct($pageParam)
|
||||
{
|
||||
$this->getCategoryFromUrl($pageParam);
|
||||
|
||||
parent::__construct($pageParam);
|
||||
}
|
||||
|
||||
protected function onInvalidCategory() : never
|
||||
{
|
||||
$this->forward('?most-comments=1');
|
||||
}
|
||||
|
||||
protected function generate() : void
|
||||
{
|
||||
$this->h1 = Lang::main('utilities', 12);
|
||||
if ($this->category && $this->category[0] > 1)
|
||||
$this->h1 .= Lang::main('colon') . Lang::main('mostComments', 1, $this->category);
|
||||
else
|
||||
$this->h1 .= Lang::main('colon') . Lang::main('mostComments', 0);
|
||||
|
||||
$this->h1Link = '?' . $this->pageName.($this->category ? '='.$this->category[0] : '').'&rss' . (Lang::getLocale()->value ? '&locale='.Lang::getLocale()->value : '');
|
||||
$this->rss = Cfg::get('HOST_URL').'/?' . $this->pageName.($this->category ? '='.$this->category[0] : '') . '&rss' . (Lang::getLocale()->value ? '&locale='.Lang::getLocale()->value : '');
|
||||
|
||||
|
||||
/*********/
|
||||
/* Title */
|
||||
/*********/
|
||||
|
||||
array_unshift($this->title, $this->h1);
|
||||
|
||||
|
||||
/**************/
|
||||
/* Breadcrumb */
|
||||
/**************/
|
||||
|
||||
$this->breadcrumb[] = $this->category[0] ?? 1;
|
||||
|
||||
|
||||
/****************/
|
||||
/* Main Content */
|
||||
/****************/
|
||||
|
||||
$this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"], __forceTabs: true);
|
||||
|
||||
$tabBase = array(
|
||||
'extraCols' => ["\$Listview.funcBox.createSimpleCol('ncomments', 'tab_comments', '10%', 'ncomments')"],
|
||||
'sort' => ['-ncomments']
|
||||
);
|
||||
|
||||
$hasTabs = false;
|
||||
foreach (Type::getClassesFor() as $type => $classStr)
|
||||
{
|
||||
$comments = DB::Aowow()->selectCol(
|
||||
'SELECT `typeId` AS ARRAY_KEY, COUNT(1) FROM ?_comments
|
||||
WHERE `replyTo` = 0 AND (`flags` & ?d) = 0 AND `type`= ?d AND `date` > (UNIX_TIMESTAMP() - ?d)
|
||||
GROUP BY `type`, `typeId`
|
||||
LIMIT 100',
|
||||
CC_FLAG_DELETED,
|
||||
$type,
|
||||
($this->category[0] ?? 1) * DAY
|
||||
);
|
||||
if (!$comments)
|
||||
continue;
|
||||
|
||||
$typeClass = new $classStr(array(['id', array_keys($comments)]));
|
||||
if ($typeClass->error)
|
||||
continue;
|
||||
|
||||
$data = $typeClass->getListviewData();
|
||||
|
||||
foreach ($data as $typeId => &$d)
|
||||
$d['ncomments'] = $comments[$typeId];
|
||||
|
||||
$addIn = '';
|
||||
if (in_array($type, [Type::AREATRIGGER, Type::ENCHANTMENT, Type::ENCHANTMENT, Type::EMOTE]))
|
||||
{
|
||||
$addIn = Type::getFileString($type);
|
||||
$tabBase['name'] = '$LANG.types['.$type.'][2]';
|
||||
}
|
||||
|
||||
$this->extendGlobalData($typeClass->getJSGlobals(GLOBALINFO_ANY));
|
||||
$this->lvTabs->addListviewTab(new Listview($tabBase + ['data' => $data], $typeClass::$brickFile, $addIn));
|
||||
$hasTabs = true;
|
||||
}
|
||||
|
||||
if (!$hasTabs)
|
||||
$this->lvTabs->addListviewTab(new Listview(['data' => []], 'commentpreview'));
|
||||
|
||||
parent::generate();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
63
endpoints/most-comments/most-comments_rss.php
Normal file
63
endpoints/most-comments/most-comments_rss.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
class MostcommentsRssResponse extends TextResponse
|
||||
{
|
||||
use TrRss;
|
||||
|
||||
protected string $contentType = MIME_TYPE_RSS;
|
||||
|
||||
private array $validCats = [1, 7, 30];
|
||||
|
||||
public function __construct($pageParam)
|
||||
{
|
||||
parent::__construct($pageParam);
|
||||
|
||||
if ($this->params && !in_array($this->params[0], $this->validCats))
|
||||
$this->forward('?most-comments=1&rss');
|
||||
}
|
||||
|
||||
protected function generate() : void
|
||||
{
|
||||
foreach (Type::getClassesFor() as $type => $classStr)
|
||||
{
|
||||
$comments = DB::Aowow()->selectCol(
|
||||
'SELECT `typeId` AS ARRAY_KEY, COUNT(1) FROM ?_comments
|
||||
WHERE `replyTo` = 0 AND (`flags` & ?d) = 0 AND `type`= ?d AND `date` > (UNIX_TIMESTAMP() - ?d)
|
||||
GROUP BY `type`, `typeId`
|
||||
LIMIT 100',
|
||||
CC_FLAG_DELETED,
|
||||
$type,
|
||||
($this->category[0] ?? 1) * DAY
|
||||
);
|
||||
if (!$comments)
|
||||
continue;
|
||||
|
||||
$typeClass = new $classStr(array(['id', array_keys($comments)]));
|
||||
if ($typeClass->error)
|
||||
continue;
|
||||
|
||||
$data = $typeClass->getListviewData();
|
||||
|
||||
foreach ($data as $typeId => &$d)
|
||||
{
|
||||
$this->feedData[] = array(
|
||||
'title' => [true, [], htmlentities(Type::getFileString($type) == 'item' ? mb_substr($d['name'], 1) : $d['name'])],
|
||||
'type' => [false, [], Type::getFileString($type)],
|
||||
'link' => [false, [], Cfg::get('HOST_URL').'/?'.Type::getFileString($type).'='.$d['id']],
|
||||
'ncomments' => [false, [], $comments[$typeId]]
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->result = $this->generateRSS(Lang::main('utilities', 12), 'most-comments' . ($this->params ? '='.$this->params[0] : ''));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
48
endpoints/random/random.php
Normal file
48
endpoints/random/random.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
/* note:
|
||||
* WH sends a whole page (empty maincontents)
|
||||
* probably so the whole shebang of tracking providers can insert themselves
|
||||
* also $WH.localStorage.set('showRandomWidget', 'true'); creates a more accessible random button in the topbar on the target page via
|
||||
*
|
||||
if ($WH.localStorage.get("showRandomWidget") == "true") {
|
||||
$WH.localStorage.remove("showRandomWidget");
|
||||
var a = $WH.ce("a");
|
||||
a.className = "topbar-random fa fa-random";
|
||||
a.href = "/random";
|
||||
$WH.Tooltip.simple(a, LANG.anotherrandompage_tip, "q2");
|
||||
X.append(a);
|
||||
}
|
||||
*
|
||||
* in PageTemplate.initTopBar
|
||||
*/
|
||||
class RandomBaseResponse extends TextResponse
|
||||
{
|
||||
// protected string $template = 'text-page-generic';
|
||||
// protected string $pageName = 'random';
|
||||
|
||||
public function generate() : void
|
||||
{
|
||||
// $this->h1 = 'Random Page';
|
||||
// array_unshift($this->title, $this->h1);
|
||||
|
||||
$type = array_rand(Type::getClassesFor(Type::FLAG_RANDOM_SEARCHABLE));
|
||||
$typeId = (Type::newList($type))?->getRandomId();
|
||||
|
||||
$this->redirectTo = '?'.Type::getFileString($type).'='.$typeId;
|
||||
|
||||
// $this->extraHTML = <<<JS
|
||||
// <script type="text/javascript">//<![CDATA[
|
||||
// \$WH.localStorage.set('showRandomWidget', 'true');
|
||||
// location = "?{$type}={$typeId}";
|
||||
// //]]></script>
|
||||
// JS;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
41
endpoints/unrated-comments/unrated-comments.php
Normal file
41
endpoints/unrated-comments/unrated-comments.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
class UnratedcommentsBaseResponse extends TemplateResponse
|
||||
{
|
||||
protected string $pageName = 'unrated-comments';
|
||||
protected string $template = 'list-page-generic';
|
||||
protected ?int $activeTab = parent::TAB_TOOLS;
|
||||
protected array $breadcrumb = [1, 8, 5]; // Tools > Util > Unrated Comments
|
||||
|
||||
protected function generate() : void
|
||||
{
|
||||
$this->h1 = Lang::main('utilities', 5);
|
||||
|
||||
|
||||
/*********/
|
||||
/* Title */
|
||||
/*********/
|
||||
|
||||
array_unshift($this->title, $this->h1);
|
||||
|
||||
|
||||
/****************/
|
||||
/* Main Content */
|
||||
/****************/
|
||||
|
||||
$this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]);
|
||||
|
||||
$data = CommunityContent::getCommentPreviews(['unrated' => true, 'comments' => true]);
|
||||
$this->lvTabs->addListviewTab(new Listview(['data' => $data], 'commentpreview'));
|
||||
|
||||
parent::generate();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user