Ignore:
Timestamp:
May 26, 2013, 9:56:31 PM (11 years ago)
Author:
rvelices
Message:

bug 2097: wrong number of sub-albums
bug 2098: make number of direct sub-albums available for each user

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/category_cats.inc.php

    r21802 r22879  
    3838    max_date_last,
    3939    count_images,
     40    nb_categories,
    4041    count_categories
    4142  FROM '.CATEGORIES_TABLE.' c
     
    120121    if ($conf['representative_cache_on_subcats'] and $row['user_representative_picture_id'] != $image_id)
    121122    {
    122       $user_representative_updates_for[ $user['id'].'#'.$row['id'] ] = $image_id;
     123      $user_representative_updates_for[ $row['id'] ] = $image_id;
    123124    }
    124125
     
    212213          if ($conf['representative_cache_on_level'])
    213214          {
    214             $user_representative_updates_for[ $user['id'].'#'.$category['id'] ] = $image_id;
     215            $user_representative_updates_for[ $category['id'] ] = $image_id;
    215216          }
    216217
     
    247248  $updates = array();
    248249
    249   foreach ($user_representative_updates_for as $user_cat => $image_id)
    250   {
    251     list($user_id, $cat_id) = explode('#', $user_cat);
    252 
    253     array_push(
    254       $updates,
     250  foreach ($user_representative_updates_for as $cat_id => $image_id)
     251  {
     252    $updates[] =
    255253      array(
    256         'user_id' => $user_id,
     254        'user_id' => $user['id'],
    257255        'cat_id' => $cat_id,
    258256        'user_representative_picture_id' => $image_id,
    259         )
    260       );
     257        );
    261258  }
    262259
Note: See TracChangeset for help on using the changeset viewer.