Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: How to show album in search instead the thumbnails by keywords  (Read 1735 times)

0 Members and 1 Guest are viewing this topic.

user454

  • Coppermine newbie
  • Offline Offline
  • Posts: 7

Hello.
I use latest version of coppermine.

With plugin KEYWORD_ADD i assign keywords to my albums. When i search keyword it show me all pictures in all albums with this keyword.
What i should edit to see albums by keywords together or instead of images.

For example: i added keyword HELLO in all pictures in 2 album. Now when i search HELLO - i get bunch of pictures from 2 albums. Instead of this i want to get this 2 albums.

How can i make this?
Logged

user454

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: How to show album in search instead the thumbnails by keywords
« Reply #1 on: July 18, 2013, 06:06:56 am »

Hello!
Just find in include/search.inc.php this:
Code: [Select]
$album_query = "SELECT aid, title, description FROM `{$CONFIG['TABLE_ALBUMS']}` AS p"
                        ." WHERE (`title` " . implode(" $type `title` ",$albcat_terms) . ") $FORBIDDEN_SET";
$result = cpg_db_query($album_query);
and replace it by
Code: [Select]
$album_query = "SELECT `{$CONFIG['TABLE_PICTURES']}`.`aid`,`{$CONFIG['TABLE_ALBUMS']}`.`title`,`{$CONFIG['TABLE_ALBUMS']}`.`description` FROM `{$CONFIG['TABLE_PICTURES']}`,`{$CONFIG['TABLE_ALBUMS']}`  WHERE (`keywords` " . implode(" $type `title` ",$albcat_terms) . ") AND `{$CONFIG['TABLE_PICTURES']}`.`aid`=`{$CONFIG['TABLE_ALBUMS']}`.`aid` $FORBIDDEN_SET GROUP BY `{$CONFIG['TABLE_PICTURES']}`.`aid`";
$result = cpg_db_query($album_query );

Work perfectly for me
Logged

user454

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: How to show album in search instead the thumbnails by keywords
« Reply #2 on: July 18, 2013, 06:13:29 am »

Small correction:
Code: [Select]
$album_query = "SELECT `{$CONFIG['TABLE_PICTURES']}`.`aid`,`{$CONFIG['TABLE_ALBUMS']}`.`title`,`{$CONFIG['TABLE_ALBUMS']}`.`description` FROM `{$CONFIG['TABLE_PICTURES']}`,`{$CONFIG['TABLE_ALBUMS']}`  WHERE (`keywords` " . implode(" $type `keywords` ",$albcat_terms) . ") AND `{$CONFIG['TABLE_PICTURES']}`.`aid`=`{$CONFIG['TABLE_ALBUMS']}`.`aid` $FORBIDDEN_SET GROUP BY `{$CONFIG['TABLE_PICTURES']}`.`aid`";
$result = cpg_db_query($album_query );
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: How to show album in search instead the thumbnails by keywords
« Reply #3 on: August 23, 2013, 04:31:16 pm »

Thanks for resolving your thread.
Logged
Pages: [1]   Go Up
 

Page created in 0.052 seconds with 19 queries.