This gives you the option to easily add keywords from a drop-down list into the keywords field during upload.
open upload.php
find:
// The function for text areas on forms. Takes the label, field name, and maximum length as arguments.
function text_area_input($text, $name, $max_length,$default='') {
// Create the text area.
echo <<<EOT
<tr>
<td class="tableb" valign="top">
$text
</td>
<td class="tableb" valign="top">
<f></f> <textarea name="$name" rows="5" cols="40" class="textinput" style="width: 100%;" onKeyDown="textCounter(this, $max_length);" onKeyUp="textCounter(this, $max_length);">$default</textarea>
</td>
</tr>
EOT;
}
after add: (where I have written Contemporary, Vector, Paint, Comic, etc you can edit and insert your own keywords)
//mod here
// The text Keyword form <---- modded input function. Takes the text label for the box, the input name, the maximum length for text boxes,
// and the number of iterations.
function keyword_box_input($text, $name, $max_length, $iterations, $default='') {
global $CONFIG;
$ordinal = '';
if (($text == '') and ($iterations == '')) {
echo " <input type=\"hidden\" name=\"$name\" value=\"$default\" />\n";
return;
}
// Begin loop
for ($counter=0; $counter<$iterations; $counter++) {
// Create a numbering system when necessary.
if ($text == '') {
$cardinal = $counter + 1;
$ordinal = "".$cardinal.". ";
}
// Create the keyword box.
echo <<<EOT
<tr>
<td width="40%" class="tableb">
$text $ordinal
</td>
<td width="60%" class="tableb" valign="top">
<label> <br />
Genre
<select name="select" onchange="document.forms[0].keywords.value += this.value">
<option></option>
<option value=" Contemporary">Contemporary</option>
<option value=" Comics">Comics</option>
<option value=" Other">Other</option>
</select>
</label>
(you can select more than one)
<p>
<label>Medium
<select name="select2" onchange="document.forms[0].keywords.value += this.value">
<option></option>
<option value=" Vector">Vector</option>
<option value=" Paint">Paint</option>
<option value=" Collage">Collage</option>
</select>
</label>
(you can select more than one)</p>
<input type="text" style="width: 100%" name="$name" maxlength="$max_length" value="$default" class="textinput" />
</td>
</tr>
EOT;
}
find:
// If the type is a hidden form
case 4 :
// Call the hidden input funtion.
hidden_input($element[0], $element[1]);
break;
after add:
// If the type is keyword input
case 5 :
// Call the text area function.
keyword_box_input($element[0], $element[1], $element[3], (isset($element[4])) ? $element[4] : '');
break;
find:
array($lang_upload_php['keywords'], 'keywords', 0, 255, 1)
replace with this:
array($lang_upload_php['keywords'], 'keywords', 5, 255, 1)
find:
array($lang_upload_php['keywords'], 'keywords', 0, 255, 1,(isset($iptc['Keywords'])) ? implode(' ',$iptc['Keywords']): ''),
replace with this:
array($lang_upload_php['keywords'], 'keywords', 5, 255, 1,(isset($iptc['Keywords'])) ? implode(' ',$iptc['Keywords']): ''),
I have attached a screen shot of what this mod does.
this mod is not compatible with this mod:
http://forum.coppermine-gallery.net/index.php?topic=9391.0 (the upload files and edit them all at once mod) As I tried for at least an hour to get it to work.