📄 power_func.asp
字号:
<%
dim gradearrary
if gradeString<>"" then gradeString=replace(gradeString,";",";")
gradearrary=split(gradeString,";")
function havepower(hp_fid)
dim havepower_sql,havepower_rs,hp_cid,havepower_fadmin,havepower_cadmin
havepower=0
if hp_fid="" then
exit function
else
havepower_sql="select FAdmin,CID from m3_forum where FID="&hp_fid
set havepower_rs=server.CreateObject("adodb.recordset")
havepower_rs.open havepower_sql,conn,1,1
if not(havepower_rs.eof and havepower_rs.bof) then
havepower_fadmin=havepower_rs("FAdmin")
hp_cid=havepower_rs("CID")
end if
havepower_rs.close
set havepower_rs=nothing
if havepower1(havepower_fadmin)=1 then
havepower=1
exit function
else
havepower_sql="select CAdmin from m3_category where CID="&hp_cid
set havepower_rs=server.CreateObject("adodb.recordset")
havepower_rs.open havepower_sql,conn,1,1
if not(havepower_rs.eof and havepower_rs.bof) then
havepower_cadmin=havepower_rs("CAdmin")
end if
havepower_rs.close
set havepower_rs=nothing
if havepower1(havepower_cadmin)=1 then
havepower=1
exit function
end if
end if
end if
end function
function havepower1(adminliststr)
dim havepower1_i
havepower1=0
if adminliststr<>"" then
adminliststr=split(adminliststr,",")
for havepower1_i=0 to ubound(adminliststr)
if adminliststr(havepower1_i)=request.Cookies("matrix3")("matrix3_name") then
havepower1=1
exit function
end if
next
end if
end function
Function Strlength(Str)
if IsNull(Str) then exit function
dim Temp_Str,II,Test_Str
Temp_Str=Len(Str)
For II=1 To Temp_Str
Test_Str=(Mid(Str,II,1))
If Asc(Test_Str)>0 Then
Strlength=Strlength+1
Else
Strlength=Strlength+2
End If
Next
End Function
Function Strleft(Str,L)
if IsNull(Str) then exit function
dim Temp_Str,II,Test_Str,lens
lens=0
Temp_Str=Len(Str)
For II=1 To Temp_Str
Test_Str=(Mid(Str,II,1))
Strleft=Strleft&Test_Str
If Asc(Test_Str)>0 Then
lens=lens+1
Else
lens=lens+2
End If
If lens>=L Then Exit For
Next
End Function
function getext(filename)
if isnull(filename) then exit function
if instr(filename,".")>0 then
getext=lcase(mid(filename,instrRev(filename,".")+1))
else
getext=""
end if
end function
function usergrade(userscore,nuserlevel)
userscore=clng(userscore)
if userscore<=0 then
usergrade=gradearrary(0)
elseif userscore\gradejg>ubound(gradearrary) then
usergrade=gradearrary(ubound(gradearrary))
else
usergrade=gradearrary(userscore\gradejg)
end if
end function
function userlevelimg(userscore,nuserlevel)
userscore=clng(userscore)
if userscore<=0 then
userlevelimg=0
elseif userscore\gradejg>20 then
userlevelimg=20
else
userlevelimg=userscore\gradejg
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -