Public Member Functions | |
ilForumSearch (&$query_parser) | |
Constructor public. | |
& | performSearch () |
__createAndCondition () |
Definition at line 37 of file class.ilForumSearch.php.
ilForumSearch::__createAndCondition | ( | ) |
Definition at line 92 of file class.ilForumSearch.php.
{
echo "Overwrite me!";
}
ilForumSearch::ilForumSearch | ( | &$ | query_parser | ) |
Constructor public.
Reimplemented in ilLikeForumSearch.
Definition at line 43 of file class.ilForumSearch.php.
References ilAbstractSearch::$query_parser, and ilAbstractSearch::ilAbstractSearch().
Referenced by ilFulltextForumSearch::ilFulltextForumSearch().
& ilForumSearch::performSearch | ( | ) |
Reimplemented from ilAbstractSearch.
Definition at line 48 of file class.ilForumSearch.php.
References $query, $res, $row, ilAbstractSearch::__createLocateString(), and ilAbstractSearch::setFields().
{ // Search in topic titles, posting title, posting // First: search topics: $this->setFields(array('thr_subject')); $and = $this->__createTopicAndCondition(); $locate = $this->__createLocateString(); $query = "SELECT top_frm_fk,thr_pk as frm_id ". $locate. "FROM frm_threads,frm_data ". "WHERE top_pk = thr_top_fk ". $and; $res = $this->db->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $thread_post = $row->pos_thr_fk.'_0'; $this->search_result->addEntry($row->frm_id,'frm',$this->__prepareFound($row),$thread_post); } // First: search post title, content: $this->setFields(array('pos_subject','pos_message')); $and = $this->__createPostAndCondition(); $locate = $this->__createLocateString(); $query = "SELECT top_frm_fk as frm_id,pos_thr_fk,pos_pk ". $locate. "FROM frm_posts,frm_data ". "WHERE pos_top_fk = top_pk ". $and; $res = $this->db->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $thread_post = $row->pos_thr_fk.'_'.$row->pos_pk; $this->search_result->addEntry($row->frm_id,'frm',$this->__prepareFound($row),$thread_post); } return $this->search_result; }