I cleaned up the code a bit and added comments to indicate more clearly where changes need to be made if you want to use this override:
/* EDIT -- latest code (more cleanup) */
<?php
// No Direct Access
defined( '_JEXEC' ) or die;
?>
<?php
/*identify the search for which this is an override ***CHANGE TO MATCH YOUR SEACH LIST NAME */
$searchlistname = "search_by_features";
/*
identify the field names for the checkbox fields and the text we want to use as header text. ***CHANGE THESE TWO LINES TO MATCH YOUR FIELD NAMES AND the TEXT you want to use as Headers for each of the fields
*/
$myfeaturesarray = array("veh_features","veh_navigation_features","veh_audio_features","veh_features__exterior");
$myfeaturesnames = array ("Interior ","Exterior","Audio/Media","Navigation");
/*
set up class styling in your custom css for these two classes Example:
.sebcboxclass {
width:200px;
float:left;
border:1px solid #eee;
}
.sebcboxlabelclass {
display:inline;
}
*/
/*
the contentof the submit button was extracted from the source of the page before overriding
*/
$submitbutton = '<div id="cck1r_button_search"><div id="cck1r_form_button_search"><button type="button" id="button_search" name="button_search" onclick="JCck.Core.submit('."'save'".');return false;"><span></span>Search</button></div></div>';
$arraycount = count($myfeaturesarray);
/*
move through each of our checkbox fields
*/
$x=0;
do {
$myid = $myfeaturesarray[$x];
$thename = $myfeaturesnames[$x];
// get the checkbox values as string of options with || separator then explode it into an array
$myveh_features = $cck->get($myid)->options;
$valuearray = explode("||",$myveh_features);
$vcount=0;
echo '<h3 style="clear;both">'.$thename . '</h3>';
/* Now that we have the options in an array, we will run through them to show the input checkbox and its label. For styling, we enclose those two tags inside a div. */
foreach ($valuearray as $value) {
$string1='<div><input id="' .$myid . $vcount .'" type="checkbox" size="1" value="'.$value.'" name="'.$myid.'[]">';
$string2 = '<label for ="'.$myid . $vcount . '">'.$value .'</label></div>';
$vcount++;
echo $string1.$string2;
}
$x++;
echo '<div style="clear:both"> </div>';
}while ($x<$arraycount);
/*Now show the submit button. */
echo '<div>';
echo $submitbutton; //show the submit button
echo '</div>';
?>