CREATE TABLE `<site>_banner` (
  `id` int(10) NOT NULL auto_increment,
  `type` enum('small','large') NOT NULL default 'small',
  `pos` int(10) NOT NULL default '0',
  `destpage` varchar(20) NOT NULL default '',
  `param` varchar(255) NOT NULL default '',
  `url` varchar(255) NOT NULL default '',
  `clicks` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

INSERT INTO `<site>_banner` SELECT * FROM `<template>_banner`;

CREATE TABLE `<site>_bannerxlang` (
  `lang` varchar(10) NOT NULL default '',
  `banner` int(10) NOT NULL default '0',
  `title` varchar(255) NOT NULL default '',
  `img` varchar(255) NOT NULL default '',
  `text` text NOT NULL,
  PRIMARY KEY  (`lang`,`banner`)
) TYPE=MyISAM;

INSERT INTO `<site>_bannerxlang` SELECT * FROM `<template>_bannerxlang`;

CREATE TABLE `<site>_download` (
  `name` varchar(20) NOT NULL default '',
  `section` int(10) NOT NULL default '0',
  PRIMARY KEY  (`name`)
) TYPE=MyISAM;

INSERT INTO `<site>_download` SELECT * FROM `<template>_download`;

CREATE TABLE `<site>_download_file` (
  `id` int(10) NOT NULL auto_increment,
  `download` varchar(20) NOT NULL default '',
  `section` int(10) NOT NULL default '0',
  `author` varchar(255) NOT NULL default '',
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
  `downloads` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

INSERT INTO `<site>_download_file` SELECT * FROM `<template>_download_file`;

CREATE TABLE `<site>_download_filexlang` (
  `id` int(10) NOT NULL default '0',
  `lang` varchar(10) NOT NULL default '',
  `download` varchar(20) NOT NULL default '',
  `file` varchar(255) NOT NULL default '',
  `title` text NOT NULL,
  `abstract` text NOT NULL,
  `text` text NOT NULL,
  `img` varchar(255) NOT NULL default '',
  `imgalt` varchar(255) NOT NULL default '',
  `format` text NOT NULL,
  PRIMARY KEY  (`id`,`lang`)
) TYPE=MyISAM;

INSERT INTO `<site>_download_filexlang` SELECT * FROM `<template>_download_filexlang`;

CREATE TABLE `<site>_event` (
  `name` varchar(20) NOT NULL default '',
  `section` int(10) NOT NULL default '0',
  PRIMARY KEY  (`name`)
) TYPE=MyISAM;

INSERT INTO `<site>_event` SELECT * FROM `<template>_event`;

CREATE TABLE `<site>_event_event` (
  `id` int(10) NOT NULL auto_increment,
  `event` varchar(20) NOT NULL default '',
  `section` int(10) NOT NULL default '0',
  `startdate` datetime default NULL,
  `enddate` datetime default NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

INSERT INTO `<site>_event_event` SELECT * FROM `<template>_event_event`;

CREATE TABLE `<site>_event_eventxlang` (
  `id` int(10) NOT NULL default '0',
  `lang` varchar(10) NOT NULL default '',
  `event` varchar(20) NOT NULL default '',
  `title` text NOT NULL,
  `place` text NOT NULL,
  `who` text NOT NULL,
  `text` text NOT NULL,
  `img` varchar(255) NOT NULL default '',
  `imgalt` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`,`lang`)
) TYPE=MyISAM;

INSERT INTO `<site>_event_eventxlang` SELECT * FROM `<template>_event_eventxlang`;

CREATE TABLE `<site>_htmltext` (
  `name` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`name`)
) TYPE=MyISAM;

INSERT INTO `<site>_htmltext` SELECT * FROM `<template>_htmltext`;

CREATE TABLE `<site>_htmltextxlang` (
  `htmltext` varchar(20) NOT NULL default '',
  `lang` varchar(10) NOT NULL default '',
  `text` text NOT NULL,
  PRIMARY KEY  (`htmltext`,`lang`)
) TYPE=MyISAM;

INSERT INTO `<site>_htmltextxlang` SELECT * FROM `<template>_htmltextxlang`;

CREATE TABLE `<site>_link` (
  `name` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`name`)
) TYPE=MyISAM;

INSERT INTO `<site>_link` SELECT * FROM `<template>_link`;

CREATE TABLE `<site>_link_link` (
  `id` int(10) NOT NULL auto_increment,
  `link` varchar(20) NOT NULL default '',
  `destpage` varchar(20) NOT NULL default '',
  `param` varchar(255) NOT NULL default '',
  `url` varchar(255) NOT NULL default '',
  `pos` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

INSERT INTO `<site>_link_link` SELECT * FROM `<template>_link_link`;

CREATE TABLE `<site>_link_linkxlang` (
  `lang` varchar(10) NOT NULL default '',
  `id` int(10) NOT NULL default '0',
  `link` varchar(20) NOT NULL default '',
  `title` varchar(255) NOT NULL default '',
  `img` varchar(255) NOT NULL default '',
  `text` text NOT NULL,
  PRIMARY KEY  (`lang`,`id`)
) TYPE=MyISAM;

INSERT INTO `<site>_link_linkxlang` SELECT * FROM `<template>_link_linkxlang`;

CREATE TABLE `<site>_menu` (
  `id` int(10) NOT NULL auto_increment,
  `destpage` varchar(20) NOT NULL default '',
  `param` varchar(255) NOT NULL default '',
  `url` varchar(255) NOT NULL default '',
  `pos` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

INSERT INTO `<site>_menu` SELECT * FROM `<template>_menu`;

CREATE TABLE `<site>_menuxlang` (
  `lang` varchar(10) NOT NULL default '',
  `menu` int(10) NOT NULL default '0',
  `title` varchar(255) NOT NULL default '',
  `img` varchar(255) NOT NULL default '',
  `text` text NOT NULL,
  PRIMARY KEY  (`lang`,`menu`)
) TYPE=MyISAM;

INSERT INTO `<site>_menuxlang` SELECT * FROM `<template>_menuxlang`;

CREATE TABLE `<site>_module` (
  `name` varchar(20) NOT NULL default '',
  `page` varchar(20) NOT NULL default '',
  `type` varchar(20) NOT NULL default '',
  `pos` int(10) NOT NULL default '0',
  PRIMARY KEY  (`name`)
) TYPE=MyISAM;

INSERT INTO `<site>_module` SELECT * FROM `<template>_module`;

CREATE TABLE `<site>_modulexlang` (
  `module` varchar(20) NOT NULL default '',
  `lang` varchar(10) NOT NULL default '',
  `title` varchar(255) NOT NULL default '',
  `img` varchar(255) NOT NULL default '',
  `text` text NOT NULL,
  PRIMARY KEY  (`module`,`lang`)
) TYPE=MyISAM;

INSERT INTO `<site>_modulexlang` SELECT * FROM `<template>_modulexlang`;

CREATE TABLE `<site>_news` (
  `name` varchar(20) NOT NULL default '',
  `section` int(10) NOT NULL default '0',
  `email` varchar(255) NOT NULL default '',
  `emaillang` varchar(10) NOT NULL default '',
  PRIMARY KEY  (`name`)
) TYPE=MyISAM;

INSERT INTO `<site>_news` SELECT * FROM `<template>_news`;

CREATE TABLE `<site>_news_article` (
  `id` int(10) NOT NULL auto_increment,
  `news` varchar(20) NOT NULL default '',
  `section` int(10) NOT NULL default '0',
  `author` varchar(255) NOT NULL default '',
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
  `status` enum('draft','online','offline') NOT NULL default 'draft',
  `pos` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

INSERT INTO `<site>_news_article` SELECT * FROM `<template>_news_article`;

CREATE TABLE `<site>_news_articlexlang` (
  `id` int(10) NOT NULL default '0',
  `lang` varchar(10) NOT NULL default '',
  `news` varchar(20) NOT NULL default '',
  `title` text NOT NULL,
  `subtitle` text NOT NULL,
  `abstract` text NOT NULL,
  `text` text NOT NULL,
  `img` varchar(255) NOT NULL default '',
  `imgalt` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`,`lang`)
) TYPE=MyISAM;

INSERT INTO `<site>_news_articlexlang` SELECT * FROM `<template>_news_articlexlang`;

CREATE TABLE `<site>_news_comments` (
  `id` int(10) NOT NULL auto_increment,
  `article` int(10) NOT NULL default '0',
  `news` varchar(20) NOT NULL default '',
  `nick` varchar(20) NOT NULL default '',
  `text` text NOT NULL,
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
  `status` enum('new','ok') NOT NULL default 'new',
  `lang` varchar(10) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

INSERT INTO `<site>_news_comments` SELECT * FROM `<template>_news_comments`;

CREATE TABLE `<site>_newsfeed` (
`name` VARCHAR( 20 ) NOT NULL ,
PRIMARY KEY ( `name` ) 
);

INSERT INTO `<site>_newsfeed` SELECT * FROM `<template>_newsfeed`;

CREATE TABLE `<site>_newsfeedxlang` (
`newsfeed` VARCHAR( 20 ) NOT NULL ,
`lang` VARCHAR( 10 ) NOT NULL ,
`feed` VARCHAR( 255 ) NOT NULL ,
PRIMARY KEY ( `newsfeed` , `lang` ) 
);

INSERT INTO `<site>_newsfeedxlang` SELECT * FROM `<template>_newsfeedxlang`;

CREATE TABLE `<site>_page` (
  `name` varchar(20) NOT NULL default '',
  `need_login` enum('no','yes','with_right') NOT NULL default 'no',
  PRIMARY KEY  (`name`)
) TYPE=MyISAM;

INSERT INTO `<site>_page` SELECT * FROM `<template>_page`;

CREATE TABLE `<site>_pagexlang` (
  `page` varchar(20) NOT NULL default '',
  `lang` varchar(10) NOT NULL default '',
  `title` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `keywords` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`page`,`lang`)
) TYPE=MyISAM;

INSERT INTO `<site>_pagexlang` SELECT * FROM `<template>_pagexlang`;

CREATE TABLE `<site>_section` (
  `id` int(10) NOT NULL auto_increment,
  `pos` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;

INSERT INTO `<site>_section` SELECT * FROM `<template>_section`;

CREATE TABLE `<site>_sectionxlang` (
  `section` int(10) NOT NULL default '0',
  `lang` varchar(10) NOT NULL default '',
  `title` varchar(255) NOT NULL default '',
  `img` varchar(255) NOT NULL default '',
  `text` text NOT NULL,
  PRIMARY KEY  (`section`,`lang`)
) TYPE=MyISAM;

INSERT INTO `<site>_sectionxlang` SELECT * FROM `<template>_sectionxlang`;

CREATE TABLE `<site>_service` (
  `name` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`name`)
) TYPE=MyISAM;

CREATE TABLE `<site>_sitexlang` (
  `lang` varchar(10) NOT NULL default '',
  `head_title` varchar(255) NOT NULL default '',
  `head_img` varchar(255) NOT NULL default '',
  `head_text` text NOT NULL,
  `foot_title` varchar(255) NOT NULL default '',
  `foot_img` varchar(255) NOT NULL default '',
  `foot_text` text NOT NULL,
  PRIMARY KEY  (`lang`)
) TYPE=MyISAM;

INSERT INTO `<site>_sitexlang` SELECT * FROM `<template>_sitexlang`;

CREATE TABLE `<site>_user` (
  `user` varchar(20) NOT NULL default '',
  `pwd` varchar(20) NOT NULL default '',
  `email` varchar(255) NOT NULL default '',
  `firstname` varchar(255) NOT NULL default '',
  `lastname` varchar(255) NOT NULL default '',
  `nick` varchar(20) NOT NULL default '',
  `gender` char(1) NOT NULL default '',
  `address` varchar(255) NOT NULL default '',
  `place` varchar(255) NOT NULL default '',
  `zip` varchar(5) NOT NULL default '',
  `city` varchar(255) NOT NULL default '',
  `state_prov` varchar(255) NOT NULL default '',
  `country` varchar(255) NOT NULL default '',
  `birthday` date default NULL,
  `lang` varchar(10) NOT NULL default '',
  `rights` text NOT NULL,
  `confirm` varchar(40) NOT NULL default '',
  `status` enum('unconfirmed','active','disabled') NOT NULL default 'unconfirmed',
  `creation_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `pwd_expire_date` datetime NOT NULL default '0000-00-00 00:00:00',
  `last_login_date` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`user`)
) TYPE=MyISAM;

UPDATE `site` SET `type` = "demo", `creation_date` = NOW(), `expire_date` = "<expire>", pwd_expire_date = "<pwd_expire>" WHERE `name` = "<site>";