Hi!
I want to search in all the reviews (title and comment) too.
I use the library in our intranet and use the "reviews" as sticky notes. everybody can make notices to the books and this should be integrated in the search path.
Actually I could solve it with help from our database expert by following code:
foreach ($words as $word) {
$word = $db->Quote( '%'.$db->getEscaped( $word, true ).'%', false );
$wheres2 = array();
$wheres2[] = "bl.title LIKE $word";
$wheres2[] = " bl.isbn LIKE $word";
$wheres2[] = " bl.authors LIKE $word";
$wheres2[] = " bl.manufacturer LIKE $word";
$wheres2[] = " bl.comment LIKE $word";
$wheres2[] = " br.title LIKE $word";
$wheres2[] = " br.comment LIKE $word";
$wheres[] = implode( ' OR ', $wheres2 );
}
$where = '(' . implode( ($phrase == 'all' ? '
AND (' : '
OR ('
, $wheres ) . '
';
$query = "SELECT bl.title AS title,"
." bl.date AS created,"
." bl.comment AS text,"
." CONCAT( 'index.php?option=com_booklibrary"
."&task=view&id=', bl.id,'&Itemid=', $ItemId_tmp,'&catid=',bc.catid) AS href,"
." '2' AS browsernav,"
." 'Booklibrary' AS section,"
." c.title AS category"
." FROM #__booklibrary AS bl,#__booklibrary_main_categories AS c, #__booklibrary_categories AS bc
, #__booklibrary_review AS br"
." WHERE c.id=bc.catid AND bc.bookid=bl.id
AND br.fk_bookid=bc.id AND $where "
." AND bl.published = '1' "
." AND ({$s}) AND c.published='1' "
." GROUP BY bl.id"
." $order";