DROP TABLE IF EXISTS `pb_admingroups`;
CREATE TABLE `pb_admingroups` (
  `adminid` tinyint(3) unsigned NOT NULL default '0',
  `allowadmincp` tinyint(1) NOT NULL default '0',
  `alloweditatc` tinyint(1) NOT NULL default '0',
  `allowdelatc` tinyint(1) NOT NULL default '0',
  `allowlockatc` tinyint(1) NOT NULL default '0',
  `allowmoveatc` tinyint(1) NOT NULL default '0',
  `allowcopyatc` tinyint(1) NOT NULL default '0',
  `allowtopatc` tinyint(1) NOT NULL default '0',
  `allowcommend` tinyint(1) NOT NULL default '0',
  `allowshield` tinyint(1) NOT NULL default '0',
  `setsys` tinyint(1) NOT NULL default '0',
  `setcate` tinyint(1) NOT NULL default '0',
  `settag` tinyint(1) NOT NULL default '0',
  `setmember` tinyint(1) NOT NULL default '0',
  `setgroup` tinyint(1) NOT NULL default '0',
  `setcheck` tinyint(1) NOT NULL default '0',
  `setbatch` tinyint(1) NOT NULL default '0',
  `setplugins` tinyint(1) NOT NULL default '0',
  `settpl` tinyint(1) NOT NULL default '0',
  `setlink` tinyint(1) NOT NULL default '0',
  `setdb` tinyint(1) NOT NULL default '0',
  `settool` tinyint(1) NOT NULL default '0',
  `setlog` tinyint(1) NOT NULL default '0',
  `setspecial` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`adminid`)
) ENGINE=MyISAM;
INSERT INTO `pb_admingroups` (`adminid`, `allowadmincp`, `alloweditatc`, `allowdelatc`, `allowlockatc`, `allowmoveatc`, `allowcopyatc`, `allowtopatc`, `allowcommend`, `allowshield`, `setsys`, `setcate`, `settag`, `setmember`, `setgroup`, `setcheck`, `setbatch`, `setplugins`, `settpl`, `setlink`, `setdb`, `settool`, `setlog`, `setspecial`) VALUES (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
(2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
DROP TABLE IF EXISTS `pb_adminlogs`;
CREATE TABLE `pb_adminlogs` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `action` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `logdate` int(10) unsigned NOT NULL default '0',
  `logip` char(15) NOT NULL default '',
  `result` tinyint(1) NOT NULL default '1',
  `islog` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `uid` (`uid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_adminonlines`;
CREATE TABLE `pb_adminonlines` (
  `sid` char(32) NOT NULL,
  `loginfo` text NOT NULL,
  `logdate` int(10) unsigned NOT NULL default '0',
  `logip` char(15) NOT NULL default '',
  `lastactivity` int(10) unsigned NOT NULL default '0',
  UNIQUE KEY `sid` (`sid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_announcements`;
CREATE TABLE `pb_announcements` (
  `aid` smallint(6) unsigned NOT NULL auto_increment,
  `cid` smallint(6) unsigned NOT NULL default '0',
  `author` varchar(30) NOT NULL default '',
  `subject` varchar(255) NOT NULL default '',
  `url` varchar(255) NOT NULL default '',
  `content` mediumtext NOT NULL,
  `postdate` int(10) unsigned NOT NULL default '0',
  `enddate` int(10) unsigned NOT NULL default '0',
  `displayorder` tinyint(3) unsigned NOT NULL default '0',
  PRIMARY KEY  (`aid`),
  KEY `fid` (`cid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_applyinvite`;
CREATE TABLE `pb_applyinvite` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `username` varchar(30) NOT NULL default '',
  `applyreason` varchar(255) NOT NULL default '',
  `applynum` smallint(5) unsigned NOT NULL default '0',
  `applydate` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `uid` (`uid`),
  KEY `applydate` (`applydate`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_attachments`;
CREATE TABLE `pb_attachments` (
  `aid` mediumint(8) unsigned NOT NULL auto_increment,
  `cid` smallint(6) unsigned NOT NULL default '0',
  `tid` mediumint(8) unsigned NOT NULL default '0',
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `filename` varchar(100) NOT NULL default '',
  `filetype` varchar(50) NOT NULL default '',
  `filesize` int(10) unsigned NOT NULL default '0',
  `description` varchar(255) NOT NULL default '',
  `filepath` varchar(255) NOT NULL default '',
  `downloads` mediumint(8) unsigned NOT NULL default '0',
  `isimg` tinyint(1) unsigned NOT NULL default '0',
  `uploaddate` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`aid`),
  KEY `cid` (`cid`),
  KEY `tid` (`tid`),
  KEY `uid` (`uid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_categories`;
CREATE TABLE `pb_categories` (
  `cid` smallint(6) unsigned NOT NULL auto_increment,
  `cup` smallint(6) unsigned NOT NULL default '0',
  `icon` varchar(255) NOT NULL default '',
  `name` varchar(50) NOT NULL default '',
  `keywords` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `status` tinyint(1) unsigned NOT NULL default '0',
  `tnum` mediumint(8) unsigned NOT NULL default '0',
  `cnum` int(10) unsigned NOT NULL default '0',
  `displayorder` mediumint(8) unsigned NOT NULL default '0',
  PRIMARY KEY  (`cid`)
) ENGINE=MyISAM;
INSERT INTO `pb_categories` (`cid`, `cup`, `icon`, `name`, `keywords`, `description`, `status`, `tnum`, `cnum`, `displayorder`) VALUES (1, 0, '', '默认分类', '', 'PBDigg 是一个基于PHP + MYSQL的开源Dig社区系统，经过完善设计并适用于各种服务器环境的高效、全新、快速、优秀的网站解决方案。\r\nPBDigg 融合了社会性标签、主题评论、Rss订阅等多种WEB2.0元素。\r\nPBDigg 的宗旨是：快乐发掘，一起分享', 1, 0, 0, 1);
DROP TABLE IF EXISTS `pb_cdata`;
CREATE TABLE `pb_cdata` (
  `cdid` mediumint(8) unsigned NOT NULL auto_increment,
  `cid` smallint(6) unsigned NOT NULL default '0',
  `tid` mediumint(8) unsigned NOT NULL default '0',
  `rid` int(10) unsigned NOT NULL default '0',
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `type` enum('digg','bury') NOT NULL default 'digg',
  PRIMARY KEY  (`cdid`),
  KEY `tid` (`tid`),
  KEY `rid` (`rid`),
  KEY `uid` (`uid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_comments`;
CREATE TABLE `pb_comments` (
  `rid` int(10) unsigned NOT NULL auto_increment,
  `cid` smallint(6) unsigned NOT NULL default '0',
  `tid` mediumint(8) unsigned NOT NULL default '0',
  `author` varchar(30) NOT NULL default '',
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `content` mediumtext NOT NULL,
  `ifcheck` tinyint(1) NOT NULL default '0',
  `postdate` int(10) unsigned NOT NULL default '0',
  `postip` char(15) NOT NULL default '',
  `digg` int(10) unsigned NOT NULL default '0',
  `diggdate` int(10) unsigned NOT NULL default '0',
  `bury` int(10) unsigned NOT NULL default '0',
  `burydate` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`rid`),
  KEY `postdate` (`postdate`,`digg`),
  KEY `tid` (`tid`,`postdate`),
  KEY `cid` (`cid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_commonlogs`;
CREATE TABLE `pb_commonlogs` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `action` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `logdate` int(10) unsigned NOT NULL default '0',
  `logip` char(15) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `uid` (`uid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_configs`;
CREATE TABLE `pb_configs` (
  `title` varchar(20) NOT NULL default '',
  `text` text NOT NULL,
  PRIMARY KEY  (`title`)
) ENGINE=MyISAM;
INSERT INTO `pb_configs` (`title`, `text`) VALUES ('pb_sitename', 'PBDigg'),
('pb_siteurl', ''),
('pb_adminmail', 'pbdigg@163.com'),
('pb_ifopen', '1'),
('pb_whyclosed', ''),
('pb_gzip', '1'),
('pb_style', 'pbdigg'),
('pb_timezone', '8'),
('pb_timeformat', '1'),
('pb_avatupload', '1'),
('pb_avatsize', '102400'),
('pb_avathight', '100'),
('pb_avatwidth', '100'),
('pb_tcheck', '0'),
('pb_refreshtime', '0'),
('pb_maxresult', '500'),
('pb_exectime', '1'),
('pb_customcredit', '积分'),
('pb_ckpath', '/'),
('pb_ckdomain', ''),
('pb_dateformat', 'Y-m-d'),
('pb_maxsearchctrl', '0'),
('pb_reposttime', '3'),
('pb_aperpage', '10'),
('pb_cperpage', '10'),
('pb_showsign', '1'),
('pb_attoutlink', '1'),
('pb_uploadtopicimg', '1'),
('pb_commentlen', '3	50000'),
('pb_contentlen', '3	50000'),
('pb_titlelen', '3	100'),
('pb_allowupload', '1'),
('pb_attachdir', '0'),
('pb_uploadmaxsize', '204800'),
('pb_attachnum', '5'),
('pb_uploadfiletype', 'jpg,gif,zip,rar'),
('pb_creditdb', '2	1	2	1	2	1	2	1'),
('pb_gdcheck', 'a:5:{s:3:"reg";s:1:"0";s:5:"login";s:1:"0";s:4:"post";s:1:"0";s:7:"comment";s:1:"0";s:5:"admin";s:1:"0";}'),
('pb_ipallow', 's:0:"";'),
('pb_ipdeny', 's:0:"";'),
('pb_adminipallow', 's:0:"";'),
('reg_status', '1'),
('reg_closereason', '本站暂停注册！'),
('reg_agreement', '<p>　　第 一 条 本站所刊载的所有资料及图表仅供参考使用。用户明确同意其使用本站网络服务所存在的风险将完全由其自己承担；因其使用本站网络服务而产生的一切后果也由其自己承担，本站对用户不承担任何责任。。</p>\r\n\r\n<p>　　第 二 条 本站的用户在参加网站举办的各种活动时，我们将在您的同意及确认下，通过注册表格等形式要求您提供一些个人资料，如：您的姓名、性别、年龄、出生日期、身份证号、家庭住址、教育程度、公司情况、所属行业等。请您绝对放心，我们在未经您同意的情况下，绝对不会将您的任何资料以任何方式泄露给任何第三方。</p>\r\n \r\n<p>　　第 三 条 当政府司法机关依照法定程序要求本站披露个人资料时，我们将根据执法单位之要求或为公共安全之目的提供个人资料。在此情况下之任何披露，本站均得免责。</p>\r\n \r\n<p>　　第 四 条 由于用户将个人密码告知他人或与他人共享注册帐户，由此导致的任何个人资料泄露，本站不负任何责任。</p>\r\n \r\n<p>　　第 五 条 任何由于黑客攻击、计算机病毒侵入或发作、因政府管制而造成的暂时性关闭等影响网络正常经营的不可抗力而造成的个人资料泄露、丢失、被盗用或被窜改等，本站均得免责。</p>\r\n \r\n<p>　　第 六 条 由于与本站链接的其它网站所造成之个人资料泄露及由此而导致的任何法律争议和后果，本站均得免责。</p>\r\n \r\n<p>　　第 七 条 本站如因系统维护或升级而需暂停服务时，将事先公告。若因线路及非本公司控制范围外的硬件故障或其它不可抗力而导致暂停服务，于暂停服务期间造成的一切不便与损失，本站不负任何责任。</p>\r\n \r\n<p>　　第 八 条 本站使用者因为违反本声明的规定而触犯中华人民共和国法律的，一切后果自己负责，本站不承担任何责任。</p>\r\n \r\n<p>　　第 九 条 凡以任何方式登陆本站或直接、间接使用本站资料者，视为自愿接受本站声明的约束。</p>\r\n \r\n<p>　　第 十 条 本声明未涉及的问题参见国家有关法律法规，当本声明与国家法律法规冲突时，以国家法律法规为准。</p>\r\n \r\n<p>　　第十一条 本站不担保网络服务一定能满足用户的要求，也不担保网络服务不会中断，对网络服务的及时性、安全性、准确性也都不作担保。</p>\r\n\r\n<p>　　第十二条 本站不保证为向用户提供便利而设置的外部链接的准确性和完整性，同时，对于该等外部链接指向的不由本站实际控制的任何网页上的内容，本站不承担任何责任。</p>\r\n\r\n<p>　　第十三条 对于因不可抗力或本站不能控制的原因造成的网络服务中断或其它缺陷，本站网不承担任何责任，但将尽力减少因此而给用户造成的损失和影响。</p>\r\n\r\n<p>　　第十四条 本站所发的转让、合作、加工、组装等广告，仅是项目信息介绍，不能作为接产和签定合同的依据，接产客户要实地考察，签订公证合同；对于用户由于看到此类信息，付诸相应反映而造成损失或其它后果的，本站不承担任何责任</p>\r\n\r\n<p>　　第十五条 本站之声明以及其修改权、更新权及最终解释权均属本站网所有。</p>'),
('reg_allowsameip', '0'),
('reg_bannames', '版主,管理员,斑竹,admin,administrator'),
('reg_minname', '3'),
('reg_maxname', '15'),
('reg_credit', '1'),
('pb_rewriteext', '0'),
('pb_seotitle', 'PBDigg'),
('pb_seokeywords', 'PBDigg，digg程序，php digg程序'),
('pb_seodescription', 'PBDigg 是基于PHP + MYSQL的开源Digg社区资讯系统，经过完善设计并适用于各种服务器环境，如：UNIX、LINUX、WINDOWS等，是一个高效、全新、快速、优秀的网站解决方案。PBDigg集DIGG民主投票、网站内容发掘、社会性标签tag归类、主题评论、RSS订阅等多种WEB2.0元素于一体。Digg的宗旨是：发掘、推荐、分享、交流。'),
('pb_seomore', ''),
('pb_msg', '10'),
('pb_fav', '10'),
('pb_indextitle', '50'),
('pb_indexcontent', '300'),
('pb_anonnews', '1'),
('pb_banwords', ''),
('pb_loadavg', '0'),
('pb_icp', '<a href="http://www.miibeian.gov.cn" target="_blank"></a>'),
('pb_statistic', ''),
('pb_lang', 'zh-cn'),
('pb_rewrite', '0'),
('pb_getpw', '1'),
('pb_online', '60'),
('pb_torder', 'diggdate'),
('pb_dformat', '0'),
('pb_titlelink', '0'),
('pb_titleubb', ''),
('pb_topicimgsize', '120	160'),
('pb_mautoplay', '1'),
('pb_tftopicimg', '1'),
('pb_tubbtype', 'b	i	u	font	color	size	quote	code	url	img	email	flash	media'),
('pb_urlsaveimg', '1'),
('pb_thumbsize', '240	180'),
('pb_fautoplay', '1'),
('pb_mplayersize', '500	500'),
('pb_signubbtype', 'b	color	size'),
('pb_tperpage', '100'),
('pb_allowthumb', '1'),
('pb_previewsize', '0	600'),
('pb_watertype', '2'),
('pb_watertext', 'www.pbdigg.net'),
('pb_waterfont', 'cour.ttf'),
('pb_waterfontsize', '20'),
('pb_waterfontcolor', '#ff0000'),
('pb_waterimg', 'mark.png'),
('pb_watertransition', '85'),
('pb_waterquality', '75'),
('pb_waterminsize', '300	300'),
('pb_waterposition', '8'),
('pb_sitehash', '0zCL0MGnUQ'),
('pb_adminsafecode', '0'),
('pb_selfavat', '1'),
('reg_invite', '0'),
('reg_emailactive', '0'),
('reg_sendemail', '0'),
('reg_emailcontent', '您好{!--username--}：\r\n\r\n欢迎加入{!--sitename--}网!\r\n\r\n您的个人登录信息：\r\n\r\n用户名：{!--username--}\r\n密码：{!--password--}\r\n\r\n为确保安全，请不要泄露上述信息。\r\n\r\n\r\n(这是一封自动产生的email，请勿回复。)\r\n                                                                  \r\n------------------------------------------------------------------'),
('pb_mailtype', '0'),
('pb_smtphost', ''),
('pb_smtpauth', '0'),
('pb_smtpuser', ''),
('pb_smtppw', ''),
('pb_smtpport', '25'),
('pb_jstransfer', '0'),
('pb_jstime', '3600'),
('pb_jsurl', ''),
('pb_trantags', '10'),
('pb_tranarticle', '10'),
('pb_trancomment', '10'),
('pb_tranpic', '10'),
('pb_tranmember', '10'),
('pb_trancontribute', '10'),
('pb_ifbury', '1'),
('pb_ifdigg', '1'),
('pb_ifpost', '1'),
('pb_ifcomment', '1'),
('pb_cachetime', '900'),
('pb_cubbtype', 'b	i	u	font	color	size	quote'),
('pb_opentran', '1	1	1	1'),
('pb_tday', '7776000'),
('pb_editor', '2'),
('pb_banlinks', ''),
('pb_visitcache', '1'),
('pb_ucenable', '0'),
('pb_tagcolor', '1');
DROP TABLE IF EXISTS `pb_friends`;
CREATE TABLE `pb_friends` (
  `fid` int(10) unsigned NOT NULL auto_increment,
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `fuid` mediumint(8) unsigned NOT NULL default '0',
  `ifconfirm` tinyint(1) unsigned NOT NULL default '0',
  `createdate` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`fid`),
  KEY `uid` (`uid`),
  KEY `fuid` (`fuid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_fsession`;
CREATE TABLE `pb_fsession` (
  `fsid` char(32) NOT NULL,
  `attachment` text NOT NULL,
  `cid` smallint(5) unsigned NOT NULL default '0',
  `source` varchar(255) NOT NULL default '',
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `ip` char(15) NOT NULL default '',
  `exptime` int(10) unsigned NOT NULL default '0',
  UNIQUE KEY `sid` (`fsid`,`uid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_guestmsg`;
CREATE TABLE `pb_guestmsg` (
  `gmid` int(10) unsigned NOT NULL auto_increment,
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `authorid` mediumint(8) unsigned NOT NULL default '0',
  `author` varchar(30) NOT NULL default '',
  `content` text NOT NULL,
  `ifcheck` tinyint(1) unsigned NOT NULL default '0',
  `postdate` int(10) unsigned NOT NULL default '0',
  `postip` char(15) NOT NULL default '',
  PRIMARY KEY  (`gmid`),
  KEY `uid` (`uid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_invitecode`;
CREATE TABLE `pb_invitecode` (
  `id` mediumint(8) NOT NULL auto_increment,
  `uid` mediumint(8) NOT NULL default '0',
  `invitecode` char(18) NOT NULL default '',
  `createtime` int(10) NOT NULL default '0',
  `endtime` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `uid` (`uid`),
  KEY `endtime` (`endtime`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_links`;
CREATE TABLE `pb_links` (
  `lid` smallint(6) NOT NULL auto_increment,
  `displayorder` tinyint(3) unsigned NOT NULL default '0',
  `ifshow` tinyint(1) unsigned NOT NULL default '1',
  `sitename` varchar(255) NOT NULL default '',
  `siteurl` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `logo` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`lid`)
) ENGINE=MyISAM;
INSERT INTO `pb_links` (`lid`, `displayorder`, `ifshow`, `sitename`, `siteurl`, `description`, `logo`) VALUES (1, 0, 1, 'PBDigg', 'http://www.pbdigg.net/', 'PBDigg System', '');
DROP TABLE IF EXISTS `pb_memberdata`;
CREATE TABLE `pb_memberdata` (
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `realgroup` tinyint(3) unsigned NOT NULL default '7',
  `postnum` int(10) unsigned NOT NULL default '0',
  `commentnum` int(10) unsigned NOT NULL default '0',
  `tdigg` text NOT NULL,
  `cdigg` text NOT NULL,
  `diggnum` int(10) unsigned NOT NULL default '0',
  `tbury` text NOT NULL,
  `cbury` text NOT NULL,
  `burynum` int(10) unsigned NOT NULL default '0',
  `currency` int(10) NOT NULL default '0',
  `lastip` char(15) NOT NULL default '',
  `currentip` char(15) NOT NULL default '',
  `lastvisit` int(10) unsigned NOT NULL default '0',
  `lastpost` int(10) unsigned NOT NULL default '0',
  `lastcomment` int(10) unsigned NOT NULL default '0',
  `uploadnum` smallint(6) unsigned NOT NULL default '0',
  `newmsg` tinyint(3) unsigned NOT NULL default '0',
  `friendnum` smallint(6) unsigned NOT NULL default '0',
  `visitcount` int(10) unsigned NOT NULL default '0',
  `ucuid` mediumint(8) unsigned NOT NULL default '0',
  UNIQUE KEY `uid` (`uid`),
  KEY `ucuid` (`ucuid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_memberexp`;
CREATE TABLE `pb_memberexp` (
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `qq` char(12) NOT NULL default '',
  `msn` varchar(255) NOT NULL default '',
  `site` varchar(255) NOT NULL default '',
  `location` varchar(30) NOT NULL default '',
  `birthday` date NOT NULL default '0000-00-00',
  `signature` mediumtext NOT NULL,
  `showsign` tinyint(1) unsigned NOT NULL default '0',
  `avatar` varchar(255) NOT NULL default '',
  `gender` tinyint(1) unsigned NOT NULL default '1',
  `ctsig` tinyint(1) unsigned NOT NULL default '1',
  UNIQUE KEY `uid` (`uid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_members`;
CREATE TABLE `pb_members` (
  `uid` mediumint(8) unsigned NOT NULL auto_increment,
  `username` varchar(20) NOT NULL default '',
  `password` char(32) NOT NULL default '',
  `email` varchar(100) NOT NULL default '',
  `adminid` tinyint(3) NOT NULL default '0',
  `groupid` tinyint(3) NOT NULL default '0',
  `publicemail` tinyint(1) NOT NULL default '0',
  `regip` char(15) NOT NULL default '',
  `regdate` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`uid`),
  UNIQUE KEY `username` (`username`),
  KEY `email` (`email`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_message`;
CREATE TABLE `pb_message` (
  `mid` int(10) unsigned NOT NULL auto_increment,
  `fuid` mediumint(8) unsigned NOT NULL default '0',
  `tuid` mediumint(8) unsigned NOT NULL default '0',
  `title` varchar(255) NOT NULL default '',
  `type` enum('r','s') NOT NULL default 'r',
  `content` mediumtext NOT NULL,
  `postdate` int(10) unsigned NOT NULL default '0',
  `ifread` tinyint(1) unsigned NOT NULL default '0',
  `ifsys` tinyint(1) unsigned NOT NULL default '0',
  PRIMARY KEY  (`mid`),
  KEY `fuid` (`fuid`),
  KEY `tuid` (`tuid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_onlines`;
CREATE TABLE `pb_onlines` (
  `sid` char(8) NOT NULL default '',
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `username` varchar(30) NOT NULL default '',
  `groupid` tinyint(3) unsigned NOT NULL default '0',
  `cid` smallint(6) unsigned NOT NULL default '0',
  `tid` mediumint(8) unsigned NOT NULL default '0',
  `gid` mediumint(8) unsigned NOT NULL default '0',
  `customerip` char(15) NOT NULL default '',
  `lastactivity` int(10) NOT NULL default '0',
  UNIQUE KEY `sid` (`sid`,`uid`)
) ENGINE=HEAP;
DROP TABLE IF EXISTS `pb_plugins`;
CREATE TABLE `pb_plugins` (
  `pid` smallint(6) unsigned NOT NULL auto_increment,
  `status` tinyint(1) unsigned NOT NULL default '1',
  `pname` varchar(30) NOT NULL default '',
  `pmark` varchar(30) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `dbtables` varchar(255) NOT NULL default '',
  `foreground` tinyint(1) unsigned NOT NULL default '0',
  `copyright` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`pid`)
) ENGINE=MyISAM;
INSERT INTO `pb_plugins` (`pid`, `status`, `pname`, `pmark`, `description`, `dbtables`, `foreground`, `copyright`) VALUES (1, 1, 'PB网站地图生成器', 'pbmap', 'PB网站地图生成器可以根据Sitemap 协议生成站点Sitemap。使您的网站更便于搜索引擎抓取。', '', 0, 'PBDIGG.COM');
DROP TABLE IF EXISTS `pb_scaches`;
CREATE TABLE `pb_scaches` (
  `searchid` mediumint(8) unsigned NOT NULL auto_increment,
  `keywords` varchar(255) NOT NULL default '',
  `khash` varchar(32) NOT NULL default '',
  `tnum` mediumint(8) unsigned NOT NULL default '0',
  `tids` text NOT NULL,
  `searchip` char(15) NOT NULL default '',
  `searchtime` int(10) unsigned NOT NULL default '0',
  `exptime` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`searchid`),
  KEY `exptime` (`exptime`),
  KEY `khash` (`khash`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_sitestat`;
CREATE TABLE `pb_sitestat` (
  `id` tinyint(3) unsigned NOT NULL auto_increment,
  `newmember` varchar(20) NOT NULL default '',
  `membernum` mediumint(8) unsigned NOT NULL default '0',
  `catenum` int(10) unsigned NOT NULL default '0',
  `artnum` int(10) unsigned NOT NULL default '0',
  `comnum` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;
INSERT INTO `pb_sitestat` (`id`, `newmember`, `membernum`, `catenum`, `artnum`, `comnum`) VALUES (1, '', 1, 1, 0, 0);
DROP TABLE IF EXISTS `pb_special`;
CREATE TABLE `pb_special` (
  `sid` smallint(5) unsigned NOT NULL auto_increment,
  `sname` varchar(30) NOT NULL default '',
  `skeywords` varchar(255) NOT NULL default '',
  `sdesc` text NOT NULL,
  `slogo` varchar(255) NOT NULL default '',
  `stpl` varchar(30) NOT NULL default '',
  `createdate` int(10) unsigned NOT NULL default '0',
  `ifopen` tinyint(1) unsigned NOT NULL default '1',
  PRIMARY KEY  (`sid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_splink`;
CREATE TABLE `pb_splink` (
  `spid` int(10) unsigned NOT NULL auto_increment,
  `sid` smallint(5) unsigned NOT NULL default '0',
  `tid` mediumint(8) unsigned NOT NULL default '0',
  PRIMARY KEY  (`spid`),
  KEY `sid` (`sid`),
  KEY `tid` (`tid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_tagcache`;
CREATE TABLE `pb_tagcache` (
  `tcacheid` int(10) unsigned NOT NULL auto_increment,
  `tagid` smallint(6) unsigned NOT NULL default '0',
  `tid` mediumint(8) unsigned NOT NULL default '0',
  PRIMARY KEY  (`tcacheid`),
  KEY `tagid` (`tagid`),
  KEY `tid` (`tid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_tags`;
CREATE TABLE `pb_tags` (
  `tagid` smallint(6) unsigned NOT NULL auto_increment,
  `tagname` varchar(30) NOT NULL default '',
  `usenum` mediumint(8) unsigned NOT NULL default '0',
  `ifopen` tinyint(1) unsigned NOT NULL default '1',
  `ifsys` tinyint(1) unsigned NOT NULL default '0',
  PRIMARY KEY  (`tagid`),
  KEY `tagname` (`tagname`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_tdata`;
CREATE TABLE `pb_tdata` (
  `tdid` mediumint(8) unsigned NOT NULL auto_increment,
  `cid` smallint(6) unsigned NOT NULL default '0',
  `tid` mediumint(8) unsigned NOT NULL default '0',
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `type` enum('digg','bury','collection') NOT NULL default 'digg',
  PRIMARY KEY  (`tdid`),
  KEY `uid` (`uid`),
  KEY `tid` (`tid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_templates`;
CREATE TABLE `pb_templates` (
  `tplid` smallint(6) unsigned NOT NULL auto_increment,
  `tplname` varchar(255) NOT NULL default '',
  `tplmark` varchar(30) NOT NULL default '',
  `trancid` varchar(255) NOT NULL default '',
  `trannum` mediumint(8) unsigned NOT NULL default '0',
  `tranattribute` varchar(255) NOT NULL default '',
  `cotentlimit` smallint(6) unsigned NOT NULL default '0',
  `titlelimit` tinyint(3) unsigned NOT NULL default '0',
  `iftopicimg` tinyint(1) unsigned NOT NULL default '0',
  `ifcommend` tinyint(1) unsigned NOT NULL default '0',
  `ifcommendpic` tinyint(1) unsigned NOT NULL default '0',
  `timelimit` int(10) unsigned NOT NULL default '0',
  `timeformat` varchar(255) NOT NULL default '',
  `trantype` enum('t','c','m') NOT NULL default 't',
  `displayorder` tinyint(1) unsigned NOT NULL default '1',
  `ifself` tinyint(1) unsigned NOT NULL default '0',
  `tplcontent` text NOT NULL,
  PRIMARY KEY  (`tplid`)
) ENGINE=MyISAM;
INSERT INTO `pb_templates` (`tplid`, `tplname`, `tplmark`, `trancid`, `trannum`, `tranattribute`, `cotentlimit`, `titlelimit`, `iftopicimg`, `ifcommend`, `ifcommendpic`, `timelimit`, `timeformat`, `trantype`, `displayorder`, `ifself`, `tplcontent`) VALUES (1, '首页_活跃会员', 'tpl_680b7a23', '', 12, 'contribute', 0, 0, 0, 0, 0, 0, 'Y-m-d H:i:s', 'm', 1, 0, '<li><a href="{!--uurl--} " target="_blank"><img alt="{!--username--}" src="{!--avatar--}" /><br />{!--username--}</a></li>'),
(2, '全局_最新文章', 'tpl_f63d001d', '', 10, 'postdate', 0, 0, 0, 0, 0, 0, 'Y-m-d H:i:s', 't', 1, 0, '<li><a href="{!--turl--}" target="_blank" title="{!--altsubject--}">{!--subject--}</a></li>'),
(3, '全局_最新评论', 'tpl_6708bb12', '', 10, 'postdate', 100, 50, 0, 0, 0, 0, 'Y-m-d H:i:s', 'c', 1, 0, '<div class="com_box"><div class="com_box_z"><a href="{!--uurl--}" title="{!--author--}" target="_blank"><img src="{!--avatar--}" class="middle_user_avatar" /></a></div><div class="com_box_y"><h3><a href="{!--uurl--}" title="{!--author--}" target="_blank" class="b">{!--author--}</a> 评论 <a href="{!--turl--}">{!--subject--}</a></h3><span>{!--summary--}</span><em><a href="{!--turl--}">全文...</a></em></div></div>'),
(4, '全局_1周点击排行', 'tpl_80cc8536', '', 10, 'views', 0, 0, 0, 0, 0, 604800, 'Y-m-d H:i:s', 't', 1, 0, '<li><a href="{!--turl--}" target="_blank" title="{!--altsubject--}">{!--subject--}</a>({!--views--})</li>'),
(5, '首页图文', 'tpl_fe8f01a6', '', 8, 'digg', 0, 100, 1, 0, 0, 0, 'Y-m-d H:i:s', 't', 1, 0, '<li><div class="pink_img"><a href="{!--turl--}" title="{!--altsubject--}"><img src="{!--topicimg--}" alt="{!--altsubject--}"  border="0"/></a></div><div class="pink_img_title"><a href="{!--turl--}" title="{!--altsubject--}">{!--subject--}</a></div></li>'),
(6, '首页推荐', 'tpl_daf657bf', '', 5, 'digg', 0, 50, 0, 1, 0, 0, 'Y-m-d H:i:s', 't', 1, 0, '<li>[推荐]<a href="{!--turl--}" target="_blank">{!--subject--}</a></li>');
DROP TABLE IF EXISTS `pb_threads`;
CREATE TABLE `pb_threads` (
  `tid` mediumint(8) unsigned NOT NULL auto_increment,
  `cid` smallint(6) unsigned NOT NULL default '0',
  `author` varchar(30) NOT NULL default '',
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `subject` varchar(100) NOT NULL default '',
  `content` mediumtext NOT NULL,
  `contentlink` varchar(255) NOT NULL default '',
  `linkhost` varchar(255) NOT NULL default '',
  `topicimg` varchar(255) NOT NULL default '',
  `ifcheck` tinyint(1) unsigned NOT NULL default '0',
  `topped` tinyint(1) unsigned NOT NULL default '0',
  `postdate` int(10) unsigned NOT NULL default '0',
  `postip` char(15) NOT NULL default '',
  `digg` int(10) unsigned NOT NULL default '0',
  `diggdate` int(10) unsigned NOT NULL default '0',
  `bury` int(10) unsigned NOT NULL default '0',
  `burydate` int(10) unsigned NOT NULL default '0',
  `views` int(10) unsigned NOT NULL default '0',
  `comments` int(10) unsigned NOT NULL default '0',
  `commentdate` int(10) unsigned NOT NULL default '0',
  `keywords` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`tid`),
  KEY `uid` (`uid`),
  KEY `digg` (`digg`),
  KEY `diggdate` (`diggdate`,`ifcheck`,`postdate`),
  KEY `cid` (`cid`,`diggdate`,`ifcheck`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_tinfo`;
CREATE TABLE `pb_tinfo` (
  `tid` mediumint(8) unsigned NOT NULL,
  `skeywords` varchar(255) NOT NULL default '',
  `sdesc` text NOT NULL,
  `pbrank` tinyint(3) unsigned NOT NULL default '0',
  `commend` tinyint(1) unsigned NOT NULL default '0',
  `commendpic` varchar(255) NOT NULL default '',
  `ishtml` tinyint(1) unsigned NOT NULL default '0',
  `titlecolor` char(6) NOT NULL default '',
  `titlestyle` tinyint(3) unsigned NOT NULL default '0',
  `iffirst` tinyint(1) unsigned NOT NULL default '0',
  `ainfo` text NOT NULL,
  `iflock` tinyint(1) unsigned NOT NULL default '0',
  `ifconvert` tinyint(1) unsigned NOT NULL default '1',
  `anonsite` varchar(255) NOT NULL default '',
  `anonymity` tinyint(1) unsigned NOT NULL default '0',
  UNIQUE KEY `tid` (`tid`)
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `pb_tplvar`;
CREATE TABLE `pb_tplvar` (
  `tplid` smallint(6) unsigned NOT NULL auto_increment,
  `tplmark` varchar(30) NOT NULL default '',
  `tplname` varchar(255) NOT NULL default '',
  `tplcontent` text NOT NULL,
  PRIMARY KEY  (`tplid`)
) ENGINE=MyISAM;
INSERT INTO `pb_tplvar` (`tplid`, `tplmark`, `tplname`, `tplcontent`) VALUES (1, 'topped', '置顶内容', '<li><span>{!--postdate--}</span>[{!--topped--}]<a href="{!--turl--}" title="{!--subject--}">{!--subject--}</a></li>'),
(2, 'first', '头条新闻', '<h3><a href="{!--turl--}" title="{!--altsubject--}">{!--subject--}</a><p>{!--summary--}</p></h3>');
DROP TABLE IF EXISTS `pb_usergroups`;
CREATE TABLE `pb_usergroups` (
  `groupid` smallint(6) unsigned NOT NULL auto_increment,
  `adminid` smallint(6) unsigned NOT NULL default '0',
  `gtype` enum('system','special','member') NOT NULL default 'member',
  `grouptitle` varchar(30) NOT NULL default '',
  `uplower` int(10) NOT NULL default '0',
  `uphigher` int(10) unsigned NOT NULL default '0',
  `allowvisit` tinyint(1) NOT NULL default '0',
  `allowsort` tinyint(1) NOT NULL default '0',
  `allowread` tinyint(1) NOT NULL default '0',
  `allowpost` tinyint(1) NOT NULL default '0',
  `allowcomment` tinyint(1) NOT NULL default '0',
  `allowdigg` tinyint(1) NOT NULL default '0',
  `allowbury` tinyint(1) NOT NULL default '0',
  `allowbsearch` tinyint(1) NOT NULL default '0',
  `allowasearch` tinyint(1) NOT NULL default '0',
  `searchmax` smallint(5) unsigned NOT NULL default '0',
  `allowreport` tinyint(1) NOT NULL default '0',
  `allowhtml` tinyint(1) NOT NULL default '0',
  `allowmsg` tinyint(1) NOT NULL default '0',
  `msgmax` smallint(5) unsigned NOT NULL default '0',
  `allowfavors` tinyint(1) NOT NULL default '0',
  `favorsmax` smallint(5) unsigned NOT NULL default '0',
  `allowavatar` tinyint(1) NOT NULL default '0',
  `allowaupload` tinyint(1) NOT NULL default '0',
  `uploadmax` mediumint(8) unsigned NOT NULL default '0',
  `uploadtype` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`groupid`)
) ENGINE=MyISAM;
INSERT INTO `pb_usergroups` (`groupid`, `adminid`, `gtype`, `grouptitle`, `uplower`, `uphigher`, `allowvisit`, `allowsort`, `allowread`, `allowpost`, `allowcomment`, `allowdigg`, `allowbury`, `allowbsearch`, `allowasearch`, `searchmax`, `allowreport`, `allowhtml`, `allowmsg`, `msgmax`, `allowfavors`, `favorsmax`, `allowavatar`, `allowaupload`, `uploadmax`, `uploadtype`) VALUES (1, 1, 'system', '系统管理员', 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 100, 1, 100, 1, 1, 204800, 'jpeg,jpg,gif,png,zip,rar'),
(2, 2, 'system', '前台管理员', 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 100, 1, 100, 1, 1, 204800, 'jpg,jpeg,gif,png,zip,rar'),
(3, 0, 'system', '禁止发言', 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
(4, 0, 'system', '禁止访问', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
(5, 0, 'system', '游客', 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, ''),
(6, 0, 'system', '待验证会员', 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 0, 0, 0, 0, ''),
(7, 0, 'member', '普通会员', -2147483647, 2147483647, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 100, 1, 100, 1, 1, 204800, 'jpg,jpeg,gif,png,zip,rar');