Search return only albums

bitslv
bitslv's picture

Joined: 2006-12-27
Posts: 9
Posted: Thu, 2013-03-28 01:40

I updated Gallery 3.0.6. I want to limit the search to only show albums in the results not individual photos.

I saw solves for this at:

http://galleryproject.org/node/101934

and

http://galleryproject.org/node/101701

But the search.php file located under the helpers folder is not compatible with the suggested changes. Has anyone come up with a solutions to this problem?

 
bitslv
bitslv's picture

Joined: 2006-12-27
Posts: 9
Posted: Thu, 2013-03-28 02:11

Figured it out myself, but I thought it might be helpful for others out there.

Just alter Line 79 of the Search.php file located at /modules/search/helpers/search.php

Original Line:

"WHERE MATCH({search_records}.`data`) AGAINST ('$q' IN BOOLEAN MODE)" .

Altered Line:

"WHERE MATCH({search_records}.`data`) AGAINST ('$q' IN BOOLEAN MODE) AND {items}.`type` = 'album' " .