make pages >500 visible to logged-in users
This commit is contained in:
parent
c5aba18470
commit
eb3cc73bce
@ -233,7 +233,7 @@ class Index extends Extension
|
|||||||
|
|
||||||
public function onPageRequest(PageRequestEvent $event)
|
public function onPageRequest(PageRequestEvent $event)
|
||||||
{
|
{
|
||||||
global $database, $page;
|
global $database, $page, $user;
|
||||||
if ($event->page_matches("post/list")) {
|
if ($event->page_matches("post/list")) {
|
||||||
if (isset($_GET['search'])) {
|
if (isset($_GET['search'])) {
|
||||||
// implode(explode()) to resolve aliases and sanitise
|
// implode(explode()) to resolve aliases and sanitise
|
||||||
@ -260,6 +260,7 @@ class Index extends Extension
|
|||||||
$images = [];
|
$images = [];
|
||||||
|
|
||||||
if (SPEED_HAX) {
|
if (SPEED_HAX) {
|
||||||
|
if (!$user->can("big_search")) {
|
||||||
$fast_page_limit = 500;
|
$fast_page_limit = 500;
|
||||||
if ($total_pages > $fast_page_limit) $total_pages = $fast_page_limit;
|
if ($total_pages > $fast_page_limit) $total_pages = $fast_page_limit;
|
||||||
if ($page_number > $fast_page_limit) {
|
if ($page_number > $fast_page_limit) {
|
||||||
@ -269,7 +270,9 @@ class Index extends Extension
|
|||||||
"if you want to find older results, use more specific search terms"
|
"if you want to find older results, use more specific search terms"
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
} elseif ($count_search_terms === 0 && ($page_number < 10)) {
|
}
|
||||||
|
}
|
||||||
|
if ($count_search_terms === 0 && ($page_number < 10)) {
|
||||||
// extra caching for the first few post/list pages
|
// extra caching for the first few post/list pages
|
||||||
$images = $database->cache->get("post-list:$page_number");
|
$images = $database->cache->get("post-list:$page_number");
|
||||||
if (!$images) {
|
if (!$images) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user