I'll preface this by saying that I've looked at the fastsearch module and it seems to say that the search module is a requirement, that it's not installed, and the search module doesn't appear for me on the administer modules to add it - though all the search functionality is there in the site.

So I'm currently writing a customized search that will filter out search results (in this case anecdotes) depending on checkboxes. I've altered the search form to add 2 checkboxes... one to show PG-13 content, the other to show R. By default I'm looking to to show only PG rated anecdotes.

function pgsearch_form_alter($form_id, &$form) {
if ($form_id == 'search_block_form' || $form_id == 'search_theme_form' || $form_id == 'search_form') {
$options = array(
'PG13' => t('Show PG-13'),
'R' => t('Show R') );
$form['boxes'] = array(
'#title' => t('Filters'),
'#type' => 'checkboxes',
'#description' => (t('Please check to add to your search.')),
'#options' => $options,
'#weight' => 25
);
}
}

When I attempt to retrieve values in the new hook_search() it catches them when the $op is 'name' but seems to resubmit and then I lose the result when the $op = 'search'. I've also tried using form_set_value and found that that lost the values as well as far as I could tell.

if($_POST['boxes']){
foreach ($_POST['boxes'] as $value) {
//print ('
value '.$value);
if ($value=='PG13') {
//print '
VALUE '.$value;
$pg13flag = 1;
//form_set_value($form['grating'], array('pg13',$pg13flag));
}
else if ($value=='R') {
//print '
VALUE '.$value;
$rflag = 1;
//form_set_value($form['grating'], array('r',$rflag));
}
}
}

switch ($op) {
case 'name':
return t('content');
case 'reset':
//variable_del('node_cron_last');
return;
case 'search':
print('pg13flag '.$pg13flag.' rflag '.$rflag);
if ($rflag == 1) {
$find = do_search2($keys, 'node', '', " i.type = 'node' ");
print('
RFLAG ON');
} else if ($pg13flag == 1) {
$find = do_search2($keys, 'node', ' LEFT OUTER JOIN content_field_content_warnings c ON i.sid = c.nid ', " i.type = 'node' AND field_content_warnings_value <> 'R' ");
print('
PG13FLAG ON');
} else {
$find = do_search2($keys, 'node', ' LEFT OUTER JOIN content_field_content_warnings c ON i.sid = c.nid ', " i.type = 'node' AND field_content_warnings_value <> 'PG-13' AND field_content_warnings_value <> 'R'");
print('
NO FLAGS');
}

Sorry for such a long post. This issue has plagued me for over a day now though...

Thanks in advance for any help.