comparison Keyword.class.php @ 152:784e3c82926e

mod: yazucchiさんのパッチ取り込み
author epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
date Sun, 28 Mar 2010 22:13:52 +0900
parents 2cb414518ccd
children 190a3c46611d
comparison
equal deleted inserted replaced
149:5b192e94f49d 152:784e3c82926e
35 if( $keyword != "" ) { 35 if( $keyword != "" ) {
36 if( $use_regexp ) { 36 if( $use_regexp ) {
37 $options .= " AND CONCAT(title,description) REGEXP '".mysql_real_escape_string($keyword)."'"; 37 $options .= " AND CONCAT(title,description) REGEXP '".mysql_real_escape_string($keyword)."'";
38 } 38 }
39 else { 39 else {
40 // 茹茹 40 $options .= " AND CONCAT(title,description) like _utf8'%".mysql_real_escape_string($keyword)."%' collate utf8_unicode_ci";
41 // 翫絲上
42 $f_zennum = preg_match('/[0-9]/u', $keyword );
43 $f_zenal = preg_match('/[a-zA-Z]/u', $keyword );
44
45 $options .= " AND ( CONCAT(title,' ',description) like '%".mysql_real_escape_string($keyword)."%'";
46
47 if( $f_zennum ) {
48 $options .= " OR CONCAT(title,' ',description) like '%".mysql_real_escape_string(mb_convert_kana( $keyword, 'KVN',"UTF-8" ))."%'";
49 }
50 if( $f_zenal ) {
51 $options .= " OR CONCAT(title,' ',description) like '%".mysql_real_escape_string(mb_convert_kana( $keyword, 'KVR', "UTF-8" ))."%'";
52 }
53 if( $f_zenal && $f_zennum ) {
54 $options .= " OR CONCAT(title,' ',description) like '%".mysql_real_escape_string(mb_convert_kana( $keyword, 'KVRN', "UTF-8" ))."%'";
55 }
56 $options .= ") ";
57 } 41 }
58 } 42 }
59 43
60 if( $type != "*" ) { 44 if( $type != "*" ) {
61 $options .= " AND type = '".$type."'"; 45 $options .= " AND type = '".$type."'";