Changeset 28087 for trunk/include/functions_search.inc.php
- Timestamp:
- Apr 5, 2014, 9:24:27 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_search.inc.php
r28080 r28087 1194 1194 * @return array 1195 1195 */ 1196 function get_quick_search_results($q, $ super_order_by, $images_where='')1196 function get_quick_search_results($q, $options) 1197 1197 { 1198 1198 global $conf; … … 1255 1255 } 1256 1256 1257 $permissions = !isset($options['permissions']) ? true : $options['permissions']; 1258 1257 1259 $where_clauses = array(); 1258 1260 $where_clauses[]='i.id IN ('. implode(',', $ids) . ')'; 1259 if (!empty($ images_where))1261 if (!empty($options['images_where')) 1260 1262 { 1261 1263 $where_clauses[]='('.$images_where.')'; 1262 1264 } 1263 $where_clauses[] = get_sql_condition_FandF( 1264 array 1265 ( 1266 'forbidden_categories' => 'category_id', 1267 'visible_categories' => 'category_id', 1268 'visible_images' => 'i.id' 1269 ), 1270 null,true 1271 ); 1265 if ($permissions) 1266 { 1267 $where_clauses[] = get_sql_condition_FandF( 1268 array 1269 ( 1270 'forbidden_categories' => 'category_id', 1271 'visible_categories' => 'category_id', 1272 'visible_images' => 'i.id' 1273 ), 1274 null,true 1275 ); 1276 } 1272 1277 1273 1278 $query = ' 1274 SELECT DISTINCT(id) 1275 FROM '.IMAGES_TABLE.' i 1276 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id 1279 SELECT DISTINCT(id) FROM '.IMAGES_TABLE.' i'; 1280 if ($permissions) 1281 { 1282 $query .= ' 1283 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id'; 1284 } 1285 $query .= ' 1277 1286 WHERE '.implode("\n AND ", $where_clauses)."\n". 1278 1287 $conf['order_by']; … … 1306 1315 else 1307 1316 { 1308 return get_quick_search_results($search['q'], $super_order_by, $images_where);1317 return get_quick_search_results($search['q'], array('super_order_by'=>$super_order_by, 'images_where'=>$images_where) ); 1309 1318 } 1310 1319 }
Note: See TracChangeset
for help on using the changeset viewer.