最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php+js实现新浪滑门效果代码
时间:2008-02-28 编辑:简简单单 来源:一聚教程网
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml">
<%
function InterceptString(txt,length)'根据中英文字符不同来截取字符
txt=trim(txt)
x = len(txt)
y = 0
if x >= 1 then
for ii = 1 to x
if asc(mid(txt,ii,1)) < 0 or asc(mid(txt,ii,1)) >255 then '如果是汉字
y = y + 2
else
y = y + 1
end if
if y >= length then
txt = left(trim(txt),ii) '字符串限长
exit for
end if
next
InterceptString = txt
else
InterceptString = ""
end if
End Function
dim
conn,rs1,type1,MM_conn_STRING,rs2,type2,SQL1,SQL2,SQL3,SQL4,SQL5,rs3,rs4,rs5,type3,type4,t
ype5
MM_conn_STRING = "Driver={SQL
Server};database=sanxt;server=localhost;uid=sanxt;pwd=sanxt;"
Set conn = Server.Createobject("ADODB.Connection")
conn.open MM_conn_STRING
Set rs1=Server.CreateObject("ADODB.recordset")
type1="艺术资讯"
SQL1="SELECT top 7 id,caption,content,puttime FROM ccnews where classid='"&Trim(type1)&"'
order by id desc"
rs1.open SQL1,conn,1,3
%>
<%
do while not rs1.eof
%>
· "target=_blank><%=InterceptString(rs1("caption")&"..........................................",48)%
>
<%=FormatDateTime(rs1("puttime"),"2")%>
<%rs1.movenext
loop
%> <%- <%
Set rs2=Server.CreateObject("ADODB.recordset")
type2="藏家交流"
SQL2="SELECT top 7 id,caption,content,puttime FROM ccnews where classid='"&Trim(type2)&"' order by id desc"
rs2.open SQL2,conn,1,3
do while not rs2.eof %>·"target=_blank><%=InterceptString(rs2("caption")
&"..........................................",48)%> <%
=FormatDateTime(rs2("puttime"),"2")%>
<%rs2.movenext
loop%> - <%
Set rs3=Server.CreateObject("ADODB.recordset")
type3="考古发现"
SQL3="SELECT top 7 id,caption,content,puttime FROM ccnews where classid='"&Trim(type3)&"' order by id desc"
rs3.open SQL3,conn,1,3
do while not rs3.eof %>·"target=_blank><%=InterceptString(rs3("caption")
&"..........................................",48)%> <%
=FormatDateTime(rs3("puttime"),"2")%>
<%rs3.movenext
loop%> - <%
Set rs4=Server.CreateObject("ADODB.recordset")
type4="网站公告"
SQL4="SELECT top 7 id,caption,content,puttime FROM ccnews where classid='"&Trim(type4)&"' order by id desc"
rs4.open SQL4,conn,1,3
do while not rs4.eof %>·"target=_blank><%=InterceptString(rs4("caption")
&"..........................................",48)%> <%
=FormatDateTime(rs4("puttime"),"2")%>
<%rs4.movenext
loop%> - <%
Set rs5=Server.CreateObject("ADODB.recordset")
type5="专题新闻"
SQL5="SELECT top 7 id,caption,content,puttime FROM ccnews where classid='"&Trim(type5)&"' order by id desc"
rs5.open SQL5,conn,1,3
do while not rs5.eof %>·"target=_blank><%=InterceptString(rs5("caption")
&"..........................................",48)%> <%
=FormatDateTime(rs5("puttime"),"2")%>
<%rs5.movenext
loop%>
rs1.close
set rs1=nothing
%>
<%rs2.close
set rs2=nothing
%>
<%rs3.close
set rs3=nothing
%>
<%rs4.close
set rs4=nothing
%>
<%rs5.close
set rs5=nothing
%>
-
上一个: web编辑器基础模型
-
下一个: 按钮加背景图片
相关文章
- HTML简单购物数量小程序代码展示 10-31
- html canvas实现弹幕功能 10-31
- HTML中空格表示的意义 10-31
- html area标签解读 10-31
- html使用表单标签实现注册页面代码展示 10-31
- 使用HTML截图并保存为本地图片的代码展示 10-31