I have been working on my family site and would like to incorporate the search function to ecal, which I have not yet found anywhere. I changed the include/search.in.php file but does not work. Thanks for any help......
Here is the following
$sql = " SELECT id, cid, subject, LEFT(description, 95) AS description FROM ".$db->prefix("ecal")." WHERE status > 0";
if ( $userid != 0 ) { $sql .= " AND userid=".$userid." "; }
// because count() returns 1 even if a supplied variable // is not an array, we must check if $querryarray is really an array $count = count($queryarray); if ( $count > 0 && is_array($queryarray) ) { $sql .= " AND ((subject LIKE '%$queryarray[0]%' OR description LIKE '%$queryarray[0]%')"; for ($i=1; $i<$count; $i++) { $sql .= " $andor "; $sql .= "(subject LIKE '%$queryarray[$i]%' OR description LIKE '%$queryarray[$i]%')"; } $sql .= ") "; }
$sql .= " ORDER BY stamp DESC"; $result = $db->query($sql, $limit, $offset);