<?php
// +---------------------------------------------+
// |     Copyright  2008 - 2018 weenCompany      |
// |     http://www.weentech.com                 |
// |     This file may not be redistributed.     |
// +---------------------------------------------+

if(!defined('TABLE_PREFIX'))
  define('TABLE_PREFIX', "");

if(!defined('IN_WEENCOMPANY'))
  die("File not found!");


// ############################### MODULE DETAILS ##############################

$uniqueid       = 6;
$modulename     = '联系框';
$version        = '2.0';
$modulepath     = 'm6_contactform/contactform.php';
$settingspath   = 'm6_contactform/m6_settings.php';
$authorname     = 'weencompany';
$authorlink     = 1;
$modulesettings = '19';


// ############################### INSTALL MODULE ##############################

if($installtype == 'install')
{
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid,  '模块设置',          '收件箱',                                	'用户提交的联络信息以邮件的方式发送至:<br />\r\n多个邮箱地址可用英文逗号隔开.', 'text', '$email', 1) ");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "modulesettings VALUES (NULL, $uniqueid,  '模块设置', 		   '验证码', 						'用户提交联系信息时是否需要填写验证码?', 'yesno', '0', 2) ");

if($sitedefaultlang == 'en') //Insert English phrase.
{
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'full_name',                'Full Name:', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'your_email',               'Your Email:', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'subject',                  'Subject:', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'message',                  'Message:', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'send_message',             'Send Message', '', '', '', '', 0, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'reset',                    'Reset', '', '', '', '', 0, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'invalid_email',            'Invalid Email entered!', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'no_post_access',           'Sorry, your account does not have access to submit contact information!', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'email_sent',               'Thanks! Your email has been sent!', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'email_not_sent',           'A system error occured. Your message was not sent!', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'empty_fields',             'Error: One of the required field(s) is empty!', '', '', '', '', '1', '0', '0') ");

}
else  //Insert Chinese phrase.
{
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'full_name',                '您的姓名:', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'your_email',               'Email地址:', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'subject',                  '您的问题:', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'message',                  '详细内容:', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'send_message',             '提交发送', '', '', '', '', 0, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'reset',                    '重置', '', '', '', '', 0, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'invalid_email',            'Email地址无效!', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'no_post_access',           '对不起, 您所在的用户组无权提交联系信息!', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'email_sent',               '谢谢! 您的问题已发送邮件给管理员.', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'email_not_sent',           '系统错误! 邮件发送未完成.', '', '', '', '', 1, 0, 0)");
  $DB->query("INSERT INTO " . TABLE_PREFIX . "phrases VALUES (NULL, $uniqueid, 'empty_fields',             '错误: 联系内容不完整!', '', '', '', '', '1', '0', '0') ");

}

}


// ############################### UPGRADE MODULE ##############################

if($installtype == 'upgrade')
{
  if($currentversion == '2.0')
  {
    // example:
    // UpdateModuleVersion(6, 2.1);
    // $currentversion = 2.1;
  }
}


// ############################## UNINSTALL MODULE #############################

if($installtype == 'uninstall')
{
  // no tables to uninstall
}

?>