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/admin/include/functions_install.inc.php

    r5781 r5982  
    3434 * @return void
    3535 */
    36 function execute_sqlfile($filepath, $replaced, $replacing)
     36function execute_sqlfile($filepath, $replaced, $replacing, $dblayer)
    3737{
    3838  $sql_lines = file($filepath);
     
    5555      if (!preg_match('/^DROP TABLE/i', $query))
    5656      {
    57         global $install_charset_collate;
    58         if ( !empty($install_charset_collate) )
     57        if ('mysql' == $dblayer)
    5958        {
    6059          if ( preg_match('/^(CREATE TABLE .*)[\s]*;[\s]*/im', $query, $matches) )
    6160          {
    62             $query = $matches[1].' '.$install_charset_collate.';';
     61            $query = $matches[1].' DEFAULT CHARACTER SET utf8'.';';
    6362          }
    6463        }
     
    126125
    127126/**
    128  * Automatically activate all themes in the "themes" directory.
     127 * Automatically activate all core themes in the "themes" directory.
    129128 *
    130129 * @return void
    131130 */
    132 function activate_all_themes()
     131function activate_core_themes()
    133132{
    134133  include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');
     
    136135  foreach ($themes->fs_themes as $theme_id => $fs_theme)
    137136  {
    138     $themes->perform_action('activate', $theme_id);
     137    if (in_array($theme_id, array('Sylvia', 'clear', 'dark')))
     138    {
     139      $themes->perform_action('activate', $theme_id);
     140    }
    139141  }
    140142}
     
    144146  try
    145147  {
    146     $pwg_db_link = pwg_db_connect($_POST['dbhost'], $_POST['dbuser'],
    147                                   $_POST['dbpasswd'], $_POST['dbname']);
    148  
    149     return $pwg_db_link;
     148    $pwg_db_link = pwg_db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpasswd'], $_POST['dbname']);
     149    if ($pwg_db_link)
     150    {
     151      pwg_db_check_version();
     152    }
    150153  }
    151154  catch (Exception $e)
     
    153156    array_push( $errors, l10n($e->getMessage()));
    154157  }
    155   return false;
    156158}
    157159?>
Note: See TracChangeset for help on using the changeset viewer.