Choosing the keywords tthat will appear at the list of the search form Choosing the keywords tthat will appear at the list of the search form
 

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]

Main Menu

Choosing the keywords tthat will appear at the list of the search form

Started by nambroque, December 18, 2016, 06:51:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nambroque

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.


My gallery:
Galería Fotometeo

Αndré

Easiest way is probably to edit search.php. Find
if ($CONFIG['clickable_keyword_search'] != 0) {
    include('include/keyword.inc.php');
}

and replace it with some custom links, like
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.

nambroque

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:

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;

My gallery:
Galería Fotometeo