Hi dwi,
I've sorted out a hack that will do this. Even though duplicate checkbox names are allowed in the html they aren't passed in the form $_POST variable. To fix this replace name='feature' with name='feature[]', this creates an array of checked entries that is passes in $_POST.
You then need to find the for next loop in chronocontact.php where $html_message is created and make changes equivalent to the following
$i = 0;
$html_message = "<table cellpadding='0' cellspacing='0'
border='0' width='100%'>";
$col_names = array();
if ( !is_array($omittedlist) ) {
$omittedlist = array();
}
foreach ( $matches[0] as $match ) {
$new_match = preg_replace('/name=("|\')/i', '', $match);
$new_match2 = preg_replace('/("|\')/', '', $new_match);
$name = preg_replace('/name=("|\')/', '', $new_match2);
$name = str_replace('[]', '', $name); // :HACK ::
$name = trim($name);
if ( in_array($name, $col_names) || in_array($name, $omittedlist) ) {
continue;
} else {
$col_names[] = $name;
}
$field_namex = $name;
if ( trim($titlesvalues->$field_namex) != '' ) {
$field_namex = $titlesvalues->$field_namex;
}
$post = $_POST[$name]; // :HACK ::
if ( is_array($post) ) { // :HACK ::
$post = implode(',', $post); // :HACK ::
} // :HACK ::
$html_message .= "<tr height='10'>
<td width='40%' class='tablecell1'>$field_namex</td>
<td width='60%' class='tablecell2'>$post</td> // :HACK ::
</tr>";
$i++;
}
$html_message.= "</table>";
Note 1: My code here is fairly heavily re-factored to use 'cases' instead of the 'if' clauses in Max' code - but the logic is identical. You'll find the changed lines marked // ::HACK ::
I've trimmed any '[]' from the names list then imploded the entry to a comma separated list if it's an array.
Note 2: This hack only works with the default table formatted e-mail - if you are using a template, or saving to a database table you may need to make equivalent code changes elsewhere. (Though hopefully Max will pick this up in a future version.)
Bob