⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 moresmusic.asp

📁 疯狂DJ联盟-v2.0 1.修改了V1.0的几个错误. 2.首页生成HTM 大大加快了访问速度 3.歌曲播放页面全部调用HTM播放器.减轻了服务器的负担. 4.增加了站内统计,全部访问次数
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="style.asp"-->
<%
PageName=request("PageName")
Classid=request("Classid")
SpecialID=request("SpecialID")
const MaxPerPage=15 '分页显示的纪录个数
const PageUrl="MoreSMusic.asp"
if not isempty(request("page")) then
	currentPage=cint(request("page"))
	thispage=currentpage
else
	currentPage=1
	thispage=currentpage
end if
%>
<html>
<head>
<META http-equiv="refresh" content="30">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=WebTitle%></title>
<script>
function open_window(url,windowname,size) 
{ 
window.open(url,windowname,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=10,left=10,"+ size); 
}
 
function CheckOthers(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
//		if (e.name != 'chkall')
			if (e.checked==false)
			{
				e.checked = true;// form.chkall.checked;
			}
			else
			{
				e.checked = false;
			}
	}
}

function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
//		if (e.name != 'chkall')
			e.checked = true// form.chkall.checked;
	}
}
</script>
</head>

<body topmargin="0" leftmargin="0" bgcolor="black">
<br>
<table width="773" border="0" align=center cellpadding="0" cellspacing="0" bgcolor="#30393D" >
  <tr>
    <td width="100%" height=20 align="center">用户点歌</td>
  </tr>
  <tr>
    <td>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from SendMusic order by id desc;"

rs.open sql,conn,1,1
if rs.eof and rs.bof then 
	response.write "<p align='center'>暂 时 没 有 点 歌</p>" 
else 
	totalPut=rs.recordcount 
	if currentpage<1 then currentpage=1 
	if (currentpage-1)*MaxPerPage>totalput then 
		if (totalPut mod MaxPerPage)=0 then 
			currentpage= totalPut \ MaxPerPage
		else 
			currentpage= totalPut \ MaxPerPage + 1 
		end if 
	end if 
	if currentPage=1 then 
		showpage totalput,MaxPerPage,PageUrl 
		showContent 
		showpage totalput,MaxPerPage,PageUrl
	else 
		if (currentPage-1)*MaxPerPage<totalPut then 
			rs.move  (currentPage-1)*MaxPerPage
			dim bookmark 
			bookmark=rs.bookmark 
			showpage totalput,MaxPerPage,PageUrl
			showContent 
			showpage totalput,MaxPerPage,PageUrl
		else 
			currentPage=1 
			showpage totalput,MaxPerPage,PageUrl
			showContent 
			showpage totalput,MaxPerPage,PageUrl
		end if 
	end if 
end if 
rs.close
set rs=nothing  
Conn.close
set Conn=nothing  
%>
<%Sub ShowContent%>
<table width="755" cellpadding="0" cellspacing="1" bgcolor="#2E5667">
  <tr>
    <td width="15%" align="center" bgcolor="#30393D">点歌人</td>
    <td width="15%" align="center" bgcolor="#30393D">点歌给</td>
    <td width="15%" align="center" bgcolor="#30393D">所点的歌曲</td>
    <td width="40%" align="center" bgcolor="#30393D">祝福</td>
    <td width="15%" align="center" bgcolor="#30393D">点歌时间</td>
  </tr>
<%
i=0
Do While Not rs.EOF
    i=i+1
%>
  <tr>
    <td width="15%" align="center" bgcolor="#30393D"><% =rs("FromUser")%></td>
    <td width="15%" align="center" bgcolor="#30393D"><% =rs("ForUser")%></td>
    <td width="15%" align="center" bgcolor="#30393D"><a href="javascript:open_window('song.asp?id=<%=rs("Musicid")%>','Listen','width=280,height=360')"><% =rs("MusicName")%></td>
    <td width="40%" bgcolor="#30393D"><% =rs("Words")%></td>
    <td width="15%" align="center" bgcolor="#30393D"><%=DateValue(rs("DateAndTime"))%></td>
  </tr>
<%
	if i>=MaxPerPage then exit do '循环时如果到尾部则先退出,如果记录达到页最大显示数,也退出
rs.movenext
loop
%>
</table>
<%End Sub

function showpage(totalnumber,MaxPerPage,filename)
if totalnumber mod MaxPerPage=0 then
	n= totalnumber \ MaxPerPage
else
	n= totalnumber \ MaxPerPage+1
end if
%>
<table border="0" width="755" cellspacing="0" cellpadding="0" bgcolor="<%=MainCColor%>">
  <tr>
    <td>
      <form method=Post action="<%=filename%>?classid=<%=classid%>" id=form1 name=form1>
        <center>共<font color="<%=AlertFColor%>"><b><%=totalnumber%></b></font>个评论
<%if CurrentPage<2 then%>
        &nbsp;首页 上一页&nbsp;
<%else%>
        &nbsp<a href="<%=filename%>?page=1&classid=<%=classid%>">首页</a>&nbsp;
        <a href="<%=filename%>?page=<%=CurrentPage-1%>&classid=<%=classid%>">上一页</a>&nbsp;
<%
end if
if n-currentpage<1 then
%>
        下一页 末页
<%else%>
        <a href="<%=filename%>?page=<%=CurrentPage+1%>&classid=<%=classid%>">下一页</a>
        <a href="<%=filename%>?page=<%=n%>&classid=<%=classid%>">末页</a>
<%end if%>
        &nbsp;页次:<strong><font color="<%=AlertFColor%>"><%=CurrentPage%>/<%=n%></font></strong>页
        转到:<select name="page" size="1" onchange="javascript:submit()">
<%for i = 1 to n%>           
        <option value="<%=i%>" <%if cint(CurrentPage)=cint(i) then%> selected <%end if%>>第<%=i%>页</option>   
<%next%>   
        </select>        
      </form>
    </td>
  </tr>
</table>
<% 
end function
%>
    </td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -