Ignore:
Timestamp:
Nov 24, 2013, 6:09:57 PM (11 years ago)
Author:
mistic100
Message:

very big update for Piwigo 2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserCollections/main.inc.php

    r24421 r25678  
    1 <?php 
     1<?php
    22/*
    33Plugin Name: User Collections
     
    1818global $conf, $prefixeTable;
    1919
    20 defined('USER_COLLEC_ID') or define('USER_COLLEC_ID', basename(dirname(__FILE__)));
     20define('USER_COLLEC_ID',          basename(dirname(__FILE__)));
    2121define('USER_COLLEC_PATH',        PHPWG_PLUGINS_PATH . USER_COLLEC_ID . '/');
    2222define('COLLECTIONS_TABLE',       $prefixeTable.'collections');
     
    4343  // thumbnails actions
    4444  add_event_handler('loc_end_index_thumbnails', 'user_collections_thumbnails_list', EVENT_HANDLER_PRIORITY_NEUTRAL-10, 2);
    45   add_event_handler('loc_end_index_thumbnails', 'uc_anti_lightbox', 41);
    4645
    4746  // picture action
     
    6463function user_collections_init()
    6564{
    66   global $pwg_loaded_plugins, $conf;
    67  
    68   if (
    69     USER_COLLEC_VERSION == 'auto' or
    70     $pwg_loaded_plugins[USER_COLLEC_ID]['version'] == 'auto' or
    71     version_compare($pwg_loaded_plugins[USER_COLLEC_ID]['version'], USER_COLLEC_VERSION, '<')
    72   )
    73   {
    74     include_once(USER_COLLEC_PATH . 'include/install.inc.php');
    75     user_collections_install();
    76    
    77     if ( $pwg_loaded_plugins[USER_COLLEC_ID]['version'] != 'auto' and USER_COLLEC_VERSION != 'auto' )
    78     {
    79       $query = '
    80 UPDATE '. PLUGINS_TABLE .'
    81 SET version = "'. USER_COLLEC_VERSION .'"
    82 WHERE id = "'. USER_COLLEC_ID .'"';
    83       pwg_query($query);
    84      
    85       $pwg_loaded_plugins[USER_COLLEC_ID]['version'] = USER_COLLEC_VERSION;
    86      
    87       if (defined('IN_ADMIN'))
    88       {
    89         $_SESSION['page_infos'][] = 'UserCollections updated to version '. USER_COLLEC_VERSION;
    90       }
    91     }
    92   }
    93  
     65  global $conf;
     66
     67  include_once(USER_COLLEC_PATH . 'maintain.inc.php');
     68  $maintain = new UserCollections_maintain(USER_COLLEC_ID);
     69  $maintain->autoUpdate(USER_COLLEC_VERSION, 'install');
     70
    9471  load_language('plugin.lang', USER_COLLEC_PATH);
    95  
     72
    9673  $conf['user_collections'] = unserialize($conf['user_collections']);
    9774}
     
    10077 * admin plugins menu
    10178 */
    102 function user_collections_admin_menu($menu) 
     79function user_collections_admin_menu($menu)
    10380{
    104   array_push($menu, array(
     81  $menu[] = array(
    10582    'NAME' => 'User Collections',
    10683    'URL' => USER_COLLEC_ADMIN,
    107   ));
     84    );
     85
    10886  return $menu;
    10987}
    110 
    111 ?>
Note: See TracChangeset for help on using the changeset viewer.