主题表
CREATE TABLE pre_forum_thread (
tid mediumint(8) unsigned NOT NULL auto_increment COMMENT '主题id',
fid mediumint(8) unsigned NOT NULL default '0' COMMENT '上级论坛',
posttableid smallint(6) unsigned NOT NULL default '0' COMMENT '帖子表ID',
typeid smallint(6) unsigned NOT NULL default '0' COMMENT '主题分类id',
sortid smallint(6) unsigned NOT NULL default '0' COMMENT '分类信息id',
readperm tinyint(3) unsigned NOT NULL default '0' COMMENT '阅读权限',
price smallint(6) NOT NULL default '0' COMMENT '价格',
author char(15) NOT NULL default '' COMMENT '会员名',
authorid mediumint(8) unsigned NOT NULL default '0' COMMENT '会员id',
`subject` char(80) NOT NULL default '' COMMENT '标题',
dateline int(10) unsigned NOT NULL default '0' COMMENT '发表时间',
lastpost int(10) unsigned NOT NULL default '0' COMMENT '最后发表',
lastposter char(15) NOT NULL default '' COMMENT '最后发表人id',
views int(10) unsigned NOT NULL default '0' COMMENT '浏览次数',
replies mediumint(8) unsigned NOT NULL default '0' COMMENT '回复次数',
displayorder tinyint(1) NOT NULL default '0' COMMENT '显示顺序',
highlight tinyint(1) NOT NULL default '0' COMMENT '是否高亮',
digest tinyint(1) NOT NULL default '0' COMMENT '是否精华',
rate tinyint(1) NOT NULL default '0' COMMENT '是否评分',
special tinyint(1) NOT NULL default '0' COMMENT '特殊主题',
attachment tinyint(1) NOT NULL default '0' COMMENT '附件,0无附件 1普通附件 2有图片附件',
moderated tinyint(1) NOT NULL default '0' COMMENT '是否被管理员改动',
closed mediumint(8) unsigned NOT NULL default '0' COMMENT '是否关闭',
stickreply tinyint(1) unsigned NOT NULL default '0' COMMENT '是否有回帖置顶',
recommends smallint(6) NOT NULL default '0' COMMENT '推荐指数',
recommend_add smallint(6) NOT NULL default '0' COMMENT '支持人数',
recommend_sub smallint(6) NOT NULL default '0' COMMENT '反对人数',
heats int(10) unsigned NOT NULL default '0' COMMENT '主题热度值',
status smallint (6) unsigned NOT NULL default '0' ,
isgroup tinyint(1) NOT NULL default '0' COMMENT '是否为群组帖子',
favtimes mediumint(8) NOT NULL default '0' COMMENT '主题收藏次数',
sharetimes mediumint(8) NOT NULL default '0' COMMENT '主题分享次数',
`stamp` tinyint(3) NOT NULL default '-1' COMMENT '主题图章',
`icon` tinyint(3) NOT NULL default '-1' COMMENT '主题图标',
pushedaid mediumint(8) NOT NULL default '0' COMMENT '被推送到的文章aid',
cover smallint(6) NOT NULL default '0' COMMENT '主题封面 负数:远程 正数:本地 0:无封面',
replycredit smallint(6) NOT NULL default '0' COMMENT '回帖奖励积分主题记录积分值',
PRIMARY KEY (tid),
KEY digest (digest),
KEY sortid (sortid),
KEY displayorder (fid,displayorder,lastpost),
KEY typeid (fid,typeid,displayorder,lastpost),
KEY recommends (recommends),
KEY heats (heats),
KEY authorid (authorid),
KEY isgroup (isgroup, lastpost),
KEY special (special)
) ENGINE=MyISAM COMMENT='主题表' ;
内容表
CREATE TABLE pre_forum_post (
pid int(10) unsigned NOT NULL auto_increment COMMENT '帖子id',
fid mediumint(8) unsigned NOT NULL default '0' COMMENT '论坛id',
tid mediumint(8) unsigned NOT NULL default '0' COMMENT '主题id',
`first` tinyint(1) NOT NULL default '0' COMMENT '是否是首贴',
author varchar(15) NOT NULL default '' COMMENT '作者姓名',
authorid mediumint(8) unsigned NOT NULL default '0' COMMENT '作者id',
`subject` varchar(80) NOT NULL default '' COMMENT '标题',
dateline int(10) unsigned NOT NULL default '0' COMMENT '发表时间',
message mediumtext NOT NULL COMMENT '消息',
useip varchar(15) NOT NULL default '' COMMENT '发帖者IP',
invisible tinyint(1) NOT NULL default '0' COMMENT '是否通过审核',
anonymous tinyint(1) NOT NULL default '0' COMMENT '是否匿名',
usesig tinyint(1) NOT NULL default '0' COMMENT '是否启用签名',
htmlon tinyint(1) NOT NULL default '0' COMMENT '是否允许HTML',
bbcodeoff tinyint(1) NOT NULL default '0' COMMENT '是否关闭BBCODE',
smileyoff tinyint(1) NOT NULL default '0' COMMENT '是否关闭表情',
parseurloff tinyint(1) NOT NULL default '0' COMMENT '是否允许粘贴URL',
attachment tinyint(1) NOT NULL default '0' COMMENT '附件',
rate smallint(6) NOT NULL default '0' COMMENT '评分分数',
ratetimes tinyint(3) unsigned NOT NULL default '0' COMMENT '评分次数',
`status` tinyint(1) NOT NULL default '0' COMMENT '帖子状态',
tags varchar(255) NOT NULL default '0' COMMENT '新增字段,用于存放tag',
`comment` tinyint(1) NOT NULL default '0' COMMENT '是否存在点评',
replycredit smallint(6) NOT NULL default '0' COMMENT '回帖获得积分记录',
PRIMARY KEY (pid),
KEY fid (fid),
KEY authorid (authorid),
KEY dateline (dateline),
KEY invisible (invisible),
KEY displayorder (tid,invisible,dateline),
KEY `first` (tid,`first`)
) ENGINE=MyISAM COMMENT='帖子表' ;