* License: GPLv2 * Description: Self explanitory */ class RSS_Images extends Extension { // event handling {{{ public function receive_event($event) { if(is_a($event, 'PostListBuildingEvent')) { global $page; global $config; $title = $config->get_string('title'); if(count($event->search_terms) > 0) { $search = implode(' ', $event->search_terms); $page->add_header(""); } else { $page->add_header(""); } } if(is_a($event, 'PageRequestEvent') && ($event->page_name == "rss")) { if($event->get_arg(0) == 'images') { 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)); } } } } // }}} // output {{{ private function do_rss($images) { global $page; global $config; $page->set_mode("data"); $page->set_type("application/xml"); $data = ""; foreach($images as $image) { $link = make_link("post/view/{$image->id}"); $tags = $image->get_tag_list(); $owner = $image->get_owner(); $posted = strftime("%a, %d %b %Y %T %Z", $image->posted_timestamp); $content = html_escape( "
" . Themelet::build_thumb_html($image) . "
" . "Uploaded by " . $owner->name . "
" ); $data .= "