有需要的联系qq165633505 query("CREATE TABLE IF NOT EXISTS `".$DT_PRE."bdpost_stat` (`moduleid` int(6) NOT NULL,`name` varchar(20) DEFAULT NULL,`total` bigint(20) DEFAULT '0',`posted` bigint(20) DEFAULT '0',`itemid` bigint(20) DEFAULT
query("CREATE TABLE IF NOT EXISTS `".$DT_PRE."bdpost_stat` (`moduleid` int(6) NOT NULL,`name` varchar(20) DEFAULT NULL,`total` bigint(20) DEFAULT '0',`posted` bigint(20) DEFAULT '0',`itemid` bigint(20) DEFAULT '0',`isdel` int(1) DEFAULT '0',PRIMARY KEY (`moduleid`)) ENGINE=MyISAM COMMENT='百度提交统计';"); $db->query("CREATE TABLE IF NOT EXISTS `".$DT_PRE."bdpost_log` (`urls` int(10) DEFAULT NULL,`stat` varchar(255) DEFAULT '0', `message` varchar(255) DEFAULT '0', `time` int(10) DEFAULT '0', PRIMARY KEY (`time`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='百度提交日志';"); $db->query("CREATE TABLE IF NOT EXISTS `".$DT_PRE."bdpost_set`(`skey` varchar(20) NOT NULL,`svalue` varchar(20) DEFAULT NULL,PRIMARY KEY (`skey`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='百度提交设置';"); /*基本设置*/ $db->query("INSERT INTO `".$DT_PRE."bdpost_set` VALUES ('token', '0iINBKSeGdN9Cbxq'),('num', '200'),('sptime', '60');"); /*导入状态*/ $re = $db->query("select moduleid,name from ".$DT_PRE."module where disabled=0 and moduleid>=5"); while($r = $db->fetch_array($re)){ $table = get_table($r['moduleid']); $t = $db->get_one("select count(*) as num from ".$table); $db->query("INSERT INTO `".$DT_PRE."bdpost_stat` (`moduleid`, `name`, `total`) VALUES ('".$r['moduleid']."', '".$r['name']."', '".$t['num']."')"); } /*添加菜单*/ $db->query("INSERT INTO `".$DT_PRE."admin` VALUES ('0', '1', '0', '百度提交', '?file=bdpost', '', '0', '', '', '');"); /*添加计划任务*/ $db->query("INSERT INTO `".$DT_PRE."cron` VALUES ('0', '百度提交', '0', 'bdpost', '60', '0', '0', '0', '');"); file_put('bdpost.install',""); msg("安装成功",DT_PATH); function msg($msg = errmsg, $forward = 'goback', $time = '1') { global $CFG; if(!$msg && $forward && $forward != 'goback') dheader($forward); include DT_ROOT.'/admin/template/msg.tpl.php'; exit; } ?>