DROP TABLE #__article;

CREATE TABLE #__article (
article_id INTEGER AUTO_INCREMENT,
category_id VARCHAR(200) NOT NULL DEFAULT '',
user_id INT NOT NULL DEFAULT 0,
title VARCHAR(200) NOT NULL DEFAULT '',
createdat INT NOT NULL DEFAULT 0,
type VARCHAR(25) NOT NULL DEFAULT '0',
img VARCHAR(200) DEFAULT '',
upfile VARCHAR(200) DEFAULT '',
content LONGTEXT,
summary TEXT,
tags VARCHAR(255) DEFAULT '',
comefrom VARCHAR(100) DEFAULT '',
istop INT NOT NULL DEFAULT 0,
iscommend INT NOT NULL DEFAULT 0,
isremark INT NOT NULL DEFAULT 0,
isvisible INT NOT NULL DEFAULT 0,
browses INT NOT NULL DEFAULT 0,
renums INT NOT NULL DEFAULT 0,
grade VARCHAR(16) NOT NULL DEFAULT '0.00',
ip VARCHAR(100) DEFAULT '',
url VARCHAR(200) DEFAULT '',
target VARCHAR(20) DEFAULT '',
filename VARCHAR(255) DEFAULT '',
pointnum INT NOT NULL DEFAULT 0,
ishtml VARCHAR(255) NOT NULL DEFAULT '',
usergroup_id INT NOT NULL DEFAULT -1,
PRIMARY KEY (article_id) 
) tableset;

SELECT setval('#__article_article_id_seq',max(article_id)) from #__article;

DROP TABLE #__category;

CREATE TABLE #__category (
category_id INTEGER AUTO_INCREMENT,
title VARCHAR(50) NOT NULL DEFAULT '',
parentid INT NOT NULL DEFAULT 0,
path VARCHAR(255) DEFAULT '',
orderid INT NOT NULL DEFAULT 0,
depth INT NOT NULL DEFAULT 0,
childcount INT NOT NULL DEFAULT 0,
summary VARCHAR(255) DEFAULT '',
tags VARCHAR(200) DEFAULT '',
img VARCHAR(200) DEFAULT '',
isvisible INT NOT NULL DEFAULT 0,
type VARCHAR(25) DEFAULT '',
tpl VARCHAR(200) DEFAULT '',
indextpl VARCHAR(200) DEFAULT '',
subtpl VARCHAR(200) DEFAULT '',
url VARCHAR(200) DEFAULT '',
target VARCHAR(20) DEFAULT '',
filename VARCHAR(255) DEFAULT '',
listrule VARCHAR(200) DEFAULT '',
articlerule VARCHAR(200) DEFAULT '',
ishtml INT NOT NULL DEFAULT 0,
usergroup_id INT NOT NULL DEFAULT -1,
PRIMARY KEY (category_id) 
) tableset;

SELECT setval('#__category_category_id_seq',max(category_id)) from #__category;

DROP TABLE #__config;

CREATE TABLE #__config (
config_id INTEGER AUTO_INCREMENT,
value VARCHAR(255) DEFAULT '',
tag VARCHAR(255) DEFAULT '',
addedvalue TEXT,
isuse INT NOT NULL DEFAULT 0,
intro VARCHAR(255) DEFAULT '',
PRIMARY KEY (config_id) 
) tableset;

INSERT INTO #__config (config_id,value,tag,addedvalue,isuse,intro) 
VALUES (1,'','summary_product','<table class="producttable" width="200">
    <tbody>
        <tr>
            <td><strong>产品名称</strong>：</td>
        </tr>
        <tr>
            <td><strong>类型</strong>：</td>
        </tr>
        <tr>
            <td><strong>适用版本</strong>：</td>
        </tr>
        <tr>
            <td><strong>市场价格</strong>：</td>
        </tr>
        <tr>
            <td><strong>优惠价格</strong>：</td>
        </tr>
    </tbody>
</table>',1,'产品资料');

INSERT INTO #__config (config_id,value,tag,addedvalue,isuse,intro) 
VALUES (2,'','summary_down','<table class="downtable" width="200">
    <tbody>
        <tr>
            <td><strong>软件名称</strong>：</td>
        </tr>
        <tr>
            <td><strong>软件大小</strong>：</td>
        </tr>
        <tr>
            <td><strong>软件语言</strong>：</td>
        </tr>
        <tr>
            <td><strong>应用平台</strong>：</td>
        </tr>
        <tr>
            <td><strong>授权方式</strong>：</td>
        </tr>
    </tbody>
</table>',1,'下载文件详细信息');

INSERT INTO #__config (config_id,value,tag,addedvalue,isuse,intro) 
VALUES (3,'','summary_job','<table class="jobtable" width="400">
    <tbody>
        <tr>
            <td width="200"><strong>职位名称</strong>：</td>
            <td width="200"><strong>工作性质</strong>：</td>
        </tr>
        <tr>
            <td><strong>招聘人数</strong>：</td>
            <td><strong>工作经验</strong>：</td>
        </tr>
        <tr>
            <td><strong>工作地点</strong>：</td>
            <td><strong>年龄</strong>：</td>
        </tr>
        <tr>
            <td><strong>身高</strong>：</td>
            <td><strong>语言及水平要求</strong>：</td>
        </tr>
        <tr>
            <td><strong>学历</strong>：</td>
            <td><strong>待遇</strong>：</td>
        </tr>
        <tr>
            <td><strong>联系电话</strong>：</td>
            <td><strong>E-mail</strong>：</td>
        </tr>
    </tbody>
</table>',1,'招聘属性');

INSERT INTO #__config (config_id,value,tag,addedvalue,isuse,intro) 
VALUES (6,'1','guestbook','',1,'是否开启留言模块,1-开启,0-禁止');

INSERT INTO #__config (config_id,value,tag,addedvalue,isuse,intro) 
VALUES (7,'0','guestbook_group','',1,'允许用户组级别大于等于此值的用户留言,0表示允许匿名用户留言');

INSERT INTO #__config (config_id,value,tag,addedvalue,isuse,intro) 
VALUES (8,'1','user_reg','',1,'是否开启会员注册,1开启,0不开启');

INSERT INTO #__config (config_id,value,tag,addedvalue,isuse,intro) 
VALUES (9,'4','user_reg_group','',1,'新注册用户自动加入到哪个会员组(值为组编号)');

INSERT INTO #__config (config_id,value,tag,addedvalue,isuse,intro) 
VALUES (10,'','user_reg_license','&nbsp;欢迎您注册成为本站用户<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请仔细阅读下面的协议，只有接受协议才能继续进行注册。&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1．服务条款的确认和接纳<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　用户服务的所有权和运作权归本站拥有。本站所提供的服务将按照有关章程、服务条款和操作规则严格执行。用户通过注册程序点击&ldquo;我同意&rdquo;&nbsp;按钮，即表示用户与本站达成协议并接受所有的服务条款。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2．&nbsp;服务简介<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　本站通过国际互联网为用户提供新闻及文章浏览、图片浏览、软件下载、网上留言和BBS论坛等服务。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　用户必须：&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　1)购置设备，包括个人电脑一台、调制解调器一个及配备上网装置。&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　2)个人上网和支付与此服务有关的电话费用、网络费用。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　用户同意：&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　1)提供及时、详尽及准确的个人资料。&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　2)不断更新注册资料，符合及时、详尽、准确的要求。所有原始键入的资料将引用为注册资料。&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　3)用户同意遵守《中华人民共和国保守国家秘密法》、《中华人民共和国计算机信息系统安全保护条例》、《计算机软件保护条例》等有关计算机及互联网规定的法律和法规、实施办法。在任何情况下，本站合理地认为用户的行为可能违反上述法律、法规，本站可以在任何时候，不经事先通知终止向该用户提供服务。用户应了解国际互联网的无国界性，应特别注意遵守当地所有有关的法律和法规。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3．&nbsp;服务条款的修改<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　本站会不定时地修改服务条款，服务条款一旦发生变动，将会在相关页面上提示修改内容。如果您同意改动，则再一次点击&ldquo;我同意&rdquo;按钮。&nbsp;如果您不接受，则及时取消您的用户使用服务资格。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4．&nbsp;服务修订<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　本站保留随时修改或中断服务而不需知照用户的权利。本站行使修改或中断服务的权利，不需对用户或第三方负责。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5．&nbsp;用户隐私制度<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　尊重用户个人隐私是本站的&nbsp;基本政策。本站不会公开、编辑或透露用户的注册信息，除非有法律许可要求，或本站在诚信的基础上认为透露这些信息在以下三种情况是必要的：&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　1)遵守有关法律规定，遵从合法服务程序。&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　2)保持维护本站的商标所有权。&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　3)在紧急情况下竭力维护用户个人和社会大众的隐私安全。&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　4)符合其他相关的要求。&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6．用户的帐号，密码和安全性<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　一旦注册成功成为本站用户，您将得到一个密码和帐号。如果您不保管好自己的帐号和密码安全，将对因此产生的后果负全部责任。另外，每个用户都要对其帐户中的所有活动和事件负全责。您可随时根据指示改变您的密码，也可以结束旧的帐户重开一个新帐户。用户同意若发现任何非法使用用户帐号或安全漏洞的情况，立即通知本站。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7．&nbsp;免责条款<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　用户明确同意网站服务的使用由用户个人承担风险。&nbsp;　　&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　本站不作任何类型的担保，不担保服务一定能满足用户的要求，也不担保服务不会受中断，对服务的及时性，安全性，出错发生都不作担保。用户理解并接受：任何通过本站服务取得的信息资料的可靠性取决于用户自己，用户自己承担所有风险和责任。&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8．有限责任<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　本站对任何直接、间接、偶然、特殊及继起的损害不负责任。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9．&nbsp;不提供零售和商业性服务&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　用户使用网站服务的权利是个人的。用户只能是一个单独的个体而不能是一个公司或实体商业性组织。用户承诺不经本站同意，不能利用网站服务进行销售或其他商业用途。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10．用户责任&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　用户单独承担传输内容的责任。用户必须遵循：&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　1)从中国境内向外传输技术性资料时必须符合中国有关法规。&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　2)使用网站服务不作非法用途。&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　3)不干扰或混乱网络服务。&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　4)不在论坛BBS或留言簿发表任何与政治相关的信息。&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　5)遵守所有使用网站服务的网络协议、规定、程序和惯例。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　6)不得利用本站危害国家安全、泄露国家秘密，不得侵犯国家社会集体的和公民的合法权益。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　7)不得利用本站制作、复制和传播下列信息：&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　　1、煽动抗拒、破坏宪法和法律、行政法规实施的；<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　　2、煽动颠覆国家政权，推翻社会主义制度的；<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　　3、煽动分裂国家、破坏国家统一的；<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　　4、煽动民族仇恨、民族歧视，破坏民族团结的；<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　　5、捏造或者歪曲事实，散布谣言，扰乱社会秩序的；<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　　6、宣扬封建迷信、淫秽、色情、赌博、暴力、凶杀、恐怖、教唆犯罪的；<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　　7、公然侮辱他人或者捏造事实诽谤他人的，或者进行其他恶意攻击的；<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　　8、损害国家机关信誉的；<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　　9、其他违反宪法和法律行政法规的；<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　　10、进行商业广告行为的。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　用户不能传输任何教唆他人构成犯罪行为的资料；不能传输长国内不利条件和涉及国家安全的资料；不能传输任何不符合当地法规、国家法律和国际法&nbsp;律的资料。未经许可而非法进入其它电脑系统是禁止的。若用户的行为不符合以上的条款，本站将取消用户服务帐号。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;11．网站内容的所有权<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　本站定义的内容包括：文字、软件、声音、相片、录象、图表；在广告中全部内容；电子邮件的全部内容；本站为用户提供的商业信息。所有这些内容受版权、商标、标签和其它财产所有权法律的保护。所以，用户只能在本站和广告商授权下才能使用这些内容，而不能擅自复制、篡改这些内容、或创造与内容有关的派生产品。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;12．附加信息服务<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　用户在享用本站提供的免费服务的同时，同意接受本站提供的各类附加信息服务。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;13．解释权<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　　本注册协议的解释权归本站所有。如果其中有任何条款与国家的有关法律相抵触，则以国家法律的明文规定为准。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',1,'用户注册协议');

INSERT INTO #__config (config_id,value,tag,addedvalue,isuse,intro) 
VALUES (11,'163','counts','',1,'访问统计');

INSERT INTO #__config (config_id,value,tag,addedvalue,isuse,intro) 
VALUES (14,'1','mail_send','此项禁用后,所有mail_开头的标记均无效',1,'是否启用发送邮件的功能1启用,0禁用');

INSERT INTO #__config (config_id,value,tag,addedvalue,isuse,intro) 
VALUES (20,'重设您在miceCMS官方网站的密码','forgetpwd_mail_title','',1,'发送找回密码邮件的标题');

INSERT INTO #__config (config_id,value,tag,addedvalue,isuse,intro) 
VALUES (21,'','forgetpwd_mail_body','<P>亲爱的username：<BR><BR>您的密码重设要求已经得到验证。请点击以下链接输入您新的密码：<BR>(pleae click on the following link to reset your password:)<BR>setpwdlink<BR>如果您的email程序不支持链接点击，请将上面的地址拷贝至您的浏览器(例如IE)的地址栏进入miceCMS官方网站。<BR>感谢对miceCMS官方网站的支持，再次希望您在miceCMS官方网站的体验有益和愉快。<BR><BR>miceCMS官方网站 <A href="http://www.micecms.com/">http://www.miceCMS.com</A><BR>(这是一封自动产生的email，请勿回复。如果您未提出找回密码的申请，可忽略此邮件，它不影响您的登录和使用)</P>',1,'发送找回密码邮件的内容,username和setpwdlink是系统变量，请勿修改，其它文字可按您的需求更改');

INSERT INTO #__config (config_id,value,tag,addedvalue,isuse,intro) 
VALUES (23,'301','article_summary_len','',1,'文章摘要长度(单位:字符)');

SELECT setval('#__config_config_id_seq',max(config_id)) from #__config;

DROP TABLE #__file;

CREATE TABLE #__file (
file_id INTEGER AUTO_INCREMENT,
filecategory_id INT NOT NULL DEFAULT 0,
filename VARCHAR(255) DEFAULT '',
type VARCHAR(25) DEFAULT '',
title VARCHAR(255) DEFAULT '',
summary TEXT,
link VARCHAR(255) DEFAULT '',
createdat INT NOT NULL DEFAULT 0,
user_id INT NOT NULL DEFAULT 0,
PRIMARY KEY (file_id) 
) tableset;

SELECT setval('#__file_file_id_seq',max(file_id)) from #__file;

DROP TABLE #__filecategory;

CREATE TABLE #__filecategory (
filecategory_id INTEGER AUTO_INCREMENT,
title VARCHAR(50) NOT NULL DEFAULT '',
parentid INT NOT NULL DEFAULT 0,
path VARCHAR(255) DEFAULT '',
orderid INT NOT NULL DEFAULT 0,
depth INT NOT NULL DEFAULT 0,
childcount INT NOT NULL DEFAULT 0,
summary VARCHAR(255) DEFAULT '',
type VARCHAR(200) DEFAULT '',
PRIMARY KEY (filecategory_id) 
) tableset;

SELECT setval('#__filecategory_filecategory_id_seq',max(filecategory_id)) from #__filecategory;

DROP TABLE #__form;

CREATE TABLE #__form (
form_id INTEGER AUTO_INCREMENT,
name VARCHAR(100) DEFAULT '',
email VARCHAR(255) DEFAULT '',
title VARCHAR(255) DEFAULT '',
parentid INT NOT NULL DEFAULT 0,
user_id INT NOT NULL DEFAULT 0,
type VARCHAR(255) DEFAULT '',
createdat INT NOT NULL DEFAULT 0,
ip VARCHAR(100) DEFAULT '',
content TEXT,
isopen INT NOT NULL DEFAULT 0,
isview INT NOT NULL DEFAULT 0,
re TEXT,
PRIMARY KEY (form_id) 
) tableset;

SELECT setval('#__form_form_id_seq',max(form_id)) from #__form;

DROP TABLE #__link;

CREATE TABLE #__link (
link_id INTEGER AUTO_INCREMENT,
category_id VARCHAR(255) DEFAULT '',
user_id INT NOT NULL DEFAULT 0,
orderid INT NOT NULL DEFAULT 0,
title VARCHAR(255) DEFAULT '',
url VARCHAR(255) DEFAULT '',
logo VARCHAR(255) DEFAULT '',
summary VARCHAR(255) DEFAULT '',
PRIMARY KEY (link_id) 
) tableset;

SELECT setval('#__link_link_id_seq',max(link_id)) from #__link;

DROP TABLE #__menu;

CREATE TABLE #__menu (
menu_id INTEGER AUTO_INCREMENT,
title VARCHAR(50) NOT NULL DEFAULT '',
parentid INT NOT NULL DEFAULT 0,
path VARCHAR(255) DEFAULT '',
orderid INT NOT NULL DEFAULT 0,
depth INT NOT NULL DEFAULT 0,
childcount INT NOT NULL DEFAULT 0,
summary VARCHAR(255) DEFAULT '',
tags VARCHAR(200) DEFAULT '',
img VARCHAR(200) DEFAULT '',
isvisible INT NOT NULL DEFAULT 0,
url VARCHAR(200) DEFAULT '',
PRIMARY KEY (menu_id) 
) tableset;

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (1,'文档管理',0,',1,',1,1,5,'核心','','imgs/menu/icon003a11.gif',0,'');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (2,'附加模块',0,',2,',3,1,6,'模块','','imgs/menu/icon031a12.gif',0,'');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (3,'会员管理',0,',3,',5,1,3,'会员','','imgs/menu/icon021a12.gif',0,'');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (4,'系统设置',0,',4,',7,1,6,'系统','','imgs/menu/icon023a12.gif',0,'');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (5,'媒体库',0,',5,',9,1,3,'上传','','imgs/menu/icon029a33.gif',0,'');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (6,'生成HTML',0,',6,',11,1,6,'生成HTML','','imgs/menu/icon040a13.gif',0,'');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (7,'帮助',0,',7,',13,1,12,'帮助','','imgs/menu/icon018a1.gif',0,'');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (21,'文档管理',1,',1,21,',1,2,0,'','article','imgs/menu/icon003a1.gif',0,'admin.php/article/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (22,'文档类别',1,',1,22,',3,2,0,'','category','imgs/menu/icon003a11.gif',0,'admin.php/category/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (23,'订单列表',1,',1,23,',5,2,0,'视频管理<br />','product','imgs/menu/icon009a12.gif',0,'admin.php/product/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (24,'应聘信息',1,',1,24,',7,2,0,'产品管理<br />','job','imgs/menu/icon021a12.gif',0,'admin.php/job/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (25,'链接申请信息',1,',1,25,',9,2,0,'下载管理','linkinfo','imgs/menu/icon028a9.gif',0,'admin.php/linkinfo/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (26,'Flash图片',2,',2,26,',1,2,0,'Flash图片','flash','imgs/menu/icon030a12.gif',0,'admin.php/flash/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (27,'评论管理',2,',2,27,',3,2,0,'评论管理<br />','comment','imgs/menu/icon034a12.gif',0,'admin.php/comment/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (28,'留言管理',2,',2,28,',5,2,0,'留言管理<br />','form','imgs/menu/icon037a4.gif',0,'admin.php/form/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (29,'投票管理',2,',2,29,',7,2,0,'投票管理<br />','poll','imgs/menu/icon031a12.gif',0,'admin.php/poll/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (30,'链接分类',2,',2,30,',9,2,0,'链接分类<br />','linkcategory','imgs/menu/icon028a9.gif',0,'admin.php/linkcategory/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (31,'友情链接',2,',2,31,',11,2,0,'','link','imgs/menu/icon028a10.gif',0,'admin.php/link/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (32,'我的资料',3,',3,32,',1,2,0,'我的资料<br />','my','imgs/menu/icon021a1.gif',0,'admin.php/my/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (33,'会员组管理',3,',3,33,',3,2,0,'用户组管理','usergroup','imgs/menu/icon021a12.gif',0,'admin.php/usergroup/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (34,'会员管理',3,',3,34,',5,2,0,'会员管理','user','imgs/menu/icon025a14.gif',0,'admin.php/user/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (35,'系统基本设置',4,',4,35,',1,2,0,'系统基本设置','configbase','imgs/menu/icon023a14.gif',0,'admin.php/configbase/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (36,'系统参数设置',4,',4,36,',3,2,0,'','config','imgs/menu/icon023a12.gif',0,'admin.php/config/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (37,'菜单管理',4,',4,37,',5,2,0,'菜单管理<br />','menu','imgs/menu/icon042a11.gif',0,'admin.php/menu/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (38,'数据库管理',4,',4,38,',7,2,0,'数据库管理<br />','database','imgs/menu/icon005a12.gif',0,'admin.php/database/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (39,'插件管理',4,',4,39,',9,2,0,'插件管理','plugin','imgs/menu/icon024a12.gif',0,'admin.php/plugin/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (40,'清除网站缓存',4,',4,40,',11,2,0,'','clear','imgs/menu/icon023a13.gif',0,'admin.php/clear/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (41,'更新文档html',6,',6,41,',2,2,0,'','makehtml','imgs/menu/icon042a15.gif',0,'index.php/makehtml/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (42,'更新分类列表',6,',6,42,',3,2,0,'','makehtml','imgs/menu/icon042a15.gif',0,'index.php/makehtml/list');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (43,'更新分类封面',6,',6,43,',5,2,0,'','makehtml','imgs/menu/icon042a15.gif',0,'index.php/makehtml/channel');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (44,'更新网站地图',6,',6,44,',7,2,0,'','makehtml','imgs/menu/icon042a15.gif',0,'index.php/makehtml/map');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (45,'更新链接列表',6,',6,45,',9,2,0,'','makehtml','imgs/menu/icon042a15.gif',0,'index.php/makehtml/link');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (46,'更新主页html',6,',6,46,',6,2,0,'','makehtml','imgs/menu/icon040a13.gif',0,'index.php/makehtml/home');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (47,'图片库',5,',5,47,',1,2,0,'','mimages','imgs/menu/icon029a31.gif',0,'admin.php/mimages/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (48,'全局标签',7,',7,48,',1,2,0,'','templates','imgs/menu/icon018a1.gif',0,'admin.php/templates/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (49,'视频库',5,',5,49,',3,2,0,'','mvedio','imgs/menu/icon029a27.gif',0,'admin.php/mvedio/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (50,'附件库',5,',5,50,',5,2,0,'','mfile','imgs/menu/icon029a33.gif',0,'admin.php/mfile/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (51,'文件类别',5,',5,51,',7,2,0,'','filecategory','imgs/menu/icon029a12.gif',0,'admin.php/filecategory/index');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (52,'列表标签',7,',7,52,',3,2,0,'','templates','imgs/menu/icon018a1.gif',0,'admin.php/templates/list');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (53,'文档标签',7,',7,53,',5,2,0,'','templates','imgs/menu/icon018a1.gif',0,'admin.php/templates/article');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (54,'搜索标签',7,',7,54,',5,2,0,'','templates','imgs/menu/icon018a1.gif',0,'admin.php/templates/search');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (55,'评论标签',7,',7,55,',7,2,0,'','templates','imgs/menu/icon018a1.gif',0,'admin.php/templates/comment');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (56,'留言标签',7,',7,56,',9,2,0,'','templates','imgs/menu/icon018a1.gif',0,'admin.php/templates/guestbook');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (57,'投票标签',7,',7,57,',11,2,0,'','templates','imgs/menu/icon018a1.gif',0,'admin.php/templates/poll');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (58,'FLASH图片',7,',7,58,',13,2,0,'','templates','imgs/menu/icon018a1.gif',0,'admin.php/templates/flash');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (59,'友情链接',7,',7,59,',15,2,0,'','templates','imgs/menu/icon018a1.gif',0,'admin.php/templates/link');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (60,'会员信息',7,',7,60,',17,2,0,'','templates','imgs/menu/icon018a1.gif',0,'admin.php/templates/user');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (61,'媒体库标签',7,',7,61,',19,2,0,'','templates','imgs/menu/icon018a1.gif',0,'admin.php/templates/media');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (62,'模板说明',7,',7,62,',21,2,0,'','templates','imgs/menu/icon018a1.gif',0,'admin.php/templates/other');

INSERT INTO #__menu (menu_id,title,parentid,path,orderid,depth,childcount,summary,tags,img,isvisible,url) 
VALUES (63,'函数说明',7,',7,63,',22,2,0,'','templates','imgs/menu/icon018a1.gif',0,'admin.php/templates/micefun');

SELECT setval('#__menu_menu_id_seq',max(menu_id)) from #__menu;

DROP TABLE #__plugin;

CREATE TABLE #__plugin (
plugin_id INTEGER AUTO_INCREMENT,
hook VARCHAR(255) DEFAULT '',
name VARCHAR(255) DEFAULT '',
orderid INT NOT NULL DEFAULT 0,
isopen INT NOT NULL DEFAULT 0,
PRIMARY KEY (plugin_id) 
) tableset;

INSERT INTO #__plugin (plugin_id,hook,name,orderid,isopen) 
VALUES (1,'content','downimage',4,0);

INSERT INTO #__plugin (plugin_id,hook,name,orderid,isopen) 
VALUES (3,'editor','fckeditor',2,0);

INSERT INTO #__plugin (plugin_id,hook,name,orderid,isopen) 
VALUES (4,'editor','tinymce',4,0);

INSERT INTO #__plugin (plugin_id,hook,name,orderid,isopen) 
VALUES (5,'editor','ewebeditor',6,0);

INSERT INTO #__plugin (plugin_id,hook,name,orderid,isopen) 
VALUES (6,'mail','Mailfun',3,0);

INSERT INTO #__plugin (plugin_id,hook,name,orderid,isopen) 
VALUES (7,'mail','PHPMailer',1,1);

INSERT INTO #__plugin (plugin_id,hook,name,orderid,isopen) 
VALUES (8,'mail','Jmail',4,0);

INSERT INTO #__plugin (plugin_id,hook,name,orderid,isopen) 
VALUES (12,'editor','Kindeditor',1,1);

INSERT INTO #__plugin (plugin_id,hook,name,orderid,isopen) 
VALUES (14,'editor_fast','KindeditorFast',1,1);

INSERT INTO #__plugin (plugin_id,hook,name,orderid,isopen) 
VALUES (20,'editor2','Kindeditor2',1,1);

SELECT setval('#__plugin_plugin_id_seq',max(plugin_id)) from #__plugin;

DROP TABLE #__poll;

CREATE TABLE #__poll (
poll_id INTEGER AUTO_INCREMENT,
pollcategory_id INT NOT NULL DEFAULT 0,
title VARCHAR(255) DEFAULT '',
isdefault INT NOT NULL DEFAULT 0,
orderid INT NOT NULL DEFAULT 0,
num INT NOT NULL DEFAULT 0,
PRIMARY KEY (poll_id) 
) tableset;

SELECT setval('#__poll_poll_id_seq',max(poll_id)) from #__poll;

DROP TABLE #__pollcategory;

CREATE TABLE #__pollcategory (
pollcategory_id INTEGER AUTO_INCREMENT,
title VARCHAR(255) DEFAULT '',
content TEXT,
usergroup_id INT NOT NULL DEFAULT 0,
checks INT NOT NULL DEFAULT 1,
times INT NOT NULL DEFAULT 0,
startdate INT NOT NULL DEFAULT 0,
stopdate INT NOT NULL DEFAULT 0,
isvisible INT NOT NULL DEFAULT 0,
isopen INT NOT NULL DEFAULT 0,
user_id INT NOT NULL DEFAULT 0,
ip VARCHAR(100) DEFAULT '',
num INT NOT NULL DEFAULT 0,
pointnum INT NOT NULL DEFAULT 0,
PRIMARY KEY (pollcategory_id) 
) tableset;

SELECT setval('#__pollcategory_pollcategory_id_seq',max(pollcategory_id)) from #__pollcategory;

DROP TABLE #__usergroup;

CREATE TABLE #__usergroup (
usergroup_id INTEGER AUTO_INCREMENT,
name VARCHAR(255) NOT NULL DEFAULT '',
level INT NOT NULL DEFAULT 0,
menu TEXT,
module TEXT,
intro VARCHAR(255) DEFAULT '',
PRIMARY KEY (usergroup_id) 
) tableset;

INSERT INTO #__usergroup (usergroup_id,name,level,menu,module,intro) 
VALUES (1,'超级管理员',10,',1,21,22,23,24,25,2,26,27,28,29,30,31,3,32,33,34,4,35,36,37,38,39,40,5,47,49,50,51,6,41,42,43,46,44,45,7,48,52,53,54,55,56,57,58,59,60,61,62,63,',',article,category,product,job,linkinfo,flash,comment,form,poll,linkcategory,link,my,usergroup,user,configbase,config,menu,database,plugin,clear,mimages,mvedio,mfile,filecategory,makehtml,makehtml,makehtml,makehtml,makehtml,makehtml,templates,templates,templates,templates,templates,templates,templates,templates,templates,templates,templates,templates,templates,','超级管理员,具有最高权限');

INSERT INTO #__usergroup (usergroup_id,name,level,menu,module,intro) 
VALUES (2,'普通管理员',9,',1,21,22,23,24,25,2,26,27,28,29,30,31,3,32,35,39,40,5,47,49,50,51,6,41,42,43,46,44,45,7,48,52,53,54,55,56,57,58,59,60,61,62,63,',',article,category,product,job,linkinfo,flash,comment,form,poll,linkcategory,link,my,configbase,plugin,clear,mimages,mvedio,mfile,filecategory,makehtml,makehtml,makehtml,makehtml,makehtml,makehtml,templates,templates,templates,templates,templates,templates,templates,templates,templates,templates,templates,templates,templates,','普通管理员，可以添加修改删除文章');

INSERT INTO #__usergroup (usergroup_id,name,level,menu,module,intro) 
VALUES (4,'会员',1,',',',','');

SELECT setval('#__usergroup_usergroup_id_seq',max(usergroup_id)) from #__usergroup;

DROP TABLE #__user;

CREATE TABLE #__user (
user_id INTEGER AUTO_INCREMENT,
loginname VARCHAR(30) NOT NULL DEFAULT '',
salt VARCHAR(32) NOT NULL DEFAULT '',
password VARCHAR(40) NOT NULL DEFAULT '',
postnums INT NOT NULL DEFAULT 0,
realname VARCHAR(30) DEFAULT '',
explam TEXT,
url VARCHAR(200) DEFAULT '',
email VARCHAR(200) DEFAULT '',
regdate INT NOT NULL DEFAULT 0,
stopdate INT NOT NULL DEFAULT 0,
usergroup_id INT NOT NULL DEFAULT 0,
pointnum INT NOT NULL DEFAULT 0,
status INT NOT NULL DEFAULT 0,
nicename VARCHAR(30) DEFAULT '',
address VARCHAR(200) DEFAULT '',
headimg VARCHAR(200) DEFAULT '',
brothday VARCHAR(10) DEFAULT '',
sex INT NOT NULL DEFAULT 0,
im VARCHAR(200) DEFAULT '',
telno VARCHAR(100) DEFAULT '',
lastlogindate INT NOT NULL DEFAULT 0,
lastloginip VARCHAR(100) DEFAULT '',
forgetpwd VARCHAR(200) DEFAULT '',
memo TEXT,
PRIMARY KEY (user_id) 
) tableset;

SELECT setval('#__user_user_id_seq',max(user_id)) from #__user;