From b1d1d71093066a7b55eea622fc96328d36b1a88c Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 18 Jan 2012 17:53:52 +0000 Subject: [PATCH] author search from nagel --- contrib/artists/main.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/contrib/artists/main.php b/contrib/artists/main.php index e4a5a803..c86a8e10 100644 --- a/contrib/artists/main.php +++ b/contrib/artists/main.php @@ -43,6 +43,14 @@ class Artists implements Extension { if ($event instanceof PageRequestEvent) $this->handle_commands($event); + + if ($event instanceof SearchTermParseEvent) { + $matches = array(); + if(preg_match("/^author=(.*)$/", $event->term, $matches)) { + $char = $matches[1]; + $event->add_querylet(new Querylet("Author = :author_char", array("author_char"=>$char))); + } + } } public function try_install() {