安装方法:
如果曾经安装过宠物插件的不用执行第一步。。直接从第2步做起~
1、首先在后台先执行下面的SQL语句
alter table [kk_user] add IsPet bit default False
上面增加的字段主要是用来显示用户的宠物宝宝信息
2、打开Show.asp
找到
<!--#include file="inc/page_Cls.asp"-->
在后面添加
<!--#include file="pet_conn.asp"-->
找到
B.IsAppraise,B.IsDel
在后面添加
,U.IsPet
注意:如果有安装奖章插件或别的插件,把,U.Ispet移动最后面
找到
S=Replace(S,"{用户}",Arr_Rs(11,i))
在下面添加
S=Replace(S,"{宠物信息}",PetInfo(BBS94KK.Fun.GetSqlStr(Arr_Rs(36,i))))
注意:如果有安装奖章插件或别的插件,把上面的36换成相应的数字。。。
找到最后的一个%>
在前面添加
''宠物信息
Function PetInfo(ispet)
dim rs1,petep,petshowlevel,levelpic,petpic,petkill,petdead,petlevel,petpk,mypetpic,petsex,S
set rs1=connpet.execute("select * from [mypetdata] where username=''"&username&"''")
if not rs1.eof then
if rs1("mypetsex")<2 then
petsex="雄"
else
petsex="雌"
end if
if rs1("mypethp")<1 or rs1("mypetsp")<1 or rs1("mypetdead")>0 then
petdead="死亡"
else
petdead="生存"
end if
if rs1("openpk")<2 then
petpk="小样打我呀!"
else
petpk="我在闭关!"
end if
if petdead="死亡" then
petkill="d-"
else
petkill=""
end if
levelpic=int(rs1("mypetlevel")/10)
if levelpic>10 then levelpic=11 end if
petpic=rs1("mypetname")
S=S&"<table align=''center'' border=''0'' cellpadding=''0'' cellspacing=''0''><td>宝宝:<a href=''petview.asp?username="&rs1("username")&"'' title=''【挑战∷查看】宠物详细资料''><font color=''#FF0000''>"&rs1("mypet")&"</font></a></td></tr><tr><td>性别:"&petsex&"</td></tr><tr><td>属性:"&rs1("mypetsx")&"</td></tr><tr><td>级别:"&rs1("mypetlevel")&" </td></tr><tr><td>状态:"&petdead&"</td></tr><tr><td>挑战:"&petpk&"</td></tr><br><tr><td rowspan=''6'' valign=''center''><img src=''Images/pet/"&petpic&"/"&petkill&""&petpic&""&levelpic&".gif'' border=''0'' align=''absmiddle''></td></table>"
Else
S=S&"< align=center>还没有宠物宝宝哦!<br>快到<a href=''petshop.asp''><font color=''#FF0000''>宠物商店</font></a>买只吧。</p>"
End if
petinfo=S
rs1.close
End Function
最后在后台管理风格,编辑要修改的风格--选择帖子信息
在适当位置添加:
{宠物信息}<br />
3、发帖跟帖加宠物经验的方法
打开SaySave.asp
找到
<!--#include file="Inc.asp"-->
在下面添加
<!--#include file="pet_conn.asp"-->
找到
.execute("Update [KK_user] set "&Temp&"EssayNum=EssayNum+1 WHERE ID="&.MyID&"")
在下面添加
''更新宠物经验
Connpet.execute("Update [mypetdata] set mypetexp=mypetexp+"&DEF_PET_newtopicexp&" WHERE UserName=''"&BBS94KK.MyName&"''")
找到
.execute("Update [KK_user] set "&Temp&"EssayNum=EssayNum+1 WHERE ID="&.MyID)
在下面添加
''更新宠物回复经验
Connpet.execute("update [mypetdata] set mypetexp=mypetexp+"&DEF_PET_replytopicexp&" WHERE username=''"&BBS94KK.Myname&"''")
原帖里的修改方法,不论发帖或回帖显示的宠物加经验都只是20,即都显示的是回帖的加经验,现在修改一下,可分别显示发帖和回帖的宠物加经验值
发贴显示宠物加经验的方法(我帮worm编辑了一下,修改了错误地方,现在可以正确使用了)
还是打开SaySave.asp
找到
替换为
再找到
替换为
自己发现有bug,晕
Microsoft VBScript 运行时错误 错误 \'\'800a01f4\'\'
变量未定义: \'\'MaxID\'\'
/Saysave.asp,行 195
欢迎光临 新丰家园 (https://xinfengbbs.com/) | Powered by Discuz! X3.2 |