Hi all, this is my first post here.
I have been trying my best to customize coppermine upload-php to my website. I want my members to only be able to upload only 1 picture at a time and to select keywords from checkboxes.
I have got checkboxes but I am not happy with the output. First I would like 3 coloumns with checkboxes and second I get one checkbox at the top with '//' before with no keyword and at the bottom I get only a ';'.
As you can see I used 'Easy keyword insert MOD v2' first and then i have tried to modify it.
My code is like this:
// Ok, go with "Easy keyword insert MOD v2"
//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.". ";
}
// Hop stop here ! Add request of keyword_select.php to get the keyword list
$query = "SELECT * FROM {$CONFIG['TABLE_PREFIX']}dict ORDER BY keyword";
$result = cpg_db_query($query);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$keywordIds[] = $row["keyId"];
$keywords[] = $row["keyword"];
}
$form = "";
foreach ($keywords as $keyword) {
// $form.= '<input type="checkbox" name="keyword" value="'.$keyword.' ">'.$keyword.'</input>';
$form.= '<input type="checkbox" name="keyword" value="'.$keyword.' onchange="document.forms[0].keywords.value += this.value" >'.$keyword.'<br></input>';
}
// Return at the mod
// Create the keyword box.
echo <<< EOT
<tr>
<td width="40%" class="tableb">
Kategorier :
</td>
<td width="60%" class="tableb" valign="top">
<label> <br />
// <input type="checkbox" name="keyword" onchange="document.forms[0].keywords.value += this.value" ></input><br >;
$form;
</label>
</td>
</tr>
EOT;
}
}
I would appreciate any help with the code, if you want the hole upload.php file just let me know.