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

📄 eachpart.asp

📁 不错的ASP整站源代码。在IIS环境下运行都没有问题
💻 ASP
字号:
<%
function strlen(str)
dim p_len,xx
p_len=0
strlen=0
if trim(str)<>"" then
p_len=len(trim(str))
for xx=1 to p_len
if asc(mid(str,xx,1))<0 then
strlen=int(strlen) + 2
else
strlen=int(strlen) + 1
end if
next
end if
end function

function strvalue(str,lennum)
dim p_num,x
dim i
if strlen(str)<=lennum then
strvalue=str
else
p_num=0
x=0
do while not p_num > lennum-2
x=x+1
if asc(mid(str,x,1))<0 then
p_num=int(p_num) + 2
else
p_num=int(p_num) + 1
end if
strvalue=left(trim(str),x)&"..."
loop
end if
end function

function showtips(article_type,max,title_len,show_type)
dim conn2,rs2
set conn2=server.createobject("adodb.connection")
DBPath = Server.MapPath("txt97.asp")
conn2.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
if show_type=1 then
   sql="SELECT articleid,title,user_id,name,dateandtime FROM learning where typeid="& article_type &" ORDER BY articleid DESC"
else
   sql="SELECT articleid,title,user_id,name,dateandtime FROM learning where typeid="& article_type &" ORDER BY hits DESC"
end if      
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn2,1,1
 if rs2.eof and rs2.bof then 
       response.write "<p align='center'> 还 没 有 任 何 文 章</p>" 
   else 
dim i
do while not rs2.eof%>
·<a href="javascript:popwin2(<%=rs2("articleid")%>)" title="<%=rs2("title")%>" class="a06"><%=strvalue(rs2("title"),title_len)%></a> <a href="../read.asp?user_id=<%=rs2("user_id")%>"><%=rs2("name")%></a>,<%=GetDate(rs2("dateandtime"))%><br>
<%i=i+1
	if i>max then exit do
	rs2.movenext
	loop
	end if
	rs2.close
	conn2.close
end function
%>                   

⌨️ 快捷键说明

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