Changeset 1624


Ignore:
Timestamp:
Dec 2, 2006, 12:31:19 AM (17 years ago)
Author:
rub
Message:

Resolved Issue ID 0000299:

o Add (new) icon of parent category with children categories including new images
o Improved display text for images count
o Improved (a little) mass_* functions

More explications on the forum.
You must call directly upgrade_feep.php (http://127.0.0.1/BSF/upgrade_feed.php for example)

Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r1605 r1624  
    258258  pwg_query($query);
    259259
     260  // deletion of computed cache data linked to the user
     261  $query = '
     262DELETE FROM '.USER_CACHE_CATEGORIES_TABLE.'
     263  WHERE user_id = '.$user_id.'
     264;';
     265  pwg_query($query);
     266
    260267  // deletion of phpwebgallery specific informations
    261268  $query = '
     
    515522function mass_inserts($table_name, $dbfields, $datas)
    516523{
    517   // inserts all found categories
    518   $query = '
    519 INSERT INTO '.$table_name.'
    520   ('.implode(',', $dbfields).')
    521    VALUES';
    522   foreach ($datas as $insert_id => $insert)
    523   {
    524     $query.= '
    525   ';
    526     if ($insert_id > 0)
    527     {
    528       $query.= ',';
    529     }
    530     $query.= '(';
    531     foreach ($dbfields as $field_id => $dbfield)
    532     {
    533       if ($field_id > 0)
     524  if (count($datas) != 0)
     525  {
     526    // inserts all found categories
     527    $query = '
     528  INSERT INTO '.$table_name.'
     529    ('.implode(',', $dbfields).')
     530     VALUES';
     531    foreach ($datas as $insert_id => $insert)
     532    {
     533      $query.= '
     534    ';
     535      if ($insert_id > 0)
    534536      {
    535537        $query.= ',';
    536538      }
    537 
    538       if (!isset($insert[$dbfield]) or $insert[$dbfield] === '')
     539      $query.= '(';
     540      foreach ($dbfields as $field_id => $dbfield)
    539541      {
    540         $query.= 'NULL';
     542        if ($field_id > 0)
     543        {
     544          $query.= ',';
     545        }
     546
     547        if (!isset($insert[$dbfield]) or $insert[$dbfield] === '')
     548        {
     549          $query.= 'NULL';
     550        }
     551        else
     552        {
     553          $query.= "'".$insert[$dbfield]."'";
     554        }
    541555      }
    542       else
    543       {
    544         $query.= "'".$insert[$dbfield]."'";
    545       }
    546     }
    547     $query.=')';
    548   }
    549   $query.= '
    550 ;';
    551   pwg_query($query);
     556      $query.=')';
     557    }
     558    $query.= '
     559;';
     560    pwg_query($query);
     561  }
    552562}
    553563
     
    562572function mass_updates($tablename, $dbfields, $datas)
    563573{
    564   // depending on the MySQL version, we use the multi table update or N
    565   // update queries
    566   $query = 'SELECT VERSION() AS version;';
    567   list($mysql_version) = mysql_fetch_array(pwg_query($query));
    568   if (count($datas) < 10 or version_compare($mysql_version, '4.0.4') < 0)
    569   {
    570     // MySQL is prior to version 4.0.4, multi table update feature is not
    571     // available
    572     foreach ($datas as $data)
    573     {
     574  if (count($datas) != 0)
     575  {
     576    // depending on the MySQL version, we use the multi table update or N
     577    // update queries
     578    $query = 'SELECT VERSION() AS version;';
     579    list($mysql_version) = mysql_fetch_array(pwg_query($query));
     580    if (count($datas) < 10 or version_compare($mysql_version, '4.0.4') < 0)
     581    {
     582      // MySQL is prior to version 4.0.4, multi table update feature is not
     583      // available
     584      foreach ($datas as $data)
     585      {
     586        $query = '
     587  UPDATE '.$tablename.'
     588    SET ';
     589        $is_first = true;
     590        foreach ($dbfields['update'] as $num => $key)
     591        {
     592          if (!$is_first)
     593          {
     594            $query.= ",\n      ";
     595          }
     596          $query.= $key.' = ';
     597          if (isset($data[$key]) and $data[$key] != '')
     598          {
     599            $query.= '\''.$data[$key].'\'';
     600          }
     601          else
     602          {
     603            $query.= 'NULL';
     604          }
     605          $is_first = false;
     606        }
     607        $query.= '
     608    WHERE ';
     609        foreach ($dbfields['primary'] as $num => $key)
     610        {
     611          if ($num > 1)
     612          {
     613            $query.= ' AND ';
     614          }
     615          $query.= $key.' = \''.$data[$key].'\'';
     616        }
     617        $query.= '
     618  ;';
     619        pwg_query($query);
     620      }
     621    }
     622    else
     623    {
     624      // creation of the temporary table
    574625      $query = '
    575 UPDATE '.$tablename.'
    576   SET ';
    577       $is_first = true;
    578       foreach ($dbfields['update'] as $num => $key)
     626  SHOW FULL COLUMNS FROM '.$tablename.'
     627;';
     628      $result = pwg_query($query);
     629      $columns = array();
     630      $all_fields = array_merge($dbfields['primary'], $dbfields['update']);
     631      while ($row = mysql_fetch_array($result))
    579632      {
    580         if (!$is_first)
     633        if (in_array($row['Field'], $all_fields))
    581634        {
    582           $query.= ",\n      ";
     635          $column = $row['Field'];
     636          $column.= ' '.$row['Type'];
     637          if (!isset($row['Null']) or $row['Null'] == '')
     638          {
     639            $column.= ' NOT NULL';
     640          }
     641          if (isset($row['Default']))
     642          {
     643            $column.= " default '".$row['Default']."'";
     644          }
     645          if (isset($row['Collation']) and $row['Collation'] != 'NULL')
     646          {
     647            $column.= " collate '".$row['Collation']."'";
     648          }
     649          array_push($columns, $column);
    583650        }
    584         $query.= $key.' = ';
    585         if (isset($data[$key]) and $data[$key] != '')
    586         {
    587           $query.= '\''.$data[$key].'\'';
    588         }
    589         else
    590         {
    591           $query.= 'NULL';
    592         }
    593         $is_first = false;
    594651      }
    595       $query.= '
    596   WHERE ';
    597       foreach ($dbfields['primary'] as $num => $key)
    598       {
    599         if ($num > 1)
    600         {
    601           $query.= ' AND ';
    602         }
    603         $query.= $key.' = \''.$data[$key].'\'';
    604       }
    605       $query.= '
     652
     653      $temporary_tablename = $tablename.'_'.micro_seconds();
     654
     655      $query = '
     656  CREATE TABLE '.$temporary_tablename.'
     657  (
     658  '.implode(",\n", $columns).',
     659  PRIMARY KEY ('.implode(',', $dbfields['primary']).')
     660  )
    606661;';
    607662      pwg_query($query);
    608     }
    609   }
    610   else
    611   {
    612     // creation of the temporary table
    613     $query = '
    614 SHOW FULL COLUMNS FROM '.$tablename.'
    615 ;';
    616     $result = pwg_query($query);
    617     $columns = array();
    618     $all_fields = array_merge($dbfields['primary'], $dbfields['update']);
    619     while ($row = mysql_fetch_array($result))
    620     {
    621       if (in_array($row['Field'], $all_fields))
    622       {
    623         $column = $row['Field'];
    624         $column.= ' '.$row['Type'];
    625         if (!isset($row['Null']) or $row['Null'] == '')
    626         {
    627           $column.= ' NOT NULL';
    628         }
    629         if (isset($row['Default']))
    630         {
    631           $column.= " default '".$row['Default']."'";
    632         }
    633         if (isset($row['Collation']) and $row['Collation'] != 'NULL')
    634         {
    635           $column.= " collate '".$row['Collation']."'";
    636         }
    637         array_push($columns, $column);
    638       }
    639     }
    640 
    641     $temporary_tablename = $tablename.'_'.micro_seconds();
    642 
    643     $query = '
    644 CREATE TABLE '.$temporary_tablename.'
    645 (
    646 '.implode(",\n", $columns).',
    647 PRIMARY KEY ('.implode(',', $dbfields['primary']).')
    648 )
    649 ;';
    650     pwg_query($query);
    651     mass_inserts($temporary_tablename, $all_fields, $datas);
    652     // update of images table by joining with temporary table
    653     $query = '
    654 UPDATE '.$tablename.' AS t1, '.$temporary_tablename.' AS t2
    655   SET '.
    656       implode(
    657         "\n    , ",
    658         array_map(
    659           create_function('$s', 'return "t1.$s = t2.$s";'),
    660           $dbfields['update']
    661           )
    662         ).'
    663   WHERE '.
    664       implode(
    665         "\n    AND ",
    666         array_map(
    667           create_function('$s', 'return "t1.$s = t2.$s";'),
    668           $dbfields['primary']
    669           )
    670         ).'
    671 ;';
    672     pwg_query($query);
    673     $query = '
    674 DROP TABLE '.$temporary_tablename.'
    675 ;';
    676     pwg_query($query);
     663      mass_inserts($temporary_tablename, $all_fields, $datas);
     664      // update of images table by joining with temporary table
     665      $query = '
     666  UPDATE '.$tablename.' AS t1, '.$temporary_tablename.' AS t2
     667    SET '.
     668        implode(
     669          "\n    , ",
     670          array_map(
     671            create_function('$s', 'return "t1.$s = t2.$s";'),
     672            $dbfields['update']
     673            )
     674          ).'
     675    WHERE '.
     676        implode(
     677          "\n    AND ",
     678          array_map(
     679            create_function('$s', 'return "t1.$s = t2.$s";'),
     680            $dbfields['primary']
     681            )
     682          ).'
     683  ;';
     684      pwg_query($query);
     685      $query = '
     686  DROP TABLE '.$temporary_tablename.'
     687;';
     688      pwg_query($query);
     689    }
    677690  }
    678691}
     
    11601173    USER_ACCESS_TABLE,
    11611174    USER_CACHE_TABLE,
     1175    USER_CACHE_CATEGORIES_TABLE,
    11621176    USER_GROUP_TABLE
    11631177    );
  • trunk/include/category_cats.inc.php

    r1597 r1624  
    3434if ($page['section']=='recent_cats')
    3535{
     36  // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE
    3637  $query = '
    37 SELECT id,name,date_last,representative_picture_id,comment,nb_images,uppercats
    38   FROM '.CATEGORIES_TABLE.'
     38SELECT
     39  id,name, representative_picture_id, comment, nb_images, uppercats,
     40  max_date_last, is_child_date_last, count_images, count_categories
     41  FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
     42  ON id = cat_id and user_id = '.$user['id'].'
    3943  WHERE date_last > SUBDATE(
    4044    CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY
    41   )
    42   AND id NOT IN ('.$user['forbidden_categories'].')';
     45  );';
    4346}
    4447else
    4548{
     49  // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE
    4650  $query = '
    47 SELECT id,name,date_last,representative_picture_id,comment,nb_images
    48   FROM '.CATEGORIES_TABLE.'
     51SELECT
     52  id,name, representative_picture_id, comment, nb_images,
     53  max_date_last, is_child_date_last, count_images, count_categories
     54  FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
     55  ON id = cat_id and user_id = '.$user['id'].'
    4956  WHERE id_uppercat '.
    5057  (!isset($page['category']) ? 'is NULL' : '= '.$page['category']).'
    51     AND id NOT IN ('.$user['forbidden_categories'].')
    5258  ORDER BY rank
    5359;';
     
    6066while ($row = mysql_fetch_assoc($result))
    6167{
     68  $row['is_child_date_last'] = get_boolean($row['is_child_date_last']);
     69
    6270  if (isset($row['representative_picture_id'])
    6371      and is_numeric($row['representative_picture_id']))
     
    146154      {
    147155        $name = $category['name'];
    148         $icon_ts = get_icon(@$category['date_last']);
     156        $icon_ts = get_icon($category['max_date_last'], $category['is_child_date_last']);
    149157      }
    150158
     
    163171              )
    164172            ),
    165           'CAPTION_NB_IMAGES' => (($category['nb_images'] == 0) ? '' : sprintf("%d ".l10n('pictures'), $category['nb_images'])),
     173          'CAPTION_NB_IMAGES' => get_display_images_count
     174                                  (
     175                                    $category['nb_images'],
     176                                    $category['count_images'],
     177                                    $category['count_categories']
     178                                  ),
    166179          'DESCRIPTION' => @$comment,
    167180          'NAME'  => $name,
     
    214227          'thumbnails.line.thumbnail',
    215228          array(
    216             'IMAGE_TS'    => get_icon(@$category['date_last']),
     229            'IMAGE_TS'    => get_icon($category['max_date_last'], $category['is_child_date_last']),
    217230           )
    218231         );
  • trunk/include/constants.php

    r1584 r1624  
    6666define('RATE_TABLE', $prefixeTable.'rate');
    6767define('USER_CACHE_TABLE', $prefixeTable.'user_cache');
     68define('USER_CACHE_CATEGORIES_TABLE', $prefixeTable.'user_cache_categories');
    6869define('CADDIE_TABLE', $prefixeTable.'caddie');
    6970define('UPGRADE_TABLE', $prefixeTable.'upgrade');
  • trunk/include/functions_category.inc.php

    r1573 r1624  
    5353function get_categories_menu()
    5454{
    55   global $page,$user;
    56 
    57   $infos = array('');
    58 
    59   $query = '
    60 SELECT name,id,date_last,nb_images,global_rank
    61   FROM '.CATEGORIES_TABLE.'
    62   WHERE 1 = 1'; // stupid but permit using AND after it !
     55  global $page, $user;
     56
     57  $query = '
     58SELECT ';
     59  // From CATEGORIES_TABLE
     60  $query.= '
     61  name, id, nb_images, global_rank,';
     62  // From USER_CACHE_CATEGORIES_TABLE
     63  $query.= '
     64  max_date_last, is_child_date_last, count_images, count_categories';
     65
     66  // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE
     67  $query.= '
     68  FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
     69  ON id = cat_id and user_id = '.$user['id'];
    6370  if (!$user['expand'])
    6471  {
    6572    $query.= '
    66     AND (id_uppercat is NULL';
     73    WHERE (id_uppercat is NULL';
    6774    if (isset($page['category']))
    6875    {
     
    7077    }
    7178    $query.= ')';
    72   }
    73   if ($user['forbidden_categories'] != '')
    74   {
    75     $query.= '
    76     AND id NOT IN ('.$user['forbidden_categories'].')';
    7779  }
    7880  $query.= '
     
    8385  while ($row = mysql_fetch_array($result))
    8486  {
     87    $row['is_child_date_last'] = get_boolean($row['is_child_date_last']);
    8588    array_push($cats, $row);
    8689  }
     
    8992  return get_html_menu_category($cats);
    9093}
     94
    9195
    9296/**
     
    353357  return ($a['rank'] < $b['rank']) ? -1 : 1;
    354358}
     359
     360/**
     361 * returns display text for information images of category
     362 *
     363 * @param array categories
     364 * @return string
     365 */
     366function get_display_images_count($cat_nb_images, $cat_count_images, $cat_count_categories, $short_message = true)
     367{
     368  $display_text = '';
     369
     370  // Count of category is main
     371  // if not picture on categorie, test on sub-categories
     372  $count = ($cat_nb_images > 0 ? $cat_nb_images : $cat_count_images);
     373
     374  if ($count > 0)
     375  {
     376    $display_text.= sprintf(l10n(($count > 1 ? 'images_available' : 'image_available')), $count);
     377
     378    if ($cat_nb_images > 0)
     379    {
     380      if (! $short_message)
     381      {
     382        $display_text.= ' '.l10n('images_available_cpl');
     383      }
     384    }
     385    else
     386    {
     387      $display_text.= ' '.sprintf(l10n(($cat_count_categories > 1 ? 'images_available_cats' : 'images_available_cat')), $cat_count_categories);
     388    }
     389  }
     390
     391  return $display_text;
     392}
     393
    355394?>
  • trunk/include/functions_html.inc.php

    r1606 r1624  
    2525// +-----------------------------------------------------------------------+
    2626
    27 function get_icon($date)
     27function get_icon($date, $is_child_date = false)
    2828{
    2929  global $page, $user, $conf, $lang;
     
    3434  }
    3535
    36   if (isset($page['get_icon_cache'][$date]))
    37   {
    38     return $page['get_icon_cache'][$date];
     36  if (isset($page['get_icon_cache'][$is_child_date][$date]))
     37  {
     38    return $page['get_icon_cache'][$is_child_date][$date];
    3939  }
    4040
     
    4242  {
    4343    // date can be empty, no icon to display
    44     $page['get_icon_cache'][$date] = '';
    45     return $page['get_icon_cache'][$date];
     44    $page['get_icon_cache'][$is_child_date][$date] = '';
     45    return $page['get_icon_cache'][$is_child_date][$date];
    4646  }
    4747
     
    5252      or $unixtime === -1) // PHP prior to 5.1.0
    5353  {
    54     $page['get_icon_cache'][$date] = '';
    55     return $page['get_icon_cache'][$date];
     54    $page['get_icon_cache'][$is_child_date][$date] = '';
     55    return $page['get_icon_cache'][$is_child_date][$date];
    5656  }
    5757
     
    6262  if ( $diff < $user['recent_period'] * $day_in_seconds )
    6363  {
    64     $icon_url = get_themeconf('icon_dir').'/recent.png';
     64    $icon_url = get_themeconf('icon_dir').'/'.($is_child_date ? 'recent_by_child.png' : 'recent.png');
    6565    $title .= $user['recent_period'];
    6666    $title .=  '&nbsp;'.$lang['days'];
     
    7171  }
    7272
    73   $page['get_icon_cache'][$date] = $output;
    74 
    75   return $page['get_icon_cache'][$date];
     73  $page['get_icon_cache'][$is_child_date][$date] = $output;
     74
     75  return $page['get_icon_cache'][$is_child_date][$date];
    7676}
    7777
     
    393393 * HTML code generated uses logical list tags ul and each category is an
    394394 * item li. The paramter given is the category informations as an array,
    395  * used keys are : id, name, nb_images, date_last
     395 * used keys are : id, name, nb_images, max_date_last, is_child_date_last,
     396 * count_images, count_categories
    396397 *
    397398 * @param array categories
     
    454455    $menu.= '>'.$category['name'].'</a>';
    455456
    456     if ($category['nb_images'] > 0)
    457     {
    458       $menu.= "\n".'<span class="menuInfoCat"';
    459       $menu.= ' title="'.$category['nb_images'];
    460       $menu.= ' '.$lang['images_available'].'">';
    461       $menu.= '['.$category['nb_images'].']';
     457    // Count of category is main
     458    // if not picture on categorie, test on sub-categories
     459    if (($category['nb_images'] > 0) or ($category['count_images'] > 0))
     460    {
     461      $menu.= "\n".'<span class="';
     462      $menu.= ($category['nb_images'] > 0 ? "menuInfoCat"
     463                                          : "menuInfoCatByChild").'"';
     464      $menu.= ' title="';
     465      $menu.= ' '.get_display_images_count
     466                  (
     467                    $category['nb_images'],
     468                    $category['count_images'],
     469                    $category['count_categories'],
     470                    false
     471                  ).'">';
     472      $menu.= '['.($category['nb_images'] > 0 ? $category['nb_images']
     473                                              : $category['count_images']).']';
    462474      $menu.= '</span>';
    463       $menu.= get_icon($category['date_last']);
    464     }
     475    }
     476
     477    $menu.= get_icon($category['max_date_last'], $category['is_child_date_last']);
    465478  }
    466479
  • trunk/include/functions_user.inc.php

    r1622 r1624  
    273273        calculate_permissions($userdata['id'], $userdata['status']);
    274274
     275      update_user_cache_categorie($userdata['id'], $userdata['forbidden_categories']);
     276
     277      // Set need update are done
     278      $userdata['need_update'] = false;
     279
    275280      $query = '
    276281SELECT COUNT(DISTINCT(image_id)) as total
     
    289294      $query = '
    290295INSERT INTO '.USER_CACHE_TABLE.'
    291   (user_id,need_update,forbidden_categories,nb_total_images)
     296  (user_id, need_update, forbidden_categories, nb_total_images)
    292297  VALUES
    293   ('.$userdata['id'].',\'false\',\''
     298  ('.$userdata['id'].',\''.boolean_to_string($userdata['need_update']).'\',\''
    294299  .$userdata['forbidden_categories'].'\','.$userdata['nb_total_images'].')
    295300;';
    296301      pwg_query($query);
     302    }
     303
     304    {
    297305    }
    298306  }
     
    438446
    439447  return implode(',', $forbidden_array);
     448}
     449
     450/**
     451 * update data of user_cache_categorie
     452 *
     453 * @param int user_id
     454 * @return null
     455 */
     456function update_user_cache_categorie($user_id, $user_forbidden_categories)
     457{
     458  function compute_branch_cat_data(&$cats, &$list_cat_id, &$level, &$ref_level)
     459  {
     460    $date = '';
     461    $count_images = 0;
     462    $count_categories = 0;
     463    do
     464    {
     465      $cat_id = array_pop($list_cat_id);
     466      if (!is_null($cat_id))
     467      {
     468        // Count images and categories
     469        $cats[$cat_id]['count_images'] += $count_images;
     470        $cats[$cat_id]['count_categories'] += $count_categories;
     471        $count_images = $cats[$cat_id]['count_images'];
     472        $count_categories = $cats[$cat_id]['count_categories'] + 1;
     473
     474        if ((empty($cats[$cat_id]['max_date_last'])) or ($cats[$cat_id]['max_date_last'] < $date))
     475        {
     476          $cats[$cat_id]['max_date_last'] = $date;
     477          $cats[$cat_id]['is_child_date_last'] = true;
     478        }
     479        else
     480        {
     481          $date = $cats[$cat_id]['max_date_last'];
     482        }
     483        $ref_level = substr_count($cats[$cat_id]['global_rank'], '.') + 1;
     484      }
     485      else
     486      {
     487        $ref_level = 0;
     488      }
     489    } while ($level <= $ref_level);
     490
     491    // Last cat updating must be added to list for next branch
     492    if ($ref_level <> 0)
     493    {
     494      array_push($list_cat_id, $cat_id);
     495    }
     496  }
     497
     498  // delete user cache
     499  $query = '
     500  delete from '.USER_CACHE_CATEGORIES_TABLE.'
     501  where user_id = '.$user_id.'
     502;';
     503  pwg_query($query);
     504
     505  $query = '
     506    select
     507      id cat_id, date_last,
     508      nb_images, global_rank
     509    from '.CATEGORIES_TABLE;
     510  if ($user_forbidden_categories != '')
     511  {
     512    $query.= '
     513    where id not in ('.$user_forbidden_categories.')';
     514  }
     515  $query.= ';';
     516
     517  $result = pwg_query($query);
     518
     519  $cats = array();
     520  while ($row = mysql_fetch_array($result))
     521  {
     522    $cats += array($row['cat_id'] => $row);
     523  }
     524  usort($cats, 'global_rank_compare');
     525
     526  $ref_level = 0;
     527  $level = 0;
     528  $list_cat_id = array();
     529
     530  foreach ($cats as $id => $category)
     531  {
     532    // Update field
     533    $cats[$id]['user_id'] = $user_id;
     534    $cats[$id]['is_child_date_last'] = false;
     535    $cats[$id]['max_date_last'] = $cats[$id]['date_last'];
     536    $cats[$id]['count_images'] = $cats[$id]['nb_images'];
     537    $cats[$id]['count_categories'] = 0;
     538
     539    // Compute
     540    $level = substr_count($category['global_rank'], '.') + 1;
     541    if ($level > $ref_level)
     542    {
     543      array_push($list_cat_id, $id);
     544    }
     545    else
     546    {
     547      compute_branch_cat_data($cats, $list_cat_id, $level, $ref_level);
     548      array_push($list_cat_id, $id);
     549    }
     550    $ref_level = $level;
     551  }
     552
     553  $level = 1;
     554  compute_branch_cat_data($cats, $list_cat_id, $level, $ref_level);
     555
     556  foreach ($cats as $id => $category)
     557  {
     558    // Convert field
     559    $cats[$id]['is_child_date_last'] = boolean_to_string($cats[$id]['is_child_date_last']);
     560  }
     561
     562  include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
     563  mass_inserts
     564  (
     565    USER_CACHE_CATEGORIES_TABLE,
     566    array
     567    (
     568      'user_id', 'cat_id',
     569      'is_child_date_last', 'max_date_last',
     570      'count_images', 'count_categories'
     571    ),
     572    $cats
     573  );
    440574}
    441575
  • trunk/index.php

    r1623 r1624  
    108108}
    109109
    110 $icon_recent = get_icon(date('Y-m-d'));
    111 
    112110if (!isset($page['chronology_field']))
    113111{
     
    164162$template->assign_vars(
    165163  array(
    166     'TITLE' => $template_title,
    167     'TOP_NUMBER' => $conf['top_number'],        // still used ?
    168     'T_RECENT' => $icon_recent,                 // still used ?
     164    'TITLE' => $template_title
    169165    )
    170166  );
  • trunk/install/phpwebgallery_structure.sql

    r1622 r1624  
    291291
    292292--
     293-- Table structure for table `phpwebgallery_user_cache_categories`
     294--
     295
     296DROP TABLE IF EXISTS `phpwebgallery_user_cache_categories`;
     297CREATE TABLE `phpwebgallery_user_cache_categories` (
     298  `user_id` smallint(5) NOT NULL default '0',
     299  `cat_id` smallint(5) unsigned NOT NULL default '0',
     300  `is_child_date_last` enum('true','false') NOT NULL default 'false',
     301  `max_date_last` datetime default NULL,
     302  `count_images` mediumint(8) unsigned default 0,
     303  `count_categories` mediumint(8) unsigned default 0,
     304  PRIMARY KEY  (`user_id`, `cat_id`)
     305) TYPE=MyISAM;
     306
     307--
    293308-- Table structure for table `phpwebgallery_user_feed`
    294309--
  • trunk/language/en_UK.iso-8859-1/common.lang.php

    r1620 r1624  
    463463$lang['ident_title'] = 'ident_title';
    464464$lang['identification'] = 'Identification';
    465 $lang['images_available'] = 'images in this category';
     465$lang['image_available'] = '%d image';
     466$lang['images_available'] = '%d images';
     467$lang['images_available_cpl'] = 'in this category';
     468$lang['images_available_cat'] = 'in %d sub-catégory';
     469$lang['images_available_cats'] = 'in %d sub-catégories';
    466470$lang['included'] = 'included';
    467471$lang['invalid_pwd'] = 'Invalid password!';
  • trunk/language/fr_FR.iso-8859-1/common.lang.php

    r1620 r1624  
    462462$lang['ident_title'] = 'Identification (FIXME)';
    463463$lang['identification'] = 'Identification';
    464 $lang['images_available'] = 'images dans cette catégorie';
     464$lang['image_available'] = '%d image';
     465$lang['images_available'] = '%d images';
     466$lang['images_available_cpl'] = 'dans cette catégorie';
     467$lang['images_available_cat'] = 'dans %d sous-catégorie';
     468$lang['images_available_cats'] = 'dans %d sous-catégories';
    465469$lang['included'] = 'inclus';
    466470$lang['invalid_pwd'] = 'Mot de passe invalide !';
Note: See TracChangeset for help on using the changeset viewer.