Changeset 5982 for trunk/install


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.

Location:
trunk/install
Files:
1 added
3 edited

Legend:

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

    r5215 r5982  
    166166  $query = 'SHOW TABLES LIKE "'.$prefixeTable.'%"';
    167167  $result = pwg_query($query);
    168   while ( $row=pwg_db_fetch_assoc($result) )
     168  while ( $row=pwg_db_fetch_row($result) )
    169169  {
    170170    array_push($all_tables, $row[0]);
  • 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
  • trunk/install/upgrade_1.7.0.php

    r5196 r5982  
    3333  }
    3434}
    35 
    36 define('UPGRADES_PATH', PHPWG_ROOT_PATH.'install/db');
    37 
    38 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();'));
    39 define('CURRENT_DATE', $dbnow);
    4035
    4136// +-----------------------------------------------------------------------+
     
    8984echo '<pre>';
    9085
    91 for ($upgrade_id = 61; ; $upgrade_id++)
     86for ($upgrade_id = 61; $upgrade_id <= 79; $upgrade_id++)
    9287{
    9388  if (!file_exists(UPGRADES_PATH.'/'.$upgrade_id.'-database.php'))
     
    120115
    121116// now we upgrade from 2.0.0
    122 // include_once(PHPWG_ROOT_PATH.'install/upgrade_2.0.0.php');
     117include_once(PHPWG_ROOT_PATH.'install/upgrade_2.0.0.php');
    123118?>
Note: See TracChangeset for help on using the changeset viewer.