Ignore:
Timestamp:
Jun 7, 2013, 2:41:14 PM (11 years ago)
Author:
plg
Message:

New feature: user album. Only for registered users, no recursivity. Piwigo
will automatically create an upload album for each user with appropriate
community permissions, at first connection.

Bug fixed: on activation, do not create a new "Community" album if it already
exists.

Bug fixed: remove debug for quota

Bug fixed: round corners for number of pending pictures in admin menu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/community/maintain.inc.php

    r23037 r23085  
    2424  $query = 'DROP TABLE '.$prefixeTable.'community_pendings;';
    2525  pwg_query($query);
     26
     27  $query = 'ALTER TABLE '.$prefixeTable.'categories drop column community_user;';
     28  pwg_query($query);
     29
     30  // delete configuration
     31  pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param IN ("community", "community_cache_key");');
    2632}
    2733
     
    241247{
    242248  global $prefixeTable;
    243  
    244   // create an album "Community"
    245   $category_info = create_virtual_category('Community');
     249
     250  // is there a "Community" album?
     251  $query = '
     252SELECT
     253    id
     254  FROM '.CATEGORIES_TABLE.'
     255  WHERE name = \'Community\'
     256;';
     257  $result = pwg_query($query);
     258  while ($row = pwg_db_fetch_assoc($result))
     259  {
     260    $category_id = $row['id'];
     261    break;
     262  }
     263
     264  if (!isset($category_id))
     265  {
     266    // create an album "Community"
     267    $category_info = create_virtual_category('Community');
     268    $category_id = $category_info['id'];
     269  }
    246270
    247271  $insert = array(
    248272    'type' => 'any_registered_user',
    249     'category_id' => $category_info['id'],
     273    'category_id' => $category_id,
    250274    'recursive' => 'true',
    251275    'create_subcategories' => 'true',
Note: See TracChangeset for help on using the changeset viewer.