Image code moved to image class

git-svn-id: file:///home/shish/svn/shimmie2/trunk@1058 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish
2008-10-09 03:21:18 +00:00
parent 8eef694168
commit 072b22ee8f
14 changed files with 97 additions and 102 deletions

View File

@ -11,6 +11,7 @@ class RandomImage implements Extension {
public function receive_event(Event $event) {
if(($event instanceof PageRequestEvent) && $event->page_matches("random_image")) {
global $database;
global $database;
if($event->count_args() == 1) {
$action = $event->get_arg(0);
@ -20,7 +21,7 @@ class RandomImage implements Extension {
$action = $event->get_arg(0);
$search_terms = explode(' ', $event->get_arg(1));
}
$image = $database->get_random_image($search_terms);
$image = Image::by_random($config, $database, $search_terms);
if($event->get_arg(0) == "download") {
if(!is_null($image)) {