Changeset 412
- Timestamp:
- Apr 30, 2004, 7:11:25 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/release-1_3/include/functions_category.inc.php
r406 r412 288 288 $cat['comment'] = nl2br( $cat['comment'] ); 289 289 290 $cat['name'] = array(); 291 292 $query = 'SELECT name'; 290 // first, we retrieve the names of upper categories in the default order 291 // (not the correct one automatically) 292 $buffers_name = array(); 293 294 $query = 'SELECT id, name'; 293 295 $query.= ' FROM '.PREFIX_TABLE.'categories'; 294 296 $query.= ' WHERE id IN ('.$cat['uppercats'].')'; 295 $query.= ' ORDER BY id ASC';296 297 $query.= ';'; 297 298 $result = mysql_query( $query ); 298 299 while( $row = mysql_fetch_array( $result ) ) 299 300 { 300 array_push( $cat['name'], $row['name'] ); 301 $buffer_names[$row['id']] = $row['name']; 302 } 303 304 // then we reorder the names with the order given in the 305 // categories.uppercats database field 306 $cat['name'] = array(); 307 308 foreach ( explode( ',', $cat['uppercats'] ) as $id_uppercat ) { 309 array_push( $cat['name'], $buffer_names[$id_uppercat] ); 301 310 } 302 311
Note: See TracChangeset
for help on using the changeset viewer.