📄 mymodify.asp
字号:
If cCur(Dvbbs.MyUserInfo(38)) < Rs(1) And cCur(Dvbbs.MyUserInfo(37)) < Rs(0) Then Response.redirect "showerr.asp?ErrCodes=<li>您没有足够的金币或点券使用魔法表情,2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
Dim iMagicSetting
iMagicSetting = Split(Rs(2),"|")
If cCur(iMagicSetting(0)) > cCur(Dvbbs.MyUserInfo(8)) Then Response.redirect "showerr.asp?ErrCodes=<li>您的帖子数没有达到使用魔法表情的标准,2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
If cCur(iMagicSetting(1)) > cCur(Dvbbs.MyUserInfo(21)) Then Response.redirect "showerr.asp?ErrCodes=<li>您的金钱数没有达到使用魔法表情的标准,2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
If cCur(iMagicSetting(2)) > cCur(Dvbbs.MyUserInfo(22)) Then Response.redirect "showerr.asp?ErrCodes=<li>您的经验数没有达到使用魔法表情的标准,2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
If cCur(iMagicSetting(3)) > cCur(Dvbbs.MyUserInfo(23)) Then Response.redirect "showerr.asp?ErrCodes=<li>您的魅力数没有达到使用魔法表情的标准,2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
If cCur(iMagicSetting(4)) > cCur(Dvbbs.MyUserInfo(24)) Then Response.redirect "showerr.asp?ErrCodes=<li>您的威望数没有达到使用魔法表情的标准,2秒后自动返回上一页面。&action=OtherErr&autoreload=1"
face = iMagicFace & "|" & face
tMagicMoney = Rs(0)
tMagicTicket = Rs(1)
FoundUseMagic = True
End If
Rs.Close
Set Rs=Nothing
Else
face = "0|" & face
End If
If width="" or height="" Then
width=Dvbbs.Forum_Setting(38)
height=Dvbbs.Forum_Setting(39)
End If
If Dvbbs.StrLength(Request.Form("Signature")) > 250 Then
ErrCodes = ErrCodes + "<li>" + Template.Strings(23)
ElseIf Dvbbs.StrLength(Request.Form("Signature")) > Cint(Dvbbs.GroupSetting(56)) And Cint(Dvbbs.GroupSetting(56)) > 0 Then
ErrCodes = ErrCodes + "<li>" + Replace(Template.Strings(23), "250", Cint(Dvbbs.GroupSetting(56)))
End If
birthday=trim(Request.Form("birthday"))
If Not IsDate(birthday) Then birthday=""
Dim userinfo,useRsetting
userinfo=checkreal(Request.Form("realname")) & "|||" & checkreal(Request.Form("character")) & "|||" & checkreal(Request.Form("peRsonal")) & "|||" & checkreal(Request.Form("country")) & "|||" & checkreal(Request.Form("province")) & "|||" & checkreal(Request.Form("city")) & "|||" & Request.Form("shengxiao") & "|||" & Request.Form("blood") & "|||" & Request.Form("belief") & "|||" & Request.Form("occupation") & "|||" & Request.Form("marital") & "|||" & Request.Form("education") & "|||" & checkreal(Request.Form("college")) & "|||" & checkreal(Request.Form("userphone")) & "|||" & checkreal(Request.Form("address"))
usersetting=Request.Form("setuserinfo") & "|||" & Request.Form("setusertrue") & "|||" & showRe
Dim UpSessionID
UpSessionID=Session(Dvbbs.CacheName & "UserID")
UpSessionID(11)=Trim(face)
UpSessionID(12)=Trim(Width)
UpSessionID(13)=Trim(height)
UpSessionID(25)=Trim(birthday)
If ErrCodes<>"" Then Exit Sub
Set Rs=server.createobject("adodb.recordset")
If Not IsObject(Conn) Then ConnectionDatabase
sql="Select * from [Dv_User] where userid="&Dvbbs.UserID
Rs.open sql,conn,1,3
If Rs.EOF And Rs.BOF Then
Dvbbs.AddErrCode(12)
Else
iFace = Split(Rs("UserFace"),"|")
If Ubound(iFace) = 1 And Dvbbs.Forum_Setting(98)="1" Then
If Clng(iFace(0)) <> Clng(Split(Face,"|")(0)) Then
If cCur(Dvbbs.MyUserInfo(37)) > tMagicMoney Then
Rs("UserMoney") = Rs("UserMoney") - tMagicMoney
UpSessionID(37) = UpSessionID(37) - tMagicMoney
Dvbbs.ToolsLog -88,1,tMagicMoney,0,1,"使用金币购买魔法头像",UpSessionID(37) & "|" & UpSessionID(38)
Else
Rs("UserTicket") = Rs("UserTicket") - tMagicTicket
UpSessionID(38) = UpSessionID(38) - tMagicTicket
Dvbbs.ToolsLog -88,1,0,tMagicTicket,1,"使用点券购买魔法头像",UpSessionID(37) & "|" & UpSessionID(38)
End If
End If
End If
Rs("UserFace")=face
Rs("UserWidth")=Replace(width,"|","")
Rs("UserHeight")=Replace(height,"|","")
If Not Dvbbs.FoundIsChallenge Then Rs("UseRsex")=sex
Rs("UserSign")=Replace(Request.Form("Signature"),"|","")
Rs("UserPhoto")=Replace(Dv_FilterJS(Request.Form("userphoto")),"|","")
If Dvbbs.Forum_Setting(32)="1" And IsTrueGroupName(Request.Form("groupname")) Then
Rs("UserGroup")=Replace(Dvbbs.iHtmlEncode(Request.Form("groupname")),"|","")
Else
Rs("UserGroup")=""
End If
'判断是否允许提交头衔
If Cint(Dvbbs.Forum_Setting(6))=1 Then
CanUseTitle=True
End If
If CanUseTitle and Cint(Dvbbs.Forum_Setting(60))>0 and Rs("UserPost")>Cint(Dvbbs.Forum_Setting(60)) Then
CanUseTitle1=True
ElseIf CanUseTitle and Cint(Dvbbs.Forum_Setting(60))=0 Then
CanUseTitle1=True
Else
CanUseTitle1=False
End If
If CanUseTitle and Cint(Dvbbs.Forum_Setting(61))>0 and DateDiff("d",Rs("JoinDate"),Now())>Cint(Dvbbs.Forum_Setting(61)) Then
CanUseTitle2=True
ElseIf CanUseTitle and Cint(Dvbbs.Forum_Setting(61))=0 Then
CanUseTitle2=True
Else
CanUseTitle2=False
End If
If CanUseTitle and Cint(Dvbbs.Forum_Setting(62))=1 Then
If CanUseTitle1 and CanUseTitle2 Then
CanUseTitle=True
Else
CanUseTitle=False
End If
ElseIf CanUseTitle and (CanUseTitle1 or CanUseTitle2) Then
CanUseTitle=True
Else
CanUseTitle=False
End If
usertitle = Replace(Dvbbs.iHtmlencode(Request.Form("title")),"|","")
If CanUseTitle Then
If Trim(Dvbbs.Forum_Setting(63))<>"" Then
SplitUserTitle=split(Dvbbs.Forum_Setting(63),"|")
For i=0 to ubound(SplitUserTitle)
If InStr(lcase(usertitle),lcase(SplitUserTitle(i)))>0 Then
ErrCodes=ErrCodes+"<li>"+template.Strings(24)
Exit sub
End If
Next
End If
If Len(usertitle)>Cint(Dvbbs.Forum_Setting(59)) Then
ErrCodes=ErrCodes+"<li>"+Replace(template.Strings(25),"{$MaxTitleLen}",Dvbbs.Forum_Setting(59))
Exit Sub
End If
Rs("UserTitle")=usertitle
UpSessionID(34)=usertitle
End If
If birthday<>"" Then Rs("UserBirthday")=birthday
Rs("Userinfo")=Userinfo
Rs("UseRsetting")=Trim(UseRsetting)
Rs.Update
usercookies=Request.Form("usercookies")
If IsNumeric(usercookies) Then usercookies=Cint(usercookies) Else usercookies=0
Select Case usercookies
Case 0
Response.Cookies(Dvbbs.Forum_sn)("usercookies") = usercookies
Case 1
Response.Cookies(Dvbbs.Forum_sn).Expires=Date+1
Response.Cookies(Dvbbs.Forum_sn)("usercookies") = usercookies
Case 2
Response.Cookies(Dvbbs.Forum_sn).Expires=Date+31
Response.Cookies(Dvbbs.Forum_sn)("usercookies") = usercookies
Case 3
Response.Cookies(Dvbbs.Forum_sn).Expires=Date+365
Response.Cookies(Dvbbs.Forum_sn)("usercookies") = usercookies
End Select
Response.Cookies(Dvbbs.Forum_sn).path=Dvbbs.cookiepath
End If
Rs.Close
Set Rs=Nothing
Session(Dvbbs.CacheName & "UserID")=UpSessionID
Dvbbs.Dvbbs_Suc("<li>"+template.Strings(26))
End sub
Function checkreal(v)
Dim w
If not isnull(v) Then
w=replace(v,"|","")
checkreal=w
End If
End Function
Function IsTrueGroupName(GroupName)
IsTrueGroupName=False
If GroupName="" Then Exit Function
Dim tRs
Set tRs=dvbbs.Execute("Select GroupName From [Dv_GroupName]")
Do While Not tRs.EOF
If GroupName=tRs(0) Then
IsTrueGroupName=True
Exit Do
End If
tRs.MoveNext
Loop
tRs.close:Set tRs=Nothing
End Function
'用户头衔输出
Function SetUserTitle(str)
SetUserTitle=template.html(6)
SetUserTitle=Replace(SetUserTitle,"{$user_Title}",str)
End Function
'str=0 关闭显示上传头像表单
Function SetUserFace(str,face,wid,hig,mypostnum)
Dim tempstr,facetemp,userregface,i
tempstr = Split(template.html(7),"||")
Dvbbs.Forum_userface = split(Dvbbs.Forum_userface,"|||")
For i = 1 to Ubound(Dvbbs.Forum_userface)-1
userregface = userregface+"<option value="+Dvbbs.Forum_userface(0)&Dvbbs.Forum_userface(i)
If trim(lcase(userregface)) = trim(lcase(face)) then userregface = userregface+" selected "
userregface = userregface+">"+Dvbbs.Forum_userface(i)+"</option>"
Next
If str = 0 Then
SetUserFace = tempstr(0) & tempstr(2)
Else
SetUserFace = tempstr(0) & tempstr(1) & tempstr(2)
End If
SetUserFace=Replace(SetUserFace,"{$Face_select}",userregface)
SetUserFace=Replace(SetUserFace,"{$color}",Dvbbs.mainsetting(1))
SetUserFace=Replace(SetUserFace,"{$user_Face}",Dv_FilterJS(face))
SetUserFace=Replace(SetUserFace,"{$user_FaceWidth}",wid)
SetUserFace=Replace(SetUserFace,"{$user_FaceHeight}",hig)
SetUserFace=Replace(SetUserFace,"{$forum_Mwidth}",Dvbbs.Forum_Setting(57))
SetUserFace=Replace(SetUserFace,"{$forum_Mheight}",Dvbbs.Forum_Setting(57))
SetUserFace=Replace(SetUserFace,"{$mypostnum}",Dvbbs.MyUserInfo(8))
SetUserFace=Replace(SetUserFace,"{$facepostnum}",Dvbbs.Forum_Setting(54))
End Function
'用户门派输出
Function SetUserGroup(str)
Dim tempstr
Set Rs=Dvbbs.Execute("Select GroupName From [Dv_GroupName]")
Do While Not Rs.EOF
tempstr=tempstr+"<option value="&Rs(0)
If trim(Rs(0))=trim(str) Then tempstr=tempstr+" selected"
tempstr=tempstr+" > "&Rs(0)&" </option>"
Rs.MoveNext
Loop
Rs.Close
SetUserGroup=Replace(template.html(8),"{$user_GroupName}",tempstr)
End Function
'下拉菜单转换输出
Function Chk_select(str1,str2)
Dim k
str2=Split(str2,",")
If IsEmpty(str1) Or str1="" Then chk_select="<option value='' selected>...</option>"
For k=0 to ubound(str2)
chk_select=chk_select+"<option value="+str2(k)
If str2(k)=str1 Then chk_select=chk_select+" selected "
chk_select=chk_select+" >"+str2(k)+"</option>"
Next
End Function
'多项选取转换输出
Function Chk_KidneyType(str0,str1,str2)
Dim k
str2=split(str2,",")
For k = 0 to ubound(str2)
chk_KidneyType=chk_KidneyType+"<input type=""checkbox"" name="""&str0&""" value="""&trim(str2(k))&""" "
If instr(str1,trim(str2(k)))>0 Then '如果有此项性格
chk_KidneyType=chk_KidneyType + "checked"
End If
chk_KidneyType=chk_KidneyType + ">"&trim(str2(k))&" "
If ((k+1) mod 5)=0 Then chk_KidneyType=chk_KidneyType + "<br>" '每行显示六个性格进行换行
Next
End Function
Rem 判断数字是否整形
Function isInteger(Para)
isInteger=False
If Not (IsNull(Para) Or Trim(Para)="" Or Not IsNumeric(Para)) Then
isInteger=True
End If
End Function
Function Dv_FilterJS(v)
If Not Isnull(V) Then
Dim t
Dim re
Dim reContent
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="(%)"
t=re.Replace(v,"<I>%</I>")
re.Pattern="(&#)"
t=re.Replace(v,"<I>&#</I>")
re.Pattern="(script)"
t=re.Replace(t,"<I>script</I>")
re.Pattern="(js:)"
t=re.Replace(t,"<I>js:</I>")
re.Pattern="(value)"
t=re.Replace(t,"<I>value</I>")
re.Pattern="(about:)"
t=re.Replace(t,"<I>about:</I>")
re.Pattern="(file:)"
t=re.Replace(t,"<I>file:</I>")
re.Pattern="(Document.cookie)"
t=re.Replace(t,"<I>Documents.cookie</I>")
re.Pattern="(vbs:)"
t=re.Replace(t,"<I>vbs:</I>")
re.Pattern="(on(mouse|Exit|error|click|key))"
t=re.Replace(t,"<I>on$2</I>")
Dv_FilterJS=Trim(t)
Set Re=Nothing
End If
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -