Ignore:
Timestamp:
Apr 28, 2010, 4:28:05 PM (14 years ago)
Author:
plg
Message:

feature 1630: upgrade to Piwigo 2.1 :-)

bug 1604: only activate core themes not all themes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/install/db/86-database.php

    r5452 r5982  
    2727}
    2828
    29 $upgrade_description = 'Automatically activate core themes and used themes.';
     29$upgrade_description = 'Automatically activate core themes.';
    3030
    31 $themes_core = array('Sylvia', 'dark', 'clear');
    32 
    33 $query = '
    34 SELECT
    35     DISTINCT(theme)
    36   FROM '.PREFIX_TABLE.'user_infos
    37 ;';
    38 $themes_used = array_from_query($query, 'theme');
    39 
    40 $query = '
    41 SELECT
    42     id
    43   FROM '.PREFIX_TABLE.'themes
    44 ;';
    45 $themes_active = array_from_query($query, 'id');
    46 
    47 
    48 $themes_to_activate = array_diff(
    49   array_unique(array_merge($themes_used, $themes_core)),
    50   $themes_active
    51   );
    52 
    53 // echo '<pre>'; print_r($themes_to_activate); echo '</pre>'; exit();
    54 
    55 foreach ($themes_to_activate as $theme)
    56 {
    57   $query = '
    58 INSERT INTO '.PREFIX_TABLE.'themes
    59   (id) VALUES(\''.$theme.'\'
    60 ;';
    61   pwg_query($query);
    62 }
     31include_once(PHPWG_ROOT_PATH . 'admin/include/functions_install.inc.php');
     32activate_core_themes();
    6333
    6434echo
Note: See TracChangeset for help on using the changeset viewer.