forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: serviceplus on February 10, 2014, 08:53:50 am

Title: Add keywords while batch-adding
Post by: serviceplus on February 10, 2014, 08:53:50 am
Hi everyone,

I already used the search and found a few topics related to my question but no real answer. I am searching for a way (best a plugin) that allows me to add keywords while batch-adding images. I usually add many pics at ones and adding keyword seperately for every pictures takes a lot of time. Also I don't have a keyword for the whole album but when I batch-add my images all of them share some special keywords that I want to add during that process.

Is there a way to do this? I know other people asked for this as well  :)
Title: Re: Add keywords while batch-adding
Post by: Αndré on February 10, 2014, 01:41:19 pm
As you probably already noticed, that's not possible out of the box in cpg1.5.x. As far as I know there doesn't exist a mod or plugin yet that adds this feature. I assume the answer to the other threads was something like "add the keywords to the pictures' IPTC data before upload and enable IPTC in the Coppermine config", as this already works as a workaround. If this is no option for you, let me know and I'll have a look if I can create a mod.

However, this feature might be useful. If you want to see it in a future version of Coppermine, please start a new thread in the feature requests board (if there's no such thread yet).
Title: Re: Add keywords while batch-adding
Post by: serviceplus on February 11, 2014, 02:16:55 pm
If you could create a mod that would be fabulous. I am not working in the gallery alone and I doubt that the other people would remember to do the workaround. I will also check out the feature request board, thank you!
Title: Re: Add keywords while batch-adding
Post by: Αndré on February 13, 2014, 03:30:57 pm
Open searchnew.php, find
Code: [Select]
$warning;and replace with
Code: [Select]
'<tr><td class="tableh2" valign="middle" align="right" colspan="4">Add the following keyword(s) to all new inserted files (separated by "'.$CONFIG['keyword_separator'].'") <input type="text" class="textinput" name="keywords" id="keywords" /></td><tr>' . $warning;
open js/searchnew.js, find
Code: [Select]
url += '&aid=' + qm.aid;and replace with
Code: [Select]
url += '&aid=' + qm.aid + '&keywords=' + document.getElementById('keywords').value;
open include/picmgmt.inc.php, find
Code: [Select]
if ($CONFIG['read_iptc_data']) {and above, add
Code: [Select]
        $superCage = Inspekt::makeSuperCage();
        if ($superCage->get->keyExists('keywords') && trim($superCage->get->getEscaped('keywords')) != '') {
            $keywords = trim($superCage->get->getEscaped('keywords'));
        }


Note: this change will disable the import of IPTC data (if enabled) if one or more manual keywords are submitted.
Title: Re: Add keywords while batch-adding
Post by: serviceplus on February 18, 2014, 09:39:43 am
Hi Αndré,

that worked well, thank you!

For the future: If you ever include this into coppermine I would suggest maybe adding keywords by a drop-down list so that you cannot spell words wrong. Then it would be perfect  :)
Title: Re: Add keywords while batch-adding
Post by: astrasuite on February 19, 2014, 04:07:33 pm
Very useful, will implement it too ...