Search on titles only
-
Hi
Is it possible to change the code of the standard Easy Blog Search so it only searches against blog titles not contents as well?
I've recently converted a site from K2 to Easy Blog which people use for submitting short stories etc. There's over 3700 blog entries and people need to be able to find a title quicky
Many thanks
Mark
Subscribed Products:
3 responses Add a reply
-
Hello Mark,
I am really sorry for the delay of this reply as it is a weekend for us here. I am not too sure if making the search for title would help search easier but what you can do here is to edit the file /components/com_easyblog/models/search.php and at line 110 locate the block of codes below,
foreach ($words as $word) { $word = $db->Quote( '%'.$db->getEscaped( $word, true ).'%', false ); $where[] = 'a.`title` LIKE ' . $word; $where[] = 'a.`content` LIKE ' . $word; $where[] = 'a.`intro` LIKE ' . $word; $where2[] = 't.title LIKE ' . $word; $wheres2[] = implode( ' OR ' , $where2 ); $wheres[] = implode( ' OR ', $where ); }
Replace it with the following,
foreach ($words as $word) { $word = $db->Quote( '%'.$db->getEscaped( $word, true ).'%', false ); $where[] = 'a.`title` LIKE ' . $word; $where2[] = 't.title LIKE ' . $word; $wheres2[] = implode( ' OR ' , $where2 ); $wheres[] = implode( ' OR ', $where ); }
This way, the search in EasyBlog would only search for the titles only.
-
Subscribed Products: -
Your Response
Please login to reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.