Changeset 5341


Ignore:
Timestamp:
Mar 25, 2010, 11:27:17 AM (11 years ago)
Author:
patdenice
Message:

Feature 1535: Add languages table.
Ready for theme manager!

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/constants.php

    r5196 r5341  
    105105if (!defined('THEMES_TABLE'))
    106106  define('THEMES_TABLE', $prefixeTable.'themes');
     107if (!defined('LANGUAGES_TABLE'))
     108  define('LANGUAGES_TABLE', $prefixeTable.'languages');
    107109
    108110?>
  • trunk/install.php

    r5340 r5341  
    274274      if ($dblayer=='mysql')
    275275      {
    276         $install_charset_collate = "DEFAULT CHARACTER SET $pwg_db_charset";
     276        $install_charset_collate = "DEFAULT CHARACTER SET $pwg_db_charset";
     277        pwg_query('SET NAMES "'.$pwg_db_charset.'"');
    277278      }
    278279      else
    279280      {
    280         $install_charset_collate = '';
     281        $install_charset_collate = '';
    281282      }
    282283    }
     
    373374   \'a secret key specific to the gallery for internal use\');';
    374375    pwg_query($query);
     376
     377    // fill languages table
     378    $inserts = array();
     379    foreach (get_languages('utf-8') as $language_code => $language_name)
     380    {
     381      $inserts[] = array(
     382        'id' => $language_code,
     383        'name' => $language_name,
     384      );
     385    }
     386    mass_inserts(LANGUAGES_TABLE, array('id', 'name'), $inserts);
    375387
    376388    // fill $conf global array
  • trunk/install/db/85-database.php

    r5196 r5341  
    3737)";
    3838
     39if (DB_CHARSET == 'utf8')
     40{
     41  $query .= " DEFAULT CHARACTER SET utf8";
     42}
     43
    3944pwg_query($query);
    4045
  • trunk/install/piwigo_structure-mysql.sql

    r5153 r5341  
    205205
    206206--
     207-- Table structure for table `piwigo_languages`
     208--
     209
     210DROP TABLE IF EXISTS `piwigo_languages`;
     211CREATE TABLE `piwigo_languages` (
     212  `id` varchar(64) NOT NULL default '',
     213  `version` varchar(64) NOT NULL default '0',
     214  `name` varchar(64) default NULL,
     215  PRIMARY KEY  (`id`)
     216) TYPE=MyISAM;
     217
     218--
    207219-- Table structure for table `piwigo_old_permalinks`
    208220--
Note: See TracChangeset for help on using the changeset viewer.