New Community Forums are coming. Watch this space for news.
Subscribe: RSS
  • Hi,

    I slightly adapted the code of Easy2Gallery's module to make it multilingual.
    Added new table easy2_translations storing the multilingual fields.

    The 'summary' field was renamed to 'title' to store the multilingual titles of the picture.
    Added fields 'author' and 'source'. The maximum length some fields was shortened.

    A multiligual version of the module class can be downloaded here:
    http://altipoint.ch/modx_development/easy2g/includes/classes/
    More details in the comments at the beginning of the file.

    Please note that this is work under progress and the templates must still be adapted.
    I'll try to post soon some SQL requests and pictures so that you can easily populate demonstation tables.

    The new table structure
    CREATE TABLE `modx_easy2_files` (
      `id` int(10) unsigned NOT NULL auto_increment,
      `dir_id` int(10) unsigned NOT NULL default '0',
      `filename` varchar(128) NOT NULL default '',
      `size` varchar(32) NOT NULL default '',
      `name` varchar(128) NOT NULL default '',
      `author` varchar(32) default '',
      `tag` varchar(255) default '',
      `date_added` datetime NOT NULL default '0000-00-00 00:00:00',
      `last_modified` datetime default NULL,
      `comments` int(10) unsigned NOT NULL default '0',
      `status` tinyint(3) unsigned NOT NULL default '1',
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
    
    CREATE TABLE `modx_easy2_translations` (
      `id` int(10) unsigned NOT NULL,
      `file_id` int(10) unsigned NOT NULL,
      `lang` char(2) NOT NULL default '',
      `title` varchar(255) NOT NULL default '',
      `source` varchar(32) default '',
      `description` text,
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
    • For those who want to test and contribute to the development, some demo content, can be found here
      http://altipoint.ch/modx_development/easy2g/

      - populate_easy2_multilingual.sql.txt contains the requests to populate the two tables

      - fonds.zip contains the pictures sorted in 3 galleries

      The pictures come from the Swiss National Library.
      http://www.nb.admin.ch/sammlungen/graphische_sammlung/00649/index.html?lang=en
      They are available under Creative Common licence on Wikimedia.