Changeset 28579
- Timestamp:
- May 31, 2014, 8:50:30 PM (10 years ago)
- Location:
- trunk/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r28567 r28579 1177 1177 $dbValue = $value; 1178 1178 } 1179 1179 1180 1180 $query = ' 1181 1181 INSERT INTO … … 1184 1184 ON DUPLICATE KEY UPDATE value = \''.$dbValue.'\' 1185 1185 ;'; 1186 1186 1187 1187 pwg_query($query); 1188 1188 1189 1189 if ($updateGlobal) 1190 1190 { … … 1369 1369 return $conf['filter_pages'][$page_name][$value_name]; 1370 1370 } 1371 else 1371 elseif (isset($conf['filter_pages']['default'][$value_name])) 1372 1372 { 1373 1373 return $conf['filter_pages']['default'][$value_name]; … … 1995 1995 ( 1996 1996 'forbidden_categories' => 'category_id', 1997 'visible_categories' => 'category_id', 1998 'visible_images' => 'ic.image_id' 1997 'forbidden_images' => 'ic.image_id' 1999 1998 ), 2000 1999 '', true -
trunk/include/functions_search.inc.php
r28459 r28579 607 607 break; 608 608 } 609 if (strlen($crt_token) && preg_match('/[0-9]/', substr($crt_token,-1)) 609 if (strlen($crt_token) && preg_match('/[0-9]/', substr($crt_token,-1)) 610 610 && $qi+1<strlen($q) && preg_match('/[0-9]/', $q[$qi+1])) 611 611 {// dot between digits is not a separator e.g. F2.8 … … 708 708 709 709 /** 710 * Applies recursively a search scope to all sub single tokens. We allow 'tag:(John Bill)' but we cannot evaluate 710 * Applies recursively a search scope to all sub single tokens. We allow 'tag:(John Bill)' but we cannot evaluate 711 711 * scopes on expressions so we rewrite as '(tag:John tag:Bill)' 712 712 */ … … 844 844 if ($use_ft) 845 845 { 846 $max = max( array_map( 'mb_strlen', 847 preg_split('/['.preg_quote(' !"#$%&()*+,./:;<=>?@[\]^`{|}~','/').']+/', $variant, PREG_SPLIT_NO_EMPTY)846 $max = max( array_map( 'mb_strlen', 847 preg_split('/['.preg_quote('-\'!"#$%&()*+,./:;<=>?@[\]^`{|}~','/').']+/', $variant) 848 848 ) ); 849 849 if ($max<4) … … 967 967 for ($i=0; $i<count($expr->stokens)-1; $i++) 968 968 { 969 if ( (strlen($expr->stokens[$i] )<=3 || strlen($expr->stokens[$i+1])<=3)969 if ( (strlen($expr->stokens[$i]->term)<=3 || strlen($expr->stokens[$i+1]->term)<=3) 970 970 && (($expr->stoken_modifiers[$i] & (QST_QUOTED|QST_WILDCARD)) == 0) 971 971 && (($expr->stoken_modifiers[$i+1] & (QST_BREAK|QST_QUOTED|QST_WILDCARD)) == 0) ) … … 996 996 $not_ids = array_merge($not_ids, $tag_ids); 997 997 else 998 $positive_ids = array_merge($positive_ids, $tag_ids); 998 { 999 if (strlen($token->term)>2 || count($expr->stokens)==1 || isset($token->scope) || ($token->modifier&(QST_WILDCARD|QST_QUOTED)) ) 1000 {// add tag ids to list only if the word is not too short (such as de / la /les ...) 1001 $positive_ids = array_merge($positive_ids, $tag_ids); 1002 } 1003 } 999 1004 } 1000 1005 elseif (isset($token->scope) && 'tag' == $token->scope->id && strlen($token->term)==0) 1001 1006 { 1002 if ($token s[$i]->modifier & QST_WILDCARD)1007 if ($token->modifier & QST_WILDCARD) 1003 1008 {// eg. 'tag:*' returns all tagged images 1004 1009 $qsr->tag_iids[$i] = query2array('SELECT DISTINCT image_id FROM '.IMAGE_TAG_TABLE, null, 'image_id'); … … 1096 1101 strtolower($q), 1097 1102 $conf['order_by'], 1098 $user['id'],$user['cache_update_time'], 1103 $user['id'],$user['cache_update_time'], 1099 1104 isset($options['permissions']) ? (boolean)$options['permissions'] : true, 1100 1105 isset($options['images_where']) ? $options['images_where'] : '', … … 1222 1227 ( 1223 1228 'forbidden_categories' => 'category_id', 1224 'visible_categories' => 'category_id', 1225 'visible_images' => 'i.id' 1229 'forbidden_images' => 'i.id' 1226 1230 ), 1227 1231 null,true
Note: See TracChangeset
for help on using the changeset viewer.