Changeset 21 for trunk/include/functions_category.inc.php
- Timestamp:
- Jul 1, 2003, 11:27:20 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_category.inc.php
r19 r21 15 15 * * 16 16 ***************************************************************************/ 17 17 18 function get_subcats_id( $cat_id ) 18 19 { 19 $restricted_cat = array(); 20 $i = 0; 20 $restricted_cats = array(); 21 21 22 $query = ' selectid';23 $query.= ' from'.PREFIX_TABLE.'categories';24 $query.= ' whereid_uppercat = '.$cat_id;22 $query = 'SELECT id'; 23 $query.= ' FROM '.PREFIX_TABLE.'categories'; 24 $query.= ' WHERE id_uppercat = '.$cat_id; 25 25 $query.= ';'; 26 26 $result = mysql_query( $query ); 27 27 while ( $row = mysql_fetch_array( $result ) ) 28 28 { 29 $restricted_cat[$i++] = $row['id']; 30 $sub_restricted_cat = get_subcats_id( $row['id'] ); 31 for ( $j = 0; $j < sizeof( $sub_restricted_cat ); $j++ ) 32 { 33 $restricted_cat[$i++] = $sub_restricted_cat[$j]; 34 } 35 } 36 37 return $restricted_cat; 29 array_push( $restricted_cats, $row['id'] ); 30 $sub_restricted_cats = get_subcats_id( $row['id'] ); 31 foreach ( $sub_restricted_cats as $sub_restricted_cat ) { 32 array_push( $restricted_cats, $sub_restricted_cat ); 33 } 34 } 35 return $restricted_cats; 38 36 } 39 37
Note: See TracChangeset
for help on using the changeset viewer.