get_string(SetupConfig::TITLE);
if (count($event->search_terms) > 0) {
$search = url_escape(Tag::implode($event->search_terms));
$page->add_html_header("");
} else {
$page->add_html_header("");
}
}
public function onPageRequest(PageRequestEvent $event): void
{
if ($event->page_matches("rss/images")) {
$search_terms = $event->get_search_terms();
$page_number = $event->get_page_number();
$page_size = $event->get_page_size();
if (SPEED_HAX && $page_number > 9) {
return;
}
try {
$images = Search::find_images(($page_number - 1) * $page_size, $page_size, $search_terms);
$this->do_rss($images, $search_terms, $page_number);
} catch (SearchTermParseException $stpe) {
$this->theme->display_error(400, "Search parse error", $stpe->error);
} catch (PermissionDeniedException $pde) {
$this->theme->display_error(403, "Permission denied", $pde->error);
}
}
}
public function onImageInfoSet(ImageInfoSetEvent $event): void
{
global $cache;
$cache->delete("rss-item-image:{$event->image->id}");
}
private function do_rss(array $images, array $search_terms, int $page_number)
{
global $page;
global $config;
$page->set_mode(PageMode::DATA);
$page->set_mime(MimeType::RSS);
$data = "";
foreach ($images as $image) {
$data .= $this->thumb($image);
}
$title = $config->get_string(SetupConfig::TITLE);
$base_href = make_http(get_base_href());
$search = "";
if (count($search_terms) > 0) {
$search = url_escape(Tag::implode($search_terms)) . "/";
}
if ($page_number > 1) {
$prev_url = make_link("rss/images/$search".($page_number - 1));
$prev_link = "
" . $this->theme->build_thumb_html($image) . "
" . "