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

📄 f.asp

📁 程序介绍: 1、内嵌式投票系统
💻 ASP
字号:
<%
''''''''''''''''''''''''''''''''''''''''''''
'
'  TXSite / 通用网站系统
'
'  版本    :v1.8.20
'
'  制作人  :milp(milp@21cn.com)
'
'  版权所有:源码之家(http://www.21tx.com)
'
'  主页地址:http://www.21tx.com
'            http://www.bestnets.net
'            http://www.soucn.com
'
'  技术支持:http://www.21tx.com/bbs
'
''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
%>
<!--#include file="base.asp"-->
<%
dim search,forder,foption,spath
spath=""
search=Request("t")
foption=request("o")
forder=request("sort")
if isempty(forder) then forder="jd"
if isempty(foption) then foption=""
if foption="" then
   sql="select * from main where isUse"
elseif foption>0 and foption<100 then
   sql="select * from main where isUse and r = "&foption
   rSub.open "select * from type where r = "&foption,conn,1,1
   if rSub.bof and rSub.eof then
    spath=""
   else
    rSub.movefirst
    spath="<a href=f.asp?o="&foption&">"&rSub("rtype")&"</a>"
   end if
   rSub.close
elseif foption>100 and foption<1000 then
   sql="select * from main where isUse and m = "&foption-100
   rSub.open "select * from type where m = "&foption-100,conn,1,1
   if rSub.bof and rSub.eof then
    spath=""
   else
    rSub.movefirst
    spath="<a href=f.asp?o="&rSub("r")&">"&rSub("rtype")&"</a> >> <a href=f.asp?o="&foption&">"&rSub("mtype")&"</a>"
   end if
   rSub.close
elseif foption>1000 then
   sql="select * from main where isUse and s = "&foption-1000
   rSub.open "select * from type where s = "&foption-1000,conn,1,1
   if rSub.bof and rSub.eof then
    spath=""
   else
    rSub.movefirst
    spath="<a href=f.asp?o="&rSub("r")&">"&rSub("rtype")&"</a> >> <a href=f.asp?o="&rSub("m")+100&">"&rSub("mtype")&"</a> >> <a href=f.asp?o="&foption&">"&rSub("stype")&"</a>"
   end if
   rSub.close
end if
sql=sql&" and (name like '%"&search&"%' or content like '%"&search&"%')"

response.write filesArr(6)
%>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=754>
<TBODY>
<TR>
<TD height=5 width="100%"></TD></TR></TBODY></TABLE>
<table border=0 cellpadding=0 cellspacing=0 width=754>
<tbody>
<tr>
<td width="2%" bgcolor="#99ccff" valign="top"><img src="images/jiao.gif" width="8" height="8"></td>
<td width="18%" bgcolor="#99ccff" valign="middle" height=100>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height=30><font color=#ff0000><span class=F7>●</span></font> <font color=green>最近更新</font></td>
</tr>
<tr>
<td>
<%
rSub.open "select top 18 id,name,addate,click from main where isUse order by id desc",conn,1,1
do while not rSub.eof
response.write "<a class=blanklink href=""show.asp?id="&rSub("id")&""" title="""&rSub("name")&" 更新日期:"&FormatDateTime(rSub("addate"),1)&""">"
if len(rSub("name"))<8 then
response.write rSub("name")&"</a><font color=red>["&rSub("click")&"]</font><BR>"
else
response.write LeftTrue(rSub("name"),16)&"</a><font color=red>["&rSub("click")&"]</font><BR>"
end if
rSub.movenext
loop
rSub.close
%>
<br></td></tr></table>


</td>
<td width="80%" valign="top" align="right">

<table border="0" cellpadding="0" cellspacing="0" width="100%" height="143">
<tr><td width="100%" height="119" valign="top">
<%
const MaxPerPage=10
dim totalPut
dim CurrentPage 
dim TotalPages 
dim i,j 
if not isempty(request("p")) then
   currentPage=cint(request("p"))
else
   currentPage=1
end if
Select case forder
 case "sd"
 sql=sql & " Order by addate asc"
 case "ss"
 sql=sql & " Order by size asc"
 case "sc"
 sql=sql & " Order by click asc"
 case "sn"
 sql=sql & " Order by name asc"

 case "jd"
 sql=sql & " Order by addate desc"
 case "js"
 sql=sql & " Order by size desc"
 case "jc"
 sql=sql & " Order by click desc"
 case "jn"
 sql=sql & " Order by name desc"
 case else sql=sql & " Order by addate desc"
End Select
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 
  end if 
  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,"f.asp"
showContent 
showpage totalput,MaxPerPage,"f.asp" 
 
else 
  if (currentPage-1)*MaxPerPage<totalPut then 
    rs.move  (currentPage-1)*MaxPerPage 
    dim bookmark 
    bookmark=rs.bookmark
    showpage totalput,MaxPerPage,"f.asp"   
    showContent 
    showpage totalput,MaxPerPage,"f.asp" 
  else 
    currentPage=1  
    showpage totalput,MaxPerPage,"f.asp" 
    showContent 
    showpage totalput,MaxPerPage,"f.asp" 
  end if 
end if

end if 
rs.close 
%>

</td></tr></table>

</td>
</tr>
<TR><TD colspan=4 height=6 align=center><IMG border=0 height=1 src=images/line.gif width=700></TD></TR>
</tbody>
</table>
<br>
<%response.write filesArr(8)  '调用通用页面底部文件%>
<table width="754" border="0" cellspacing="0" cellpadding="0">
<TR><td align="center"><%=bottomadv%></TD></TR>
<tr><td align=center><script language=javascript src="count.asp?s=1&id=2"></script></td></tr></table></body></html>
<%Call objend()


function showpage(totalnumber,maxperpage,filename)
  dim n
  if totalnumber mod maxperpage=0 then
     n= totalnumber \ maxperpage
  else
     n= totalnumber \ maxperpage+1
  end if
Response.Write "<div align=center><table border=0 cellpadding=0 cellspacing=0 width=90% height=21><form method=post action=f.asp?t="&search&"&o="&foption&"&sort="&forder&"><tr><td width=60% height=21 valign=middle align=left>"
if spath<>"" then response.write spath
if search<>"" then Response.Write " 关键字 <font color=red><b>"&request("t")&"</b></font> 找到"
Response.Write " <font color=#008000><b>"&totalnumber&"</b></font>个 <font color=#008000><b>10</b></font>个/页"
Response.Write " <font color=#008000><b>"&currentpage&"</b></font>/<font color=#008000><b>"&n&"</b></font>页</td><td width=40% height=21 valign=middle align=right>"
  if CurrentPage<2 then 
    response.write "<font color=#cecfce>首页</font></a> "
    response.write "<font color=#cecfce>上页</font></a> "
  else  
    response.write "<a href=f.asp?p=1&o="&foption&"&t="&search&"&sort="&forder&">首页</a> "
    response.write "<a href=f.asp?p="&CurrentPage-1&"&o="&foption&"&t="&search&"&sort="&forder&">上页</a> "
  end if 
  if n-currentpage<1 then  
    response.write "<font color=#cecfce>下页</font></a> "
    response.write "<font color=#cecrce>尾页</font></a> "
  else
    response.write "<a href=f.asp?p="&CurrentPage+1&"&o="&foption&"&t="&search&"&sort="&forder&">下页</a> "    
    response.write "<a href=f.asp?p="&n&"&o="&foption&"&t="&search&"&sort="&forder&">尾页</a> "
  end if
response.write "转到:<INPUT class=buttonface maxLength=10 name=p size=2 value="&CurrentPage&">"
response.Write "<INPUT class=itm type=submit value=Go>"
response.Write "</td></tr></form></table></div>" 
end function 
%>


<%
sub showContent 
dim i 
i=0
%>
<div align="center"><center><table border="0" cellpadding="0" cellspacing="0" width="90%" height="16">
<tr><td width="68%">标 题 (红色箭头为当前排序方式)<a
class=p title="按标题升序排列" <%if forder="sn" then%> style="color:red"<%end if%> href=f.asp?o=<%=foption%>&t=<%=search%>&sort=sn>↑</a><a
class=p title="按标题降序排列" <%if forder="jn" then%> style="color:red"<%end if%> href=f.asp?o=<%=foption%>&t=<%=search%>&sort=jn>↓</a>
</td>
<td width="12%">时间<a
class=p title="按时间升序排列" <%if forder="sd" then%> style="color:red"<%end if%> href=f.asp?o=<%=foption%>&t=<%=search%>&sort=sd>↑</a><a
class=p title="按时间降序排列" <%if forder="jd" then%> style="color:red"<%end if%> href=f.asp?o=<%=foption%>&t=<%=search%>&sort=jd>↓</a>
</td>   
<td width="10%" align=right>点击<a
class=p title="按点击升序排列" <%if forder="sc" then%> style="color:red"<%end if%> href=f.asp?o=<%=foption%>&t=<%=search%>&sort=sc>↑</a><a
class=p title="按点击降序排列" <%if forder="jc" then%> style="color:red"<%end if%> href=f.asp?o=<%=foption%>&t=<%=search%>&sort=jc>↓</a>
</td></tr></table></center></div>  

<div align="center"> 
<center> 
<table border="0" cellpadding="0" cellspacing="0" width="90%" height="37"> 
<%
dim sname
do while not rs.EOF
if search="" then
 sname=rs("name")
else
 sname=Replace(rs("name"),search,"<font color=red><b>"&search&"</b></font>",1,-1,1)
end if
%>
<tr> 
<td width="68%" height="23">
<a href="show.asp?id=<%=rs("id")%>"><%=MaxPerPage*(CurrentPage-1)+i+1&"."&sname%></a>
</td> 
<td width="12%" height="23"><%=formatdatetime(rs("addate"),2)%></td> 
<td width="10%" height="23" align=center><%=rs("click")%></td> 
</tr> 
<%i=i+1
if i>=MaxPerPage then exit do  
rs.MoveNext
loop%>
  </table></center></div> 
<%end sub

Function LeftTrue(str,n)
If len(str)<=n/2 Then
LeftTrue=str
Else
Dim TStr
Dim l,t,c
Dim i
l=len(str)
t=l
TStr=""
t=0
for i=1 to l
c=asc(mid(str,i,1))
If c<0 then c=c+65536
If c>255 then
t=t+2
Else
t=t+1
End If
If t>n Then exit for
TStr=TStr&(mid(str,i,1))
next
LeftTrue = TStr
End If

End Function
%>

⌨️ 快捷键说明

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