搜索
查看: 2533|回复: 4

懂asp的进来看看!!!

[复制链接]
发表于 2008-6-9 21:08:12 | 显示全部楼层 |阅读模式 来自 中国–广东–深圳–宝安区
这个排行是按分数从高到低排列的,我想让他按照杀人数多少来排列!!请问怎么改??


<!--#include file="common.asp" -->
<link rel="icon" type="image/x-icon" href="CounterStrike.ico" />
<head>
<meta http-equiv="Content-Language" content="zh-cn">
</head>
<title>反恐精英即时排行榜</title>
<%
Dim Record
Dim BeginTime,EndTime
Dim strUserName
Dim strUserScore
Dim strUserKills
Dim strUserTeamkills
Dim strUserDeaths
Dim strUserHits
Dim strUserShots
Dim strUserHeadshots
Dim strUserEfficiency
Dim strUserAccuracy
Dim strUserAccuracyHS
Dim strUserDate
Dim Records
Dim strUserPlace
Dim strUserRankID
BeginTime=Timer
%>
<script language="javascript">
function opensearch()
{
showModalDialog('search_rank.asp','','scroll=no;status=no;resizable=no;help=no;center=yes;dialogHeight=250px;dialogWidth=400px');
}
</script>
<style type="text/css">
   a.mulu:link { text-decoration: none;color: yellow}
   a.mulu:active { text-decoration:blink}
   a.mulu:hover { text-decoration:underline;color: red}
   a.mulu:visited { text-decoration: none;color: yellow}
</style>
<!--#include file="includes/browser_page_encoding_inc.asp" -->
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" oncontextmenu="return false" onselectstart="return false">
<div align="center">
<table border="0" width="922" id="table1" cellpadding="0" style="font-size: 9pt; color: #FFFF00; font-family: 黑体; font-weight: bold; border-collapse: collapse" background="forum_images/rank_images/Body_bg.jpg">
<tr>
<td colspan="16" height="66" background="forum_images/rank_images/Top_logo.jpg">
<p align="right"><a href=default.asp class=mulu>【返回论坛】</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=javascript:opensearch() class=mulu>查询玩家信息</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
<tr>
<td width="40" height="30">
<img border="0" src="forum_images/rank_images/Left_Center.jpg" width="40" height="30"></td>
<td background="forum_images/rank_images/Up_Center.jpg" width="20" height="30" align="center">
#</td>
<td background="forum_images/rank_images/Up_Center.jpg" width="69" height="30" align="center">
<p align="left">军衔</td>
<td background="forum_images/rank_images/Up_Center.jpg" width="147" height="30" align="center">
<p align="left">ID</td>
<td background="forum_images/rank_images/Up_Center.jpg" width="45" height="30" align="center">
分数</td>
<td background="forum_images/rank_images/Up_Center.jpg" width="44" height="30" align="center">
杀敌</td>
<td background="forum_images/rank_images/Up_Center.jpg" width="50" height="30" align="center">
自残</td>
<td background="forum_images/rank_images/Up_Center.jpg" width="49" height="30" align="center">
死亡</td>
<td background="forum_images/rank_images/Up_Center.jpg" width="49" height="30" align="center">
扫射</td>
<td background="forum_images/rank_images/Up_Center.jpg" width="46" height="30" align="center">
射击</td>
<td background="forum_images/rank_images/Up_Center.jpg" width="47" height="30" align="center">
爆头</td>
<td background="forum_images/rank_images/Up_Center.jpg" width="46" height="30" align="center">
效率</td>
<td background="forum_images/rank_images/Up_Center.jpg" width="46" height="30" align="center">
精度</td>
<td background="forum_images/rank_images/Up_Center.jpg" width="50" height="30" align="center">
爆头率</td>
<td background="forum_images/rank_images/Up_Center.jpg" width="134" height="30" align="center">
最后更新</td>
<td width="40" height="30">
<img border="0" src="forum_images/rank_images/Right_Center.jpg" width="40" height="30"></td>
</tr>

<%
strSQL = "SELECT " & strDbTable & "author.Username," & strDbTable & "author.score," & strDbTable & "author.kills," & strDbTable & "author.teamkills," & strDbTable & "author.deaths," & strDbTable & "author.hits," & strDbTable & "author.shots," & strDbTable & "author.headshots," & strDbTable & "author.efficiency," & strDbTable & "author.accuracy," & strDbTable & "author.accuracyHS," & strDbTable & "author.date FROM " & strDbTable & "author ORDER by score DESC LIMIT 0,50;"
On Error Resume Next
rsCommon.Open strSQL, adoCon

If NOT rsCommon.EOF Then
sarryPosts = rsCommon.GetRows()
rsCommon.Close

'0=Username
'1=score
'2=kills
'3=teamkills
'4=deaths
'5=hits
'6=shots
'7=headshots
'8=efficiency
'9=accuracy
'10=accuracyHS
'11=date

Else Response.Write("<span style=""font-size: 9pt; font-weight: 700"">数据库暂时没有玩家记录,请稍后再查询!</span>")
End If
strSQL = "SELECT COUNT(*) AS Record FROM " & strDbTable & "author LIMIT 0,50;"
rsCommon.Open strSQL, adoCon
Records = CInt(rsCommon("Record"))
rsCommon.Close

Do While intCurrentRecord < 50
If intCurrentRecord = Records Then Exit Do

strUserName = sarryPosts(0,intCurrentRecord)
strUserScore = sarryPosts(1,intCurrentRecord)
strUserKills = sarryPosts(2,intCurrentRecord)
strUserTeamkills = sarryPosts(3,intCurrentRecord)
strUserDeaths = sarryPosts(4,intCurrentRecord)
strUserHits = sarryPosts(5,intCurrentRecord)
strUserShots = sarryPosts(6,intCurrentRecord)
strUserHeadshots = sarryPosts(7,intCurrentRecord)
strUserEfficiency = sarryPosts(8,intCurrentRecord)
strUserAccuracy = sarryPosts(9,intCurrentRecord)
strUserAccuracyHS = sarryPosts(10,intCurrentRecord)
strUserDate = sarryPosts(11,intCurrentRecord)
'Get User's Place
If strUserScore ="" Then strUserPlace = strTxtRank01
If strUserScore <= 0 Then strUserPlace = strTxtRank01
If strUserScore > 0 Then strUserPlace = strTxtRank02
If strUserScore >= 10 Then strUserPlace = strTxtRank03
If strUserScore >= 50 Then strUserPlace = strTxtRank04
If strUserScore >= 100 Then strUserPlace = strTxtRank05
If strUserScore >= 150 Then strUserPlace = strTxtRank06
If strUserScore >= 200 Then strUserPlace = strTxtRank07
If strUserScore >= 250 Then strUserPlace = strTxtRank08
If strUserScore >= 300 Then strUserPlace = strTxtRank09
If strUserScore >= 350 Then strUserPlace = strTxtRank10
If strUserScore >= 400 Then strUserPlace = strTxtRank11
If strUserScore >= 450 Then strUserPlace = strTxtRank12
If strUserScore >= 500 Then strUserPlace = strTxtRank13
If strUserScore >= 550 Then strUserPlace = strTxtRank14
If strUserScore >= 600 Then strUserPlace = strTxtRank15
If strUserScore >= 650 Then strUserPlace = strTxtRank16
If strUserScore >= 700 Then strUserPlace = strTxtRank17
If strUserScore >= 750 Then strUserPlace = strTxtRank18
If strUserScore >= 800 Then strUserPlace = strTxtRank19
If strUserScore >= 1000 Then strUserPlace = strTxtRank20
%>

<% Response.Write "<tr>" %>
<td width="40" height="25"> </td>
<td width="20" height="25" align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom"><% Response.Write (""&intCurrentRecord+1&"")%></td>
<td width="69" height="25" align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom">
<p align="left"><img src = "forum_images/Rank/<%Response.Write("" & strUserPlace & "")%>.jpg" alt=<%Response.Write("" & strUserPlace & "")%> title=<%Response.Write("" & strUserPlace & "")%> style="vertical-align: text-bottom"><%Response.Write("" & strUserPlace & "")%></td>
<td width="147" height="25" align="left" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom"><a href="#" onclick=javascript:window.open("userinfo.asp?UserName=<%=Server.URLEncode(strUserName)%>&UserScore=<%=strUserScore%>&UserKill=<%=strUserKills%>&UserTeamKill=<%=strUserTeamkills%>&UserDeaths=<%=strUserDeaths%>&UserHeadshots=<%=strUserHeadshots%>&UserAccuracy=<%=strUserAccuracy%>&UserPlace=<%=strUserPlace%>","","height=331,width=328,status=no,toolbar=no,menubar=no,location=no") class=mulu><%=strUserName%></a></td>
<td width="45" height="25" align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom"><% Response.Write (""&strUserScore&"")%></td>
<td width="44" height="25" align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom"><% Response.Write (""&strUserKills&"")%></td>
<td width="50" height="25" align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom"><% Response.Write (""&strUserTeamkills&"")%></td>
<td width="49" height="25" align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom"><% Response.Write (""&strUserDeaths&"")%></td>
<td width="49" height="25" align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom"><% Response.Write (""&strUserHits&"")%></td>
<td width="46" height="25" align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom"><% Response.Write (""&strUserShots&"")%></td>
<td width="47" height="25" align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom"><% Response.Write (""&strUserHeadshots&"")%></td>
<td width="46" height="25" align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom"><% Response.Write (""&strUserEfficiency&"%")%></td>
<td width="46" height="25" align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom"><% Response.Write (""&strUserAccuracy&"%")%></td>
<td width="50" height="25" align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom"><% Response.Write (""&strUserAccuracyHS&"%")%></td>
<td width="134" height="25" align="center" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" bordercolor="#000000" valign="bottom"><% Response.Write (""&strUserDate&"")%></td>
<td width="40" height="25"> </td>
<%
Response.Write "</tr>"

intCurrentRecord = intCurrentRecord + 1

Loop
%>
<tr>
<td colspan="16" background="forum_images/rank_images/Bottom.jpg" width="922" height="50" align="center">Powered by Http://www.dt-club.net
<%
strSQL = "SELECT COUNT(*) AS Record FROM " & strDbTable & "author;"
On Error Resume Next
rsCommon.Open strSQL, adoCon
EndTime=Timer

Response.Write ("页面执行时间【"&(EndTime-BeginTime)*1000&"毫秒】")
%>共计玩家【<b><%Response.Write rsCommon("Record")%></b>】个。<a href=default.asp class=mulu>【返回论坛】</a>
</td>
</tr>
</table>
</div>
<%
rsCommon.Close
%>

这个排行是按分数从高到低排列的,我想让他按照杀人数多少来排列!!请问怎么改??
发表于 2008-6-10 02:11:27 | 显示全部楼层 来自 中国–广东–东莞

回复: 懂asp的进来看看!!!

strSQL = "SELECT " & strDbTable & "author.Username," & strDbTable & "author.score," & strDbTable & "author.kills," & strDbTable & "author.teamkills," & strDbTable & "author.deaths," & strDbTable & "author.hits," & strDbTable & "author.shots," & strDbTable & "author.headshots," & strDbTable & "author.efficiency," & strDbTable & "author.accuracy," & strDbTable & "author.accuracyHS," & strDbTable & "author.date FROM " & strDbTable & "author ORDER by [color="Red"]score DESC LIMIT 0,50;"

改这个就可以了吧
回复

使用道具 举报

 楼主| 发表于 2008-6-10 13:12:08 | 显示全部楼层 来自 中国–广东–深圳–宝安区

回复: 懂asp的进来看看!!!

能帮我改一下吗?不知道改里面的哪一个代码
回复

使用道具 举报

 楼主| 发表于 2008-6-10 13:19:42 | 显示全部楼层 来自 中国–广东–深圳–宝安区

回复: 懂asp的进来看看!!!

搞定了,谢谢!! !!!!
回复

使用道具 举报

发表于 2008-6-10 14:27:21 | 显示全部楼层 来自 中国–广东–东莞

回复: 懂asp的进来看看!!!

把红色的改成kills
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表