5 * Copyright 2004 (c) Dominik Haas, GForge Team
9 * @version $Id: NewsSearchQuery.class,v 1.2 2005/01/28 20:36:44 ruben Exp $
12 require_once $gfcommon.'search/SearchQuery.class.php';
14 class ForumMLSearchQuery extends SearchQuery {
26 * @param string $words words we are searching for
27 * @param int $offset offset
28 * @param boolean $isExact if we want to search for all the words or if only one matching the query is sufficient
29 * @param int $groupId group id
31 function ForumMLSearchQuery($words, $offset, $isExact, $groupId) {
32 $this->groupId = $groupId;
34 $this->SearchQuery($words, $offset, $isExact);
38 * getQuery - get the query built to get the search results
40 * @return array query+params array
44 $pat = '_g'.$this->groupId.'_';
45 $len = strlen($pat)+1;
46 $qpa = db_construct_qpa () ;
47 $qpa = db_construct_qpa ($qpa,
48 'SELECT mh.id_message, mh.value as subject, m.id_list '.
49 ' FROM plugin_forumml_message m, plugin_forumml_messageheader mh'.
50 ' WHERE mh.id_header = $1'.
51 ' AND m.id_parent = 0'.
52 ' AND m.id_message = mh.id_message AND ',
54 $qpa=$this->addIlikeCondition($qpa, 'mh.value');