Ignore:
Timestamp:
Jan 11, 2004, 1:02:03 AM (21 years ago)
Author:
z0rglub
Message:

use the order of categories.uppercats for retrieving the local directory,
and not the ascending order of category ids (if you alterate manually the
database by moving an old category under a new one).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/release-1_3/include/functions_category.inc.php

    r244 r271  
    260260
    261261  $cat = array();
    262                
     262
    263263  $query = 'SELECT nb_images,id_uppercat,comment,site_id,galleries_url,dir';
    264264  $query.= ',date_last,uploadable,status,visible,representative_picture_id';
     
    332332  }
    333333
    334   $query = 'SELECT dir';
     334  $upper_array = explode( ',', $uppercats );
     335
     336  $database_dirs = array();
     337  $query = 'SELECT id,dir';
    335338  $query.= ' FROM '.PREFIX_TABLE.'categories';
    336339  $query.= ' WHERE id IN ('.$uppercats.')';
    337   $query.= ' ORDER BY id ASC';
    338340  $query.= ';';
    339341  $result = mysql_query( $query );
    340342  while( $row = mysql_fetch_array( $result ) )
    341343  {
    342     $local_dir.= $row['dir'].'/';
     344    $database_dirs[$row['id']] = $row['dir'];
     345  }
     346  foreach ( $upper_array as $id ) {
     347    $local_dir.= $database_dirs[$id].'/';
    343348  }
    344349
Note: See TracChangeset for help on using the changeset viewer.