Changeset 11481 for trunk/include/functions_category.inc.php
- Timestamp:
- Jun 22, 2011, 3:04:45 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_category.inc.php
r11285 r11481 505 505 * we need $category['uppercats'], $category['id'], $category['count_images'] 506 506 */ 507 function get_random_image_in_category($category )507 function get_random_image_in_category($category, $recursive=true) 508 508 { 509 509 $image_id = null; … … 514 514 FROM '.CATEGORIES_TABLE.' AS c 515 515 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON ic.category_id = c.id 516 WHERE (c.id='.$category['id'].' OR uppercats LIKE \''.$category['uppercats'].',%\')' 517 .get_sql_condition_FandF 516 WHERE '; 517 if ($recursive) 518 { 519 $query.= ' 520 (c.id='.$category['id'].' OR uppercats LIKE \''.$category['uppercats'].',%\')'; 521 } 522 else 523 { 524 $query.= ' 525 c.id='.$category['id']; 526 } 527 $query.= ' 528 '.get_sql_condition_FandF 518 529 ( 519 530 array
Note: See TracChangeset
for help on using the changeset viewer.