So I looked at the code in subscribelib2.php located in the admin folder and made the following change in the case "checkboxgroup": section of the function ListAttributes to display the check boxes in the same row:
I left the original code in place but commented out the lines that are not needed. You can replace the entire case statement with:
- Code: Select all
case "checkboxgroup":
$output[$attr["id"]] .= sprintf("\n".'<tr><td><div>%s</div>',$attr["required"] ? 'required' : 'attributename',stripslashes($attr["name"]));//this is the beginning of the question text
$values_request = Sql_Query("select * from $table_prefix"."listattr_".$attr["tablename"]." order by listorder,name");
$output[$attr["id"]] .= sprintf('</td></tr>');//this is the end of the question text
$output[$attr["id"]] .= '<tr><td>';
while ($value = Sql_Fetch_array($values_request)) {
if (is_array($_POST[$fieldname]))
$selected = in_array($value["id"],$_POST[$fieldname]) ? "checked" : "";
else if ($data[$attr["id"]]) {
$selection = explode(",",$data[$attr["id"]]);
$selected = in_array($value["id"],$selection) ? "checked":"";
}
//$output[$attr["id"]] .= sprintf('<tr><td>test<input> %s</td></tr>',$fieldname,$value["id"],$selected,stripslashes($value["name"]));//this displays each check box in a seperate row
$output[$attr["id"]] .= sprintf('<input> %s',$fieldname,$value["id"],$selected,stripslashes($value["name"]));//this displays each check box in the same row
}
$output[$attr["id"]] .= '</td></tr>';
break;
If anyone has any comments, like I missed something or a better way to implement this, please let me know.