source: tags/release-1_7_1/include/functions_filter.inc.php @ 9568

Last change on this file since 9568 was 1912, checked in by rub, 17 years ago

Update svn properties (svn:eol-style and svn:keywords)

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | PhpWebGallery - a PHP based picture gallery                           |
4// | Copyright (C) 2006-2007 PhpWebGallery Team - http://phpwebgallery.net |
5// +-----------------------------------------------------------------------+
6// | branch        : BSF (Best So Far)
7// | file          : $Id: functions_filter.inc.php 1912 2007-03-16 06:30:07Z rub $
8// | last update   : $Date: 2007-03-16 06:30:07 +0000 (Fri, 16 Mar 2007) $
9// | last modifier : $Author: rub $
10// | revision      : $Revision: 1912 $
11// +-----------------------------------------------------------------------+
12// | This program is free software; you can redistribute it and/or modify  |
13// | it under the terms of the GNU General Public License as published by  |
14// | the Free Software Foundation                                          |
15// |                                                                       |
16// | This program is distributed in the hope that it will be useful, but   |
17// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
18// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
19// | General Public License for more details.                              |
20// |                                                                       |
21// | You should have received a copy of the GNU General Public License     |
22// | along with this program; if not, write to the Free Software           |
23// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
24// | USA.                                                                  |
25// +-----------------------------------------------------------------------+
26
27
28/**
29 * Get a check key for filtered data
30 * Check key are composed of elements witch force to compute data
31 *
32 * @param null
33 * @return strinf check_key
34 */
35function get_filter_check_key()
36{
37  global $user, $filter;
38
39  return $user['id'].$filter['recent_period'].date('Ymd');
40}
41
42/**
43 * update data of categories with filtered values
44 *
45 * @param array list of categories
46 * @return null
47 */
48function update_cats_with_filtered_data(&$cats)
49{
50  global $filter;
51
52  if ($filter['enabled'])
53  {
54    $upd_fields = array('max_date_last', 'count_images', 'count_categories', 'nb_images');
55
56    foreach ($cats as $cat_id => $category)
57    {
58      foreach ($upd_fields as $upd_field)
59      {
60        $cats[$cat_id][$upd_field] = $filter['categories'][$category['id']][$upd_field];
61      }
62    }
63  }
64}
65
66?>
Note: See TracBrowser for help on using the repository browser.