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: Choosing the keywords tthat will appear at the list of the search form  (Read 3004 times)

0 Members and 1 Guest are viewing this topic.

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo

Now, admin can choose in the configuration whether the complete list of keywords in the gallery to appear or not below the search form.
In the help, it says "Enabling this option is recommended only if you have a small number of keywords in use (e.g. less than 100)..."
I would like to enable this option, but I would like anly some specific keywords to appear.
One solution for this may be adding a column in the keyword manage in which admin could decide through selecting/deselecting, which of the keywords will appear in the list of keywords at the search form.


Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764

Easiest way is probably to edit search.php. Find
Code: [Select]
if ($CONFIG['clickable_keyword_search'] != 0) {
    include('include/keyword.inc.php');
}
and replace it with some custom links, like
Code: [Select]
echo '<a href="thumbnails.php?album=search&amp;keywords=on&amp;search=example_keyword">example_keyword</a>';
As you're editing a core file, this mod needs to be re-applied after each update. It would be better to create a plugin, but this requires more effort.
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo

Thanks André
Certainly I was thinking of a plugin that may add a column to the keywords list in the keyword manager, so that you can deselect those that keywords should not appear at the search form,
but the way you said is also valid, you can see the result in my gallery.
I used excel for creating the text to introduce, and so I replaced the text that you mentioned into:

Code: [Select]
echo '<br><p>TITLE:</p><br>';

$MyString='<a href="thumbnails.php?album=search&amp;keywords=on&amp;search=example_keyword1">example_keyword1</a>'.
'<a href="thumbnails.php?album=search&amp;keywords=on&amp;search=example_keyword2">example_keyword2</a>'.
'<a href="thumbnails.php?album=search&amp;keywords=on&amp;search=example_keyword3">example_keyword3</a>';

echo $MyString;

Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.