Execute($query); while ($subcategories = $result->fields) { $aSubcategories[count($aSubcategories)] = $subcategories['categories_id']; if ($subcategories['categories_id'] != $nParentId) { oos_get_subcategories($aSubcategories, $subcategories['categories_id']); } // Move that ADOdb pointer! $result->MoveNext(); } } /** * Parse search string into indivual objects * * @param $search_str * @return boolean */ function oos_parse_search_string($sSearch = '', &$objects) { $sSearch = trim(strtolower($sSearch)); // Break up $sSearch on whitespace; quoted string will be reconstructed later $pieces = preg_split('/[[:space:]]+/', $sSearch); $objects = array(); $tmpstring = ''; $flag = ''; for ($k=0; $k 1) { $pieces[$k] = substr($pieces[$k], 1); } else { $pieces[$k] = ''; } } $post_objects = array(); while (substr($pieces[$k], -1) == ')') { $post_objects[] = ')'; if (strlen($pieces[$k]) > 1) { $pieces[$k] = substr($pieces[$k], 0, -1); } else { $pieces[$k] = ''; } } // Check individual words if ( (substr($pieces[$k], -1) != '"') && (substr($pieces[$k], 0, 1) != '"') ) { $objects[] = trim($pieces[$k]); for ($j=0; $j 1) { $pieces[$k] = substr($pieces[$k], 0, -1); } else { $pieces[$k] = ''; } } // If the word doesn't end in double quotes, append it to the $tmpstring. if (substr($pieces[$k], -1) != '"') { // Tack this word onto the current string entity $tmpstring .= ' ' . $pieces[$k]; // Move on to the next word $k++; continue; } else { /* If the $piece ends in double quotes, strip the double quotes, tack the $piece onto the tail of the string, push the $tmpstring onto the $haves, kill the $tmpstring, turn the $flag "off", and return. */ $sTmp = preg_replace('/"/', ' ', $pieces[$k]); $tmpstring .= ' ' . trim($sTmp); // Push the $tmpstring onto the array of stuff to search for $objects[] = trim($tmpstring); for ($j=0; $j 12 || $month < 1) { return FALSE; } if ($day < 1) { return FALSE; } if (oos_is_leap_year($year)) { $no_of_days[1] = 29; } if ($day > $no_of_days[$month - 1]) { return FALSE; } $date_array = array($year, $month, $day); return TRUE; } /** * Check if year is a leap year * * @param $year * @return boolean */ function oos_is_leap_year($year) { if ($year % 100 == 0) { if ($year % 400 == 0) return TRUE; } else { if (($year % 4) == 0) return TRUE; } return FALSE; }