📄 lycx.asp
字号:
} else {
window.captureEvents(Event.MOUSEMOVE);
if(checkFocus (e.pageX,e.pageY)) {
whichIt = document.floater;
StalkerTouchedX = e.pageX-document.floater.pageX;
StalkerTouchedY = e.pageY-document.floater.pageY;
} }
return true;
}
function moveIt(e) {
if (whichIt == null) { return false; }
if(IE) {
newX = (event.clientX + document.body.scrollLeft);
newY = (event.clientY + document.body.scrollTop);
distanceX = (newX - currentX); distanceY = (newY - currentY); currentX = newX; currentY = newY;
whichIt.style.pixelLeft += distanceX; whichIt.style.pixelTop += distanceY;
if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop; if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;
if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;
if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
event.returnValue = false;
} else {
whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);
if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;
if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;
if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;
if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
return false;
}
return false;
}
function dropIt() {
whichIt = null;
if(NS) window.releaseEvents (Event.MOUSEMOVE);
return true;
}
<!-- DRAG DROP CODE -->
if(NS) {
window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
window.onmousedown = grabIt;
window.onmousemove = moveIt;
window.onmouseup = dropIt;
}
if(IE) {
document.onmousedown = grabIt;
document.onmousemove = moveIt;
document.onmouseup = dropIt;
}
if(NS || IE) action = window.setInterval("heartBeat()",1);
</script>
</div>
<%
lycx=request("lycx")
set rs=server.createobject("adodb.recordset")
sql="select * from book where xm like '%" & lycx & "%' or nr like '%" & lycx & "%' order by id desc"
rs.open sql,conn,1,1
const MaxPerPage=10
page=request("page")
if page<>empty and page<>"" then
'检测输入页数是否合法
pagestrlong=len(page)
chOK="0123456789"
chvalid=true
j=1
do while j<=pagestrlong
ch=mid(page,j,1)
If instr(chOK,ch)=0 then
chvalid=false
exit do
end if
j=j+1
loop
'检测完毕
if not chvalid then '如果不合法
currentPage=1 '默认为第1页
else
currentPage=int(page) '如果合法则取整数
if currentpage=0 then '如果是0页取1
currentpage=1
end if
end if
else
currentPage=1 '如果空白测取第1页
end if
if rs.eof and rs.bof then
response.write "<center>没有记录</center>"
showpages
else
totalPut=rs.recordcount '记录总数
'判断最大显示页数
if totalput<=maxperpage then
maxpagenum=1
else
pageys=totalput/maxperpage
if pageys > int(pageys) then
maxpagenum=int(pageys)+1
else
maxpagenum=int(pageys)
end if
end if
if currentPage=1 then
showContent
showpages
else
if (currentPage-1)*MaxPerPage>=totalPut then
currentPage=maxpagenum
end if
rs.move (currentPage-1)*MaxPerPage
showContent
showpages
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
%>
<script language="javascript">
function popwin(id)
{window.open("showimg.asp?id="+id,"","top=2,left=2,height=440,width=580,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>
<table width=450 border=0>
<tr>
<td width=100% align=right valign=top>
<%
i=1
do while not (rs.eof or err)
if rs("xm")<>"" then
xm=replace(replace(replace(replace(replace(replace(replace(rs("xm"),"&","&"),"<","<"),">",">"),chr(13),"<br>"),chr(34),"""),chr(32)," "),lycx,"<font color=red>"&lycx&"</font>")
else
xm=""
end if
xb=rs("xb")
if rs("size")>0 then
txstr="<a href='javascript:popwin("&rs("id")&");'>图像</a>"
else
txstr="<font color=#bbbbbb>图像</font>"
end if
if rs("xx")="" then
xxstr="<font color=#bbbbbb>信箱</font>"
else
xxstr="<a href='mailto:"&rs("xx")&"'>信箱</a>"
end if
if rs("zy")="" or trim(rs("zy"))="http://" then
zystr="<font color=#bbbbbb>主页</font>"
else
zystr="<a href='"&rs("zy")&"' target='_blank'>主页</a>"
end if
if rs("nr")<>"" then
nr=replace(replace(replace(replace(replace(replace(replace(rs("nr"),"&","&"),"<","<"),">",">"),chr(13),"<br>"),chr(34),"""),chr(32)," "),lycx,"<font color=red>"&lycx&"</font>")
else
nr=""
end if
sj=rs("sj")
if rs("hf")<>"" then
hf=replace(replace(replace(replace(replace(replace(replace(rs("hf"),"&","&"),"<","<"),">",">"),chr(13),"<br>"),chr(34),"""),chr(32)," "),lycx,"<font color=red>"&lycx&"</font>")
else
hf=""
end if
hfsj=rs("hfsj")
ip=rs("ip")
Response.Write "<table width=400 cellspacing=1 bgcolor=#FFCB7D cellpadding=5>"
Response.Write "<tr><td width=30% bgcolor=#FFF1DD align=right>"&xm&"("&xb&") </td>"
Response.Write "<td width=30% bgcolor=#FFF1DD align=right><font color=#bbbbbb>"&txstr&"</font> <font color=#bbbbbb>"&xxstr&"</font> <font color=#bbbbbb>"&zystr&"</font></td>"
Response.Write "<td width=40% bgcolor=#FFF1DD align=right>"&sj&"</td></tr>"
Response.Write "<tr><td width=100% colspan=3 bgcolor=#ffffff><blockquote>"&nr&"<br></td></tr>"
if rs("hf")<>"" then
Response.Write "<tr><td width=100% colspan=3 bgcolor=#ffffff><font color=#ACACAC><blockquote>" & hf & "<br>" & hfsj & "</font><br></td></tr>"
end if
Response.Write "</table><br><br>"
i=i+1
if i>MaxPerPage then exit do '循环时如果到尾部则先退出,如果记录达到页最大显示数,也退出
rs.movenext
loop
%>
</td>
</tr>
</table>
<%
end sub
sub showpages()
%>
<form Action="lycx.asp?lycx=<%=lycx%>" Method="GET">
<center>
<table width="600" border=0 cellspacing="1" bgcolor="#006633">
<tr bgcolor="#FFFFFF">
<td width="100%">
<center>
<%
If currentPage <> 1 Then
Response.Write "|<a href=lycx.asp?lycx="&lycx&">第一页</a>"
Response.Write "|<a href=lycx.asp?Page=" & (currentPage-1) & "&lycx="&lycx&">上一页</a>"
else
Response.Write "|第一页"
Response.Write "|上一页"
End If
If currentPage <> maxpagenum Then
Response.Write "|<a href=lycx.asp?Page=" & (currentPage+1) & "&lycx="&lycx&">下一页</a>"
Response.Write "|<a href=lycx.asp?Page=" & maxpagenum & "&lycx="&lycx&">最后一页</a>|"
else
Response.Write "|下一页"
Response.Write "|最后一页|"
End If
Response.Write "进入第<input type=text name=page size=3>页|"
Response.Write "总记录数<font color=red>"&totalPut&"</font>|"
Response.Write "每页显示<font color=red>"&MaxPerPage&"</font>|"
Response.Write "当前页数<font color=red>"¤tPage&"</font>/<font color=red>"&maxpagenum&"</font>|"
Response.Write "<a href=../>返回主页</a>|"
%>
</center>
</td>
</tr>
</table></center>
</form>
<%
end sub
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -