Ignore:
Timestamp:
Jul 22, 2008, 12:32:25 PM (16 years ago)
Author:
rvelices
Message:
  • add #user_cache.cache_update_time - useful for plugins or the filter when it is not possible/desirable to cache/calculate data specific to the user when pwg core does it; note that this opens the possibility to implement a data cache (file/shared mem/ etc...) for every user (for very large databases)
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 local
        2 gal2
        3 feed.xml
        4 testmail
        5 phpmv2
        61map.php
        72upgrade65.log
        8 fstats
        93_data
  • trunk/include

    • Property svn:ignore
      •  

        old new  
        11mysql.inc.php
        22config_local.inc.php
        3 config_local.inc.bak.php
  • trunk/include/functions_user.inc.php

    r2425 r2448  
    300300        or $userdata['need_update'] == true)
    301301    {
     302      $userdata['cache_update_time'] = time();
     303
     304      // Set need update are done
     305      $userdata['need_update'] = false;
     306
    302307      $userdata['forbidden_categories'] =
    303308        calculate_permissions($userdata['id'], $userdata['status']);
     
    321326      update_user_cache_categories($userdata);
    322327
    323       // Set need update are done
    324       $userdata['need_update'] = false;
    325 
    326       // Indicate update done
    327       $userdata['need_update_done'] = true;
    328 
    329328      $query = '
    330329SELECT COUNT(DISTINCT(image_id)) as total
     
    344343      $query = '
    345344INSERT INTO '.USER_CACHE_TABLE.'
    346   (user_id, need_update, forbidden_categories, nb_total_images,
     345  (user_id, need_update, cache_update_time, forbidden_categories, nb_total_images,
    347346    image_access_type, image_access_list)
    348347  VALUES
    349   ('.$userdata['id'].',\''.boolean_to_string($userdata['need_update']).'\',\''
     348  ('.$userdata['id'].',\''.boolean_to_string($userdata['need_update']).'\','
     349  .$userdata['cache_update_time'].',\''
    350350  .$userdata['forbidden_categories'].'\','.$userdata['nb_total_images'].',"'
    351351  .$userdata['image_access_type'].'","'.$userdata['image_access_list'].'")
    352352;';
    353353      pwg_query($query);
    354     }
    355     else
    356     {
    357       // Indicate update not done
    358       $userdata['need_update_done'] = false;
    359354    }
    360355  }
Note: See TracChangeset for help on using the changeset viewer.