Tomcat+MySQL下安装基于struts的天乙社区v8版

环境为Windows XP SP2+MySQL5.0+Tomcat6.0+j2sdk1.6.0

 

运行cmd

mysql -u root -p
Enter password:

mysql> CREATE DATABASE `bbscs8` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

mysql> exit

 

将bbscs8.sql复制到mysql的bin目录下

mysql   -uroot   -p   bbscs8   <   bbscs8.sql

 

将webapps-bbscs下root目录改名为bbscs8,Copy至Tomcat的webapps目录下,修改tomcat/webapps/bbscs8/WEB-INF/classes/init.properties文件,需要修改的项目有
datasource.url=jdbc:mysql://localhost:3306/bbscs6?useUnicode=true&characterEncoding=UTF-8
datasource.username=
datasource.password=
bbscs.safePath=

按实际情况填写

 

然后启动Tomcat,本地访问http://localhost:8080/bbscs8即可访问社区

后台管理
http://localhost:8899/login.bbscs?action=admin
用户:webmaster
密码:12345

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
计算八字神煞需要用到农历和干地支的知识,可以使用 PHP 的日期和时间函数来实现。 步骤如下: 1. 获取用户输入的阳历生日,使用 PHP 的 date 函数将其转换为农历生日。 2. 根据农历生日,计算出生年、生月、生日的干地支。 3. 根据干地支,查找对应的八字神煞。 以下是一个简单的 PHP 代码示例: ```php // 获取用户输入的生日 $birthday = '1990-01-01'; // 将阳历生日转换为农历生日 $chineseBirthday = getChineseBirthday($birthday); // 计算出生年、月、日的干地支 list($yearTianGan, $yearDiZhi) = getTianGanDiZhi($chineseBirthday['year']); list($monthTianGan, $monthDiZhi) = getTianGanDiZhi($chineseBirthday['month']); list($dayTianGan, $dayDiZhi) = getTianGanDiZhi($chineseBirthday['day']); // 查找八字神煞 $shenSha = getShenSha($yearTianGan, $yearDiZhi, $monthTianGan, $monthDiZhi, $dayTianGan, $dayDiZhi); // 输出结果 echo '您的八字神煞为:' . implode(',', $shenSha); // 获取农历生日 function getChineseBirthday($birthday) { // 使用 PHP 的 DateTime 类将阳历生日转换为农历生日 $dateTime = new DateTime($birthday); $chineseCalendar = new ChineseCalendar($dateTime); $chineseBirthday = [ 'year' => $chineseCalendar->getChineseYear(), 'month' => $chineseCalendar->getChineseMonth(), 'day' => $chineseCalendar->getChineseDay(), ]; return $chineseBirthday; } // 计算干地支 function getTianGanDiZhi($chineseValue) { // 干 $tianGan = ['甲', '', '丙', '丁', '戊', '己', '庚', '辛', '壬', '癸']; // 地支 $diZhi = ['子', '丑', '寅', '卯', '辰', '巳', '午', '未', '申', '酉', '戌', '亥']; // 计算干地支 $index = ($chineseValue - 4) % 60; $tianGanIndex = $index % 10; $diZhiIndex = $index % 12; $tianGanValue = $tianGan[$tianGanIndex]; $diZhiValue = $diZhi[$diZhiIndex]; return [$tianGanValue, $diZhiValue]; } // 查找八字神煞 function getShenSha($yearTianGan, $yearDiZhi, $monthTianGan, $monthDiZhi, $dayTianGan, $dayDiZhi) { // 八字神煞表 $shenShaTable = [ '甲子' => ['天乙', '文昌'], '甲戌' => ['厨', '文曲'], '丑' => ['吊客', '哭'], '酉' => ['陀罗', '虚'], '丙寅' => ['将星', '月'], '丙申' => ['巫', '德'], '丁卯' => ['才', '福'], '丁酉' => ['寿', '恩'], '戊辰' => ['贵', '使'], '戊戌' => ['荫', '罡'], '己巳' => ['福', '官'], '己亥' => ['伤', '蓬'], '庚午' => ['空', '任'], '庚子' => ['后', '伯'], '辛未' => ['印', '威'], '辛酉' => ['权', '禄'], '壬申' => ['德', '天乙'], '壬子' => ['才', '英'], '癸未' => ['寿', '巫'], '癸酉' => ['恩', '贵'], ]; // 查找八字神煞 $shenSha = []; $key = $yearTianGan . $yearDiZhi; if (isset($shenShaTable[$key])) { $shenSha = array_merge($shenSha, $shenShaTable[$key]); } $key = $monthTianGan . $monthDiZhi; if (isset($shenShaTable[$key])) { $shenSha = array_merge($shenSha, $shenShaTable[$key]); } $key = $dayTianGan . $dayDiZhi; if (isset($shenShaTable[$key])) { $shenSha = array_merge($shenSha, $shenShaTable[$key]); } return $shenSha; } ``` 需要注意的是,以上代码示例中使用了第三方库 `ChineseCalendar` 来实现阳历和农历的转换,使用前需要先安装该库。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值