📄 showuser.asp
字号:
<!--#INCLUDE FILE="inc/db_inc.asp"-->
<!--#INCLUDE FILE="inc/char_inc.asp"-->
<!--#INCLUDE FILE="inc/xbcode_inc.asp"-->
<!--#INCLUDE FILE="header.asp"-->
<!--#INCLUDE FILE="user.asp"-->
<%
dim ip, strip, killip
dim StrSql, rs2, toptext, StrHtml, StrHtml2, StrHtml3, t1
if request("userid") <> "" then
userid = ChkSql(request("userid"))
err = false
if not IsNumeric(userid) then
err = true
else
StrSql = "select * from sf_user where userid = " & userid
Set rs2 = server.CreateObject("ADODB.RecordSet")
rs2.Open StrSql, Conn, 1, 1
if rs2.bof or rs2.eof then
err = true
end if
end if
end if
StrHtml = loadtemplate("htmltop")
StrHtml = Replace(StrHtml, "{pagetitle}", loadtemplate("showusertitle"))
StrHtml = Replace(StrHtml, "{forumtitle}", boardtitle)
response.write StrHtml
StrHtml = loadtemplate("pagetitle")
if request.cookies("sf")("username") = "" then
toptext = loadtemplate("toptextguest")
else
toptext = loadtemplate("toptextuser")
end if
toptext = toptext & loadtemplate("toptext")
StrHtml = Replace(StrHtml, "{top_text}", toptext)
StrHtml = Replace(StrHtml, "{username}", request.cookies("sf")("username"))
response.write StrHtml
' 论坛关闭
StrSql = "select * from sf_setup"
Set rs = Conn.Execute(StrSql)
if rs("forumclose") = 1 then
StrHtml = loadtemplate("error")
StrHtml = Replace(StrHtml, "{error_text}", rs("forumclosehint"))
response.write StrHtml
response.end
end if
' 禁止IP访问
if rs("killip") = 1 then
userip = cstr(request.ServerVariables("REMOTE_ADDR"))
killiplist = rs("killiplist")
if killiplist <> "" and userip <> "" then
killip = split(killiplist, "|")
struserip = split(userip, ".")
i = 0
do until i > ubound(killip)
strkillip = split(killip(i), ".")
bolkill = true
if (struserip(0) <> strkillip(0)) and (strkillip(0) <> "*") then bolkill = false
if (struserip(1) <> strkillip(1)) and (strkillip(1) <> "*") then bolkill = false
if (struserip(2) <> strkillip(2)) and (strkillip(2) <> "*") then bolkill = false
if (struserip(3) <> strkillip(3)) and (strkillip(3) <> "*") then bolkill = false
if bolkill then
StrHtml = loadtemplate("error")
StrHtml = Replace(StrHtml, "{error_text}", rs("killiphint"))
response.write StrHtml
Response.End
end if
i = i + 1
loop
end if
end if
if err then
StrHtml = loadtemplate("error")
StrHtml = Replace(StrHtml, "{error_text}", loadtemplate("err_usernotexist"))
response.write StrHtml
response.end
end if
' 显示当前页面路径
StrHtml = loadtemplate("pagepath")
StrHtml = Replace(StrHtml, "{path_text}", "<a href=""index.asp"">" & boardtitle & "</a> » "& loadtemplate("showusertitle"))
response.write StrHtml
StrHtml = loadtemplate("showuser")
StrHtml = Replace(StrHtml, "{user_id}", rs2("userid"))
StrHtml = Replace(StrHtml, "{user_name}", server.htmlencode(rs2("username")))
if rs2("avatar") = "" then
StrHtml = Replace(StrHtml, "{user_avatar}", "<img src=""" & rs2("defineavatar") & """ width=""" & rs2("avatarwidth") & """ height=""" & rs2("avatarheight") & """>")
else
StrHtml = Replace(StrHtml, "{user_avatar}", "<img src=""image/avatar/" & rs2("avatar") & """>")
end if
if rs2("usertitle") = "" then
StrHtml = Replace(StrHtml, "{user_title}", GetTitle(rs2("posts")))
else
StrHtml = Replace(StrHtml, "{user_title}", rs2("usertitle"))
end if
select case rs2("usergroup")
case 4
StrHtml = Replace(StrHtml, "{user_titleimg}", "<img src=""image/title/10.gif"">")
case 3
StrHtml = Replace(StrHtml, "{user_titleimg}", "<img src=""image/title/9.gif"">")
case 2
StrHtml = Replace(StrHtml, "{user_titleimg}", "<img src=""image/title/8.gif"">")
case 1
StrHtml = Replace(StrHtml, "{user_titleimg}", "<img src=""image/title/8.gif"">")
case else
StrHtml = Replace(StrHtml, "{user_titleimg}", "<img src=""image/title/" & GetTitleImg(rs2("posts")) & ".gif"">")
end select
if rs2("sex") = "" then
StrHtml = Replace(StrHtml, "{user_sex}", "")
else
StrHtml = Replace(StrHtml, "{user_sex}", "<img src=""image/sexicon/" & rs2("sex") & ".gif"" border=0>")
end if
oldtime = dateadd("n", onlinetime * -1, now())
if rs2("lastactivity") > oldtime then
StrHtml = Replace(StrHtml, "{user_online}", "Online")
else
StrHtml = Replace(StrHtml, "{user_online}", "Offline")
end if
StrHtml = Replace(StrHtml, "{user_posts}", rs2("posts"))
StrHtml = Replace(StrHtml, "{user_rating}", rs2("rating"))
StrHtml = Replace(StrHtml, "{user_country}", rs2("country"))
if rs2("showemail") =1 then
StrHtml = Replace(StrHtml, "{user_email}", "<a href=""mailto:" & rs2("email") & """>" & rs2("email") & "</a>")
else
StrHtml = Replace(StrHtml, "{user_email}", "")
end if
if rs2("homepage") <>"" and left(rs2("homepage"), 7) <> "http://" then
StrHtml = Replace(StrHtml, "{user_homepage}", "<a href=""http://" & rs2("homepage") & """ target=_blank>" & rs2("homepage") & "</a>")
else
StrHtml = Replace(StrHtml, "{user_homepage}", "<a href=""" & rs2("homepage") & """ target=_blank>" & rs2("homepage") & "</a>")
end if
StrHtml = Replace(StrHtml, "{user_qq}", rs2("qq"))
StrHtml = Replace(StrHtml, "{user_birthday}", rs2("birthday"))
StrHtml = Replace(StrHtml, "{user_like}", rs2("like"))
if rs2("lastposttitle") = "" then
StrHtml = Replace(StrHtml, "{user_lastposttitle}", "")
StrHtml = Replace(StrHtml, "{user_lastpost}", "")
else
StrHtml = Replace(StrHtml, "{user_lastposttitle}", "<a href=""showthread.asp?threadid=" & rs2("lastpostid") & """>" & rs2("lastposttitle") & "</a>")
StrHtml = Replace(StrHtml, "{user_lastpost}", rs2("lastposttime"))
end if
StrHtml = Replace(StrHtml, "{user_joindate}", year(rs2("joindate")) & "-" & month(rs2("joindate")) & "-" & day(rs2("joindate")))
StrHtml = Replace(StrHtml, "{user_lastlogin}", year(rs2("lastvisit")) & "-" & month(rs2("lastvisit")) & "-" & day(rs2("lastvisit")))
response.write StrHtml
response.write sfcopyright
response.write loadtemplate("htmlbottom")
Conn.Close
Set Conn = nothing
Set rs = nothing
Set StrHtml = nothing
set ip = nothing
set strip = nothing
set killip = nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -