Skip to content

Commit

Permalink
merge r11738 from branch 2.2 to trunk
Browse files Browse the repository at this point in the history
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'])


git-svn-id: http://piwigo.org/svn/trunk@11739 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Jul 13, 2011
1 parent aefd941 commit 64adb8e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/category_cats.inc.php
Expand Up @@ -122,7 +122,7 @@

if (isset($image_id))
{
if ($row['user_representative_picture_id'] != $image_id)
if ($conf['representative_cache_on_subcats'] and $row['user_representative_picture_id'] != $image_id)
{
$user_representative_updates_for[ $user['id'].'#'.$row['id'] ] = $image_id;
}
Expand Down Expand Up @@ -212,8 +212,11 @@
{
array_push($new_image_ids, $image_id);
}

$user_representative_updates_for[ $user['id'].'#'.$category['id'] ] = $image_id;

if ($conf['representative_cache_on_level'])
{
$user_representative_updates_for[ $user['id'].'#'.$category['id'] ] = $image_id;
}

$category['representative_picture_id'] = $image_id;
}
Expand Down
12 changes: 12 additions & 0 deletions include/config_default.inc.php
Expand Up @@ -222,6 +222,18 @@
// Maintenance].
$conf['allow_random_representative'] = false;

// representative_cache_on_level: if a thumbnail is chosen as representative
// but has higher privacy level than current user, Piwigo randomly selects
// another thumbnail. Should be store this thumbnail in cache to avoid
// another consuming SQL query on next page refresh?
$conf['representative_cache_on_level'] = true;

// representative_cache_on_subcats: if a category (= album) only contains
// sub-categories, Piwigo randomly selects a thumbnail among sub-categories
// representative. Should we store this thumbnail in cache to avoid another
// "slightly" consuming SQL query on next page refresh?
$conf['representative_cache_on_subcats'] = true;

// allow_html_descriptions : authorize administrators to use HTML in
// category and element description.
$conf['allow_html_descriptions'] = true;
Expand Down

0 comments on commit 64adb8e

Please sign in to comment.