Changeset 28087 for trunk/include
- Timestamp:
- Apr 5, 2014, 9:24:27 PM (10 years ago)
- Location:
- trunk/include
- Files:
-
- 2 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 } -
trunk/include/ws_functions/pwg.images.php
r26461 r28087 295 295 * @option string key 296 296 */ 297 function ws_images_addComment($params, &$service)297 function ws_images_addComment($params, $service) 298 298 { 299 299 $query = ' … … 355 355 * @option int comments_per_page 356 356 */ 357 function ws_images_getInfo($params, &$service)357 function ws_images_getInfo($params, $service) 358 358 { 359 359 global $user, $conf; … … 580 580 * @option float rate 581 581 */ 582 function ws_images_rate($params, &$service)582 function ws_images_rate($params, $service) 583 583 { 584 584 $query = ' … … 621 621 * @option string order (optional) 622 622 */ 623 function ws_images_search($params, &$service)623 function ws_images_search($params, $service) 624 624 { 625 625 include_once(PHPWG_ROOT_PATH .'include/functions_search.inc.php'); … … 639 639 $search_result = get_quick_search_results( 640 640 $params['query'], 641 $super_order_by, 642 implode(' AND ', $where_clauses) 641 array( 642 'super_order_by' => $super_order_by, 643 'images_where' => implode(' AND ', $where_clauses) 644 ) 643 645 ); 644 646 … … 705 707 * @option int level 706 708 */ 707 function ws_images_setPrivacyLevel($params, &$service)709 function ws_images_setPrivacyLevel($params, $service) 708 710 { 709 711 global $conf; … … 738 740 * @option int rank 739 741 */ 740 function ws_images_setRank($params, &$service)742 function ws_images_setRank($params, $service) 741 743 { 742 744 // does the image really exist? … … 821 823 * @option int position 822 824 */ 823 function ws_images_add_chunk($params, &$service)825 function ws_images_add_chunk($params, $service) 824 826 { 825 827 global $conf; … … 878 880 * @option string sum 879 881 */ 880 function ws_images_addFile($params, &$service)882 function ws_images_addFile($params, $service) 881 883 { 882 884 ws_logfile(__FUNCTION__.', input : '.var_export($params, true)); … … 971 973 * @option int image_id (optional) 972 974 */ 973 function ws_images_add($params, &$service)975 function ws_images_add($params, $service) 974 976 { 975 977 global $conf, $user; … … 1134 1136 * @option int image_id (optional) 1135 1137 */ 1136 function ws_images_addSimple($params, &$service)1138 function ws_images_addSimple($params, $service) 1137 1139 { 1138 1140 global $conf; … … 1248 1250 * @option string filename_list (optional) 1249 1251 */ 1250 function ws_images_exist($params, &$service)1252 function ws_images_exist($params, $service) 1251 1253 { 1252 1254 ws_logfile(__FUNCTION__.' '.var_export($params, true)); … … 1321 1323 * @option string file_sum 1322 1324 */ 1323 function ws_images_checkFiles($params, &$service)1325 function ws_images_checkFiles($params, $service) 1324 1326 { 1325 1327 ws_logfile(__FUNCTION__.', input : '.var_export($params, true)); … … 1393 1395 * @option string multiple_value_mode 1394 1396 */ 1395 function ws_images_setInfo($params, &$service)1397 function ws_images_setInfo($params, $service) 1396 1398 { 1397 1399 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); … … 1529 1531 * @option string pwg_token 1530 1532 */ 1531 function ws_images_delete($params, &$service)1533 function ws_images_delete($params, $service) 1532 1534 { 1533 1535 if (get_pwg_token() != $params['pwg_token']) … … 1566 1568 * @param mixed[] $params 1567 1569 */ 1568 function ws_images_checkUpload($params, &$service)1570 function ws_images_checkUpload($params, $service) 1569 1571 { 1570 1572 include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');
Note: See TracChangeset
for help on using the changeset viewer.