public
Description: The ultra-lightweight ultra-flexible blogging engine with a fetish for birds and misspellings.
Homepage: http://chyrp.net/
Clone URL: git://github.com/vito/chyrp.git
Click here to lend your support to: chyrp and make a donation at www.pledgie.com !
Implemented post attribute keyword searching. [#256 state:resolved]
vito (author)
Fri Oct 31 18:21:38 -0700 2008
commit  6e9b8369ef791f83f7bc311bb215025a5c4f7fbd
tree    87eee65a09b3ba57f396c34cfda365bafe4043be
parent  f7a87f76bbb539b1e87f09a704ab43a9a83a455e
...
1324
1325
1326
1327
1328
 
 
 
1329
1330
 
1331
1332
1333
1334
 
 
 
1335
1336
1337
...
1361
1362
1363
1364
 
 
 
 
 
 
1365
 
1366
1367
1368
...
1324
1325
1326
 
 
1327
1328
1329
1330
 
1331
1332
 
 
 
1333
1334
1335
1336
1337
1338
...
1362
1363
1364
 
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
0
@@ -1324,14 +1324,15 @@
0
             list($test, $equals,) = explode(":", $match);
0
 
0
             if ($equals[0] == '"') {
0
-                foreach ($search as $index => $part) {
0
-                    $equals.= " ".$part;
0
+                if (substr($equals, -1) != '"')
0
+                    foreach ($search as $index => $part) {
0
+                        $equals.= " ".$part;
0
 
0
-                    unset($search[$index]);
0
+                        unset($search[$index]);
0
 
0
-                    if (substr($part, -1) == '"')
0
-                        break;
0
-                }
0
+                        if (substr($part, -1) == '"')
0
+                            break;
0
+                    }
0
 
0
                 $equals = ltrim(trim($equals, '"'), '"');
0
             }
0
@@ -1361,8 +1362,14 @@
0
 
0
         if ($table)
0
             foreach ($where as $col => $val)
0
-                if (!isset($columns[$col]))
0
+                if (!isset($columns[$col])) {
0
+                    if ($table == "posts") {
0
+                        $where["post_attributes.name"] = $col;
0
+                        $where["post_attributes.value like"] = "%".$val."%";
0
+                    }
0
+
0
                     unset($where[$col]);
0
+                }
0
 
0
         if (!empty($search)) {
0
             $where[] = $plain;

Comments