Changeset 11739


Ignore:
Timestamp:
Jul 14, 2011, 12:03:36 AM (13 years ago)
Author:
plg
Message:

merge r11738 from branch 2.2 to trunk

bug 2375 fixed: ability to deactivate representative cache on sub-albums (representative_cache_on_subcats) or when searching for another representative due to privacy level (representative_cache_on_level)

Location:
trunk/include
Files:
2 edited

Legend:

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

    r11591 r11739  
    123123  if (isset($image_id))
    124124  {
    125     if ($row['user_representative_picture_id'] != $image_id)
     125    if ($conf['representative_cache_on_subcats'] and $row['user_representative_picture_id'] != $image_id)
    126126    {
    127127      $user_representative_updates_for[ $user['id'].'#'.$row['id'] ] = $image_id;
     
    213213            array_push($new_image_ids, $image_id);
    214214          }
    215            
    216           $user_representative_updates_for[ $user['id'].'#'.$category['id'] ] = $image_id;
     215
     216          if ($conf['representative_cache_on_level'])
     217          {
     218            $user_representative_updates_for[ $user['id'].'#'.$category['id'] ] = $image_id;
     219          }
    217220         
    218221          $category['representative_picture_id'] = $image_id;
  • trunk/include/config_default.inc.php

    r11587 r11739  
    222222// Maintenance].
    223223$conf['allow_random_representative'] = false;
     224
     225// representative_cache_on_level: if a thumbnail is chosen as representative
     226// but has higher privacy level than current user, Piwigo randomly selects
     227// another thumbnail. Should be store this thumbnail in cache to avoid
     228// another consuming SQL query on next page refresh?
     229$conf['representative_cache_on_level'] = true;
     230
     231// representative_cache_on_subcats: if a category (= album) only contains
     232// sub-categories, Piwigo randomly selects a thumbnail among sub-categories
     233// representative. Should we store this thumbnail in cache to avoid another
     234// "slightly" consuming SQL query on next page refresh?
     235$conf['representative_cache_on_subcats'] = true;
    224236
    225237// allow_html_descriptions : authorize administrators to use HTML in
Note: See TracChangeset for help on using the changeset viewer.