Changeset 21801
- Timestamp:
- Mar 23, 2013, 11:02:04 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_user.inc.php
r20545 r21801 460 460 INSERT IGNORE INTO '.USER_CACHE_TABLE.' 461 461 (user_id, need_update, cache_update_time, forbidden_categories, nb_total_images, 462 last_photo_date, 462 463 image_access_type, image_access_list) 463 464 VALUES 464 465 ('.$userdata['id'].',\''.boolean_to_string($userdata['need_update']).'\',' 465 466 .$userdata['cache_update_time'].',\'' 466 .$userdata['forbidden_categories'].'\','.$userdata['nb_total_images'].',\'' 467 .$userdata['image_access_type'].'\',\''.$userdata['image_access_list'].'\')'; 467 .$userdata['forbidden_categories'].'\','.$userdata['nb_total_images'].','. 468 (empty($userdata['last_photo_date']) ? 'NULL': '\''.$userdata['last_photo_date'].'\''). 469 ',\''.$userdata['image_access_type'].'\',\''.$userdata['image_access_list'].'\')'; 468 470 pwg_query($query); 469 471 } … … 679 681 * @return array 680 682 */ 681 function get_computed_categories( $userdata, $filter_days=null)683 function get_computed_categories(&$userdata, $filter_days=null) 682 684 { 683 685 $query = 'SELECT c.id AS cat_id, global_rank'; … … 703 705 704 706 $query.= ' 705 GROUP BY c.id , c.global_rank';707 GROUP BY c.id'; 706 708 707 709 $result = pwg_query($query); 708 710 711 $userdata['last_photo_date'] = null; 709 712 $cats = array(); 710 713 while ($row = pwg_db_fetch_assoc($result)) … … 714 717 $row['count_images'] = (int)$row['nb_images']; 715 718 $row['max_date_last'] = $row['date_last']; 719 if ($row['date_last'] > $userdata['last_photo_date']) 720 { 721 $userdata['last_photo_date'] = $row['date_last']; 722 } 716 723 717 724 $cats += array($row['cat_id'] => $row); … … 1516 1523 $sql_list[]=$table_prefix.'level<='.$user['level']; 1517 1524 } 1518 else 1525 elseif ( !empty($user['image_access_list']) and !empty($user['image_access_type']) ) 1519 1526 { 1520 1527 $sql_list[]=$field_name.' '.$user['image_access_type'] -
trunk/install/piwigo_structure-mysql.sql
r19548 r21801 353 353 `forbidden_categories` mediumtext, 354 354 `nb_total_images` mediumint(8) unsigned default NULL, 355 `last_photo_date` datetime DEFAULT NULL, 356 `nb_available_tags` INT(5) DEFAULT NULL, 357 `nb_available_comments` INT(5) DEFAULT NULL 355 358 `image_access_type` enum('NOT IN','IN') NOT NULL default 'NOT IN', 356 359 `image_access_list` mediumtext default NULL, … … 417 420 `level` tinyint unsigned NOT NULL default '0', 418 421 `activation_key` char(20) default NULL, 419 UNIQUE KEY `user_infos_ui1`(`user_id`)422 PRIMARY KEY (`user_id`) 420 423 ) ENGINE=MyISAM; 421 424
Note: See TracChangeset
for help on using the changeset viewer.