Changeset 2579


Ignore:
Timestamp:
Sep 24, 2008, 3:27:49 AM (16 years ago)
Author:
rvelices
Message:
  • feature admin element set: recently posted images (nice if you forget add to caddie during synchro phase)
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin.php

    r2574 r2579  
    8888    'U_RATING'=> $link_start.'rating',
    8989    'U_CADDIE'=> $link_start.'element_set&cat=caddie',
     90    'U_RECENT_SET'=> $link_start.'element_set&cat=recent',
    9091    'U_TAGS'=> $link_start.'tags',
    9192    'U_THUMBNAILS'=> $link_start.'thumbnail',
  • trunk/admin/element_set.php

    r2299 r2579  
    2525 * Management of elements set. Elements can belong to a category or to the
    2626 * user caddie.
    27  * 
     27 *
    2828 */
    29  
     29
    3030if (!defined('PHPWG_ROOT_PATH'))
    3131{
     
    103103// To element_set_(global|unit).php, we must provide the elements id of the
    104104// managed category in $page['cat_elements_id'] array.
    105 
     105$page['cat_elements_id'] = array();
    106106if (is_numeric($_GET['cat']))
    107107{
     
    112112      false
    113113      );
    114  
     114
    115115  $query = '
    116116SELECT image_id
     
    123123{
    124124  $page['title'] = l10n('caddie');
    125  
     125
    126126  $query = '
    127127SELECT element_id
     
    134134{
    135135  $page['title'] = l10n('Elements_not_linked');
    136  
     136
    137137  // we are searching elements not linked to any virtual category
    138138  $query = '
     
    160160    $page['cat_elements_id'] = array_diff($all_elements, $linked_to_virtual);
    161161  }
    162   else
    163   {
    164     $page['cat_elements_id'] = array();
    165   }
    166162}
    167163else if ('duplicates' == $_GET['cat'])
    168164{
    169165  $page['title'] = l10n('Duplicates');
    170  
     166
    171167  // we are searching related elements twice or more to physical categories
    172168  // 1 - Retrieve Files
    173169  $query = '
    174170SELECT DISTINCT(file)
    175   FROM '.IMAGES_TABLE.' 
    176  GROUP BY file 
    177 HAVING COUNT(DISTINCT storage_category_id) > 1 
    178 ;'; 
     171  FROM '.IMAGES_TABLE.'
     172 GROUP BY file
     173HAVING COUNT(DISTINCT storage_category_id) > 1
     174;';
    179175
    180176  $duplicate_files = array_from_query($query, 'file');
     
    183179  $query = '
    184180SELECT id, file
    185   FROM '.IMAGES_TABLE.' 
     181  FROM '.IMAGES_TABLE.'
    186182WHERE file IN (\''.implode("','", $duplicate_files).'\')
    187183ORDER BY file, id
     
    189185
    190186  $page['cat_elements_id'] = array_from_query($query, 'id');
    191   $page['cat_elements_id'][] = 0;
    192 }
     187}
     188elseif ('recent'== $_GET['cat'])
     189{
     190  $page['title'] = l10n('recent_pics_cat');
     191  $query = 'SELECT MAX(date_available) AS date
     192  FROM '.IMAGES_TABLE;
     193  if ($row=mysql_fetch_array( pwg_query($query) ) )
     194  {
     195    $query = 'SELECT id
     196  FROM '.IMAGES_TABLE.'
     197  WHERE date_available BETWEEN DATE_SUB("'.$row['date'].'", INTERVAL 1 DAY) AND "'.$row['date'].'"';
     198    $page['cat_elements_id'] = array_from_query($query, 'id');
     199  }
     200}
     201
    193202// +-----------------------------------------------------------------------+
    194203// |                       first element to display                        |
  • trunk/admin/template/goto/admin.tpl

    r2574 r2579  
    6565        <li><a href="{$U_TAGS}">{'Tags'|@translate}</a></li>
    6666        <li><a href="{$U_CADDIE}">{'Caddie'|@translate}</a></li>
     67        <li><a href="{$U_RECENT_SET}">{'recent_pics_cat'|@translate}</a></li>
    6768      </ul>
    6869    </dd>
  • trunk/admin/template/goto/theme/roma/themeconf.inc.php

    r2530 r2579  
    1818      case 'cat_move':
    1919      case 'cat_options':
    20       case 'element_set':
    2120      case 'cat_perm':
    2221      case 'permalinks':
     22        return 2;
     23      case 'element_set':
     24        if (isset($_GET['cat']) and is_numeric($_GET['cat']) ) {
     25          return 2;
     26        }
    2327      case 'picture_modify':
    24         if (isset($_GET['cat']) and $_GET['cat']=='caddie') {
    25           return 3;
    26         }
    27         return 2;
     28        return 3;
    2829      case 'comments':
    2930      case 'upload':
Note: See TracChangeset for help on using the changeset viewer.