%
dim rs, sql, AutoID, PlayData(8), FLAG, i, Errh
dim PlayServerID, Day1, ServerList()
AutoID = ReqNum(Request("ID"))
FLAG = false
if AutoID = "" then
response.Redirect "/main.asp"
response.End
end if
'----計算人氣
sql = "update ST_Portrait set G_Count=(G_Count + 1) where AutoID=" & AutoID
Errh = DoCommand(sql)
'----撈出現有已開放Server
sql = "select ServerID from TOP_NowServer where ServerOP='Y' order by autoid"
Set rs = GetRecordset( sql )
if not(rs.BOF and rs.EOF) then
Redim ServerList(rs.recordcount)
for i = 1 to UBound(ServerList)
ServerList(i) = Trim(rs(0).value)
rs.movenext
next
end if
rs.close
set rs = nothing
'----撈單一筆
sql = "SELECT * from ST_Portrait where AutoID=" & AutoID & " and G_Op='Y'"
set rs = GetRecordset(sql)
if not(rs.BOF and rs.EOF) then
PlayData(1) = rs("G_Pic")
PlayData(2) = rs("G_Playname")
PlayData(3) = rs("G_Playjob")
PlayData(4) = rs("G_Playserver")
PlayData(5) = rs("G_Star")
PlayData(6) = CStr(rs("G_Count"))
PlayData(7) = rs("G_Sex")
PlayData(8) = rs("G_Ex")
'----找出Server名稱對應的ID
PlayServerID = "1"
for i = 1 to UBound(ServerList)
if ServerList(i) = Trim(PlayData(4)) then PlayServerID = CStr(i)
next
'----拼出年月
Day1 = rs("AddTime")
Day1 = DatePart("yyyy",Day1) & "/" & Right("0" & DatePart("m",Day1),2)
else
FLAG = true
end if
rs.close : set rs = nothing
if FLAG then
response.Redirect "portrait.asp"
response.End
end if
%>