Changeset 11486
- Timestamp:
- Jun 22, 2011, 6:00:56 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/include/functions_category.inc.php
r11152 r11486 502 502 * we need $category['uppercats'], $category['id'], $category['count_images'] 503 503 */ 504 function get_random_image_in_category($category )504 function get_random_image_in_category($category, $recursive=true) 505 505 { 506 506 $image_id = null; … … 511 511 FROM '.CATEGORIES_TABLE.' AS c 512 512 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON ic.category_id = c.id 513 WHERE (c.id='.$category['id'].' OR uppercats LIKE \''.$category['uppercats'].',%\')' 514 .get_sql_condition_FandF 513 WHERE '; 514 if ($recursive) 515 { 516 $query.= ' 517 (c.id='.$category['id'].' OR uppercats LIKE \''.$category['uppercats'].',%\')'; 518 } 519 else 520 { 521 $query.= ' 522 c.id='.$category['id']; 523 } 524 $query.= ' 525 '.get_sql_condition_FandF 515 526 ( 516 527 array
Note: See TracChangeset
for help on using the changeset viewer.