RSS for search results
git-svn-id: file:///home/shish/svn/shimmie2/trunk@644 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
64b9e1e25a
commit
f0615591ec
@ -8,16 +8,28 @@ class RSS_Images extends Extension {
|
|||||||
global $config;
|
global $config;
|
||||||
$title = $config->get_string('title');
|
$title = $config->get_string('title');
|
||||||
|
|
||||||
|
if(count($event->search_terms) > 0) {
|
||||||
|
$search = implode(' ', $event->search_terms);
|
||||||
|
$page->add_header("<link rel=\"alternate\" type=\"application/rss+xml\" ".
|
||||||
|
"title=\"$title - Images with tags: $search\" href=\"".make_link("rss/images/$search")."\" />");
|
||||||
|
}
|
||||||
|
else {
|
||||||
$page->add_header("<link rel=\"alternate\" type=\"application/rss+xml\" ".
|
$page->add_header("<link rel=\"alternate\" type=\"application/rss+xml\" ".
|
||||||
"title=\"$title - Images\" href=\"".make_link("rss/images")."\" />");
|
"title=\"$title - Images\" href=\"".make_link("rss/images")."\" />");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(is_a($event, 'PageRequestEvent') && ($event->page_name == "rss")) {
|
if(is_a($event, 'PageRequestEvent') && ($event->page_name == "rss")) {
|
||||||
if($event->get_arg(0) == 'images') {
|
if($event->get_arg(0) == 'images') {
|
||||||
global $database;
|
global $database;
|
||||||
|
if($event->count_args() >= 2) {
|
||||||
|
$this->do_rss($database->get_images(0, 12, tag_explode($event->get_arg(1))));
|
||||||
|
}
|
||||||
|
else {
|
||||||
$this->do_rss($database->get_images(0, 12));
|
$this->do_rss($database->get_images(0, 12));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// }}}
|
// }}}
|
||||||
// output {{{
|
// output {{{
|
||||||
private function do_rss($images) {
|
private function do_rss($images) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user