/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk

« back to all changes in this revision

Viewing changes to classes/search.php

  • Committer: Suren A. Chilingaryan
  • Date: 2009-01-30 23:56:42 UTC
  • Revision ID: csa@dside.dyndns.org-20090130235642-gw9n5v9y7w23dmmd
Further search improvements, support for custom properties (config)

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
 function DetectModules($string) {
46
46
    if ($this->modules['interval']) {
47
 
        if (preg_match("/\b(Jan|January|Feb|FebruaryMar|March|Apr|April|May|Jun|June|Jul|July|Aug|August|Sep|September|Oct|October|Nov|November|Dec|December)\b/", $string)) {
 
47
        if (preg_match("/\b(Jan|January|Feb|FebruaryMar|March|Apr|April|May|Jun|June|Jul|July|Aug|August|Sep|September|Oct|October|Nov|November|Dec|December)\b/i", $string)) {
48
48
            return array("interval"=>true);
49
49
        }
50
50
        
51
 
        if (preg_match("/^\s*\d{4}(\s*-\s*\d{4})?\s*$/", $string)) {
52
 
            return array("interval"=>true);
 
51
        if (preg_match("/^\s*(\d{4})(\s*-\s*\d{4})?\s*$/", $string)) {
 
52
            if (($m[2])||(($m[1]>1900)&&($m[1]<2100))) {
 
53
                return array("interval"=>true);
 
54
            }
53
55
        }
54
56
    }
55
57
 } 
112
114
        $string = $matches[1];
113
115
 
114
116
    }
115
 
    
 
117
 
116
118
    $filter = new SEARCHFilter($threshold, $limits);
117
119
 
118
 
 
119
 
 
120
120
        // extracting module information    
121
121
    if (($modules)&&(is_string($modules))) {
122
122
        if (strpos($modules, "{") === false) {
123
123
            $mstr = explode(",", $modules);
124
124
            $modules = array();
125
125
            foreach ($mstr as $mod) {
126
 
                if (preg_match("/^([\w\d_]+)(\(.*\))?$/", $mod, $m)) {
 
126
                if (preg_match("/^([\w\d_]+)(\((.*)\))?$/", $mod, $m)) {
127
127
                    $module = $m[1];
128
128
                    $modules[$module] = array();
129
129
                    
130
130
                    if ($m[2]) {
131
 
                        $params = explode(";", $m[2]);
 
131
                        $params = explode(";", $m[3]);
132
132
                        foreach ($params as $param) {
133
133
                            if (preg_match("/^([^=]+)=(.*)$/", $param, $m)) {
134
134
                                $modules[$module][$m[1]] = $m[2];