diff --git a/ext/index/main.php b/ext/index/main.php
index bd4f3e30..0aadaf2b 100644
--- a/ext/index/main.php
+++ b/ext/index/main.php
@@ -121,8 +121,8 @@
*
Notes
*
* - notes (=, <, >, <=, >=) number -- search by the number of notes an image has
- *
- notes_by=Username -- search for a notes created by username
- *
- notes_by_userno=UserID -- search for a notes created by userID
+ *
- notes_by=Username -- search for images contains notes created by username
+ *
- notes_by_userno=UserID -- search for images contains notes created by userID
*
* Artists
*
@@ -131,8 +131,13 @@
* - Image Comments
*
* - comments (=, <, >, <=, >=) number -- search for images by number of comments
- *
- commented_by=Username -- search for a user's comments by username
- *
- commented_by_userno=UserID -- search for a user's comments by userID
+ *
- commented_by=Username -- search for images contains user's comments by username
+ *
- commented_by_userno=UserID -- search for images contains user's comments by userID
+ *
+ * - Pools
+ *
+ * - pool=PoolID -- search for images in a pool by PoolID
+ *
- pool_by_name=PoolName -- search for images in a pool by PoolName. underscores are replaced with spaces
*
*
*/
diff --git a/ext/pools/main.php b/ext/pools/main.php
index 008838d3..8431a653 100644
--- a/ext/pools/main.php
+++ b/ext/pools/main.php
@@ -293,6 +293,22 @@ class Pools extends Extension {
}
}
+ public function onSearchTermParse(SearchTermParseEvent $event) {
+ $matches = array();
+ if(preg_match("/^pool[=|:]([0-9]+)$/", $event->term, $matches)) {
+ $poolID = $matches[1];
+ $event->add_querylet(new Querylet("images.id IN (SELECT DISTINCT image_id FROM pool_images WHERE pool_id = $poolID)"));
+ }
+ else if(preg_match("/^pool_by_name[=|:](.*)$/", $event->term, $matches)) {
+ $poolTitle = str_replace("_", " ", $matches[1]);
+
+ $pool = $this->get_single_pool_from_title($poolTitle);
+ $poolID = 0;
+ if ($pool){ $poolID = $pool['id']; }
+ $event->add_querylet(new Querylet("images.id IN (SELECT DISTINCT image_id FROM pool_images WHERE pool_id = $poolID)"));
+ }
+ }
+
public function add_post_from_tag(/*str*/ $poolTag, /*int*/ $imageID){
$poolTag = str_replace("_", " ", $poolTag);
//First check if pool tag is a title