here is my example of modifying the SQL result array $users in the search php with my filters. Keep in mind this is the rough draft
[code:1]$users=$database->loadObjectList();
global $my;
$database->setQuery("SELECT cb_distance FROM #__comprofiler WHERE id=$my->id"«»);
$distance = $database->loadResult();
if($distance == ""«»){$distance = 40000000;}
$database->setQuery("SELECT cb_onlysex FROM #__comprofiler WHERE id=$my->id"«»);
$my_scroll_sex = $database->loadResult();
$database->setQuery("SELECT cb_onlineonly FROM #__comprofiler WHERE id=$my->id"«»);
$my_online_only = $database->loadResult();
$query = "SELECT lat FROM #__comprofiler WHERE id=$my->id";
$database ->setQuery ($query);
$my_lat = $database->loadResult();
$query = "SELECT lon FROM #__comprofiler WHERE id=$my->id";
$database ->setQuery ($query);
$my_lon = $database->loadResult();
$count = 0;
$temp = array();
$temp = $users;
foreach($users as $user) {
$query = "SELECT lat FROM #__comprofiler WHERE id=$user->id";
$database ->setQuery ($query);
$lat = $database->loadResult();
$query = "SELECT lon FROM #__comprofiler WHERE id=$user->id";
$database ->setQuery ($query);
$lon = $database->loadResult();
$query = "SELECT cb_gender FROM #__comprofiler WHERE id=$user->id";
$database ->setQuery ($query);
$gender = $database->loadResult();
$my_distance = decimal_distance2($my_lat, $my_lon, $lat, $lon);
$query = "SELECT time FROM #__session WHERE userid=$user->id";
$database ->setQuery ($query);
$my_session = $database->loadResult();
//echo $user->id.">".$my_session."<br />";
//echo $my_distance;
//restrict checks
$trigger = false;
if($my_distance > $distance){
//echo "<br />";
//echo "Deleting:".$user->username." for distance<br />";
$trigger = true;
}
if ($my_session == ""«»){
if($my_online_only == 1){
//echo "Deleting:".$user->username." for offline<br />";
$trigger = true;
}
}
if (($gender != $my_scroll_sex) and isset($gender)){
//echo $gender."<>".$my_scroll_sex."<br />";
//echo "Deleting:".$user->username." for Sex: ".$gender."<>".$my_scroll_sex."<br />";
$trigger = true;
}
if ($trigger == true){
unset($temp[$count]);
}
$count++;
}
$users = $temp;
unset($temp);
[/code:1]