Changeset 8802 for trunk/picture.php


Ignore:
Timestamp:
Jan 20, 2011, 2:32:34 PM (13 years ago)
Author:
plg
Message:

bug 937 fixed: makes sure a user won't see the thumbnail of a photo that has a
higher privacy level than user privacy level.

For an acceptable solution at performance level, I have implemented a cache:
for a given user, each album has a representative_picture_id. This cache also
avoids to perform numerous "order by rand()" SQL queries which is the case
when $confallow_random_representative = true;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r8728 r8802  
    285285;';
    286286        pwg_query($query);
     287
     288        $query = '
     289UPDATE '.USER_CACHE_CATEGORIES_TABLE.'
     290  SET user_representative_picture_id = NULL
     291  WHERE user_id = '.$user['id'].'
     292    AND cat_id = '.$page['category']['id'].'
     293;';
     294        pwg_query($query);
    287295      }
    288296
Note: See TracChangeset for help on using the changeset viewer.