Changeset 913 for trunk/admin/update.php


Ignore:
Timestamp:
Oct 23, 2005, 11:43:26 PM (19 years ago)
Author:
plg
Message:
  • bug fixed: during file tree synchronization, warning on finding the next rank of category which has no sub-categories yet.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/update.php

    r858 r913  
    117117  $db_fulldirs = array_flip($db_fulldirs);
    118118
    119   // finding next rank for each id_uppercat
     119  // finding next rank for each id_uppercat. By default, each category id
     120  // has 1 for next rank on its sub-categories to create
    120121  $next_rank['NULL'] = 1;
    121122 
     123  $query = '
     124SELECT id
     125  FROM '.CATEGORIES_TABLE.'
     126;';
     127  $result = pwg_query($query);
     128  while ($row = mysql_fetch_array($result))
     129  {
     130    $next_rank[$row['id']] = 1;
     131  }
     132
     133  // let's see if some categories already have some sub-categories...
    122134  $query = '
    123135SELECT id_uppercat, MAX(rank)+1 AS next_rank
Note: See TracChangeset for help on using the changeset viewer.