OrdaSoft forum
Welcome, Guest
Please Login or Register.    Lost Password?
enhance search plugin to search in book reviews (0 viewing) 

BookLibrary Plugins Support

Go to bottom Favoured: 0

Enhance search plugin to search in book reviews

Wolfgangs (User)
Fresh Boarder
Posts: 13
graphgraph
User Offline Click here to see the profile of this user
enhance search plugin to search in book reviews 11 Years, 1 Month ago
Karma: 0  
Hi there!

I bought PRO version and supposed the PRO Search will do this, but nope.

I tried to change the QUERY but if the word exists I get all books I have, not only the ones with the searchword.

any help with this for me?
pleeeease

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";
           [b] $wheres2[]  = " br.title  LIKE $word";
            $wheres2[]  = " br.comment  LIKE $word";[/b]

            $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[b], #__booklibrary_review AS br[/b]"
                  ." WHERE c.id=bc.catid AND bc.bookid=bl.id AND $where "
                ." AND bl.published = '1' "
                ." AND ({$s}) AND c.published='1' "
                ." GROUP BY bl.id"
                ." $order";
break;

Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8366
graph
User Offline Click here to see the profile of this user
Re:enhance search plugin to search in book reviews 11 Years ago
Karma: 102  
Hello,

i am sorry, I not understand, Do you wish take in book search result only first book ?

Thanks,
OrdaSoft team
Logged Logged
The administrator has disabled public write access.
Wolfgangs (User)
Fresh Boarder
Posts: 13
graphgraph
User Offline Click here to see the profile of this user
Re:enhance search plugin to search in book reviews 11 Years ago
Karma: 0  
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";
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8366
graph
User Offline Click here to see the profile of this user
Re:enhance search plugin to search in book reviews 11 Years ago
Karma: 102  
Hello,

I f you resolve that, excellent

And may be you will need rebuild book layout for add anchor to every review and create link with that anchor

Thanks,
Ordasoft team
Logged Logged
The administrator has disabled public write access.
Go to top
»