forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: nambroque on December 18, 2016, 06:51:59 pm

Title: Choosing the keywords tthat will appear at the list of the search form
Post by: nambroque on December 18, 2016, 06:51:59 pm
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.


Title: Re: Choosing the keywords tthat will appear at the list of the search form
Post by: Αndré on June 30, 2017, 05:23:58 pm
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.
Title: Re: Choosing the keywords tthat will appear at the list of the search form
Post by: nambroque on July 02, 2017, 09:47:55 pm
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;