asp 代码修改 把列表右边的时间换成作者

作者字段是author<%CallShowArticle(Noticid,NoticNum,5,"·",100,"no","IDdesc",0,1)%>'文章调用'Cla... 作者字段是 author

<%Call ShowArticle(Noticid,NoticNum,5,"·",100,"no","ID desc",0,1)%>

'文章调用
'ClassID:数值型,栏目ID
'N:数值型,要显示文章条数
'T:数值型,显示时间,0为不显示,否则为时间格式
'ICO:字符型,标题前图标,可以图片也可为字符
'Z:标题字数
'msql:增强条件
'P:排序方式
'ClassName 数值型,1为显示栏目名称,0为不显示
'target 数值型,1为在新窗口打开

Sub ShowArticle(ClassID,N,T,ICO,Z,msql,P,ClassName,target)
set rs1=server.createobject("ADODB.Recordset")
SQL1="select Top "&N&" ID,Title,ClassID,DateAndTime,TitleFontColor,IsHot from "&tbname&"_Article where yn = 0"

If ClassID<>0 then
If Yao_MyID(ClassID)="0" then
SQL1=SQL1&" and ClassID="&ClassID&""
else
MyID = Replace(""&Yao_MyID(ClassID)&"","|",",")
SQL1=SQL1&" and ClassID in ("&MyID&")"
End if
End if

If msql<>"no" then
SQL1=SQL1&" and "&msql&""
End if

SQL1=SQL1&" Order by "&P&""

rs1.open sql1,conn,1,3
If Not rs1.Eof Then
do while not (rs1.eof or err)
Response.Write("<li>")
If T<>0 then
Response.Write("<span style=""float:right;"">"&FormatDate(rs1(3),T)&"</span>")
end if
If ClassName=1 then
If Html=3 then
Response.Write("[<a href="""&SitePath&"Class_"&rs1(2)&".html"">"&Classlist(rs1(2))&"</a>]")
Else
Response.Write("[<a href="""&SitePath&"Class.asp?ID="&rs1(2)&""">"&Classlist(rs1(2))&"</a>]")
End if
End if
Response.Write(""&ICO&"<a href=""")
If Html=1 then
Response.Write(""&SitePath&"List.asp?ID="&rs1(0)&"""")
elseif Html=2 then
Response.Write(""&SitePath&"Html/?"&rs1(0)&".html""")
elseif Html=3 then
Response.Write(""&SitePath&"Html/"&rs1(0)&".html""")
end if
If target=1 then
Response.Write(" target=""_blank""")
End if
Response.Write(" >")
If rs1(4)<>"" then
Response.Write("<font style=""color:"&rs1(4)&""">"&left(rs1(1),Z)&"</font></a>")
else
Response.Write(""&left(rs1(1),Z)&"</a>")
end if
Response.Write("</li>") & VbCrLf
rs1.movenext
loop
else
Response.Write("<li>没有</li>")
end if
rs1.close
set rs1=nothing
End Sub
展开
 我来答
透彻还清心的繁花G
2010-07-14 · TA获得超过3774个赞
知道小有建树答主
回答量:1674
采纳率:33%
帮助的人:817万
展开全部
<%Call ShowArticle(Noticid,NoticNum,5,"·",100,"no","ID desc",0,1)%>

'文章调用
'ClassID:数值型,栏目ID
'N:数值型,要显示文章条数
'T:数值型,显示时间,0为不显示,否则为时间格式
'ICO:字符型,标题前图标,可以图片也可为字符
'Z:标题字数
'msql:增强条件
'P:排序方式
'ClassName 数值型,1为显示栏目名称,0为不显示
'target 数值型,1为在新窗口打开

Sub ShowArticle(ClassID,N,T,ICO,Z,msql,P,ClassName,target)
set rs1=server.createobject("ADODB.Recordset")
SQL1="select Top "&N&" ID,Title,ClassID,author,TitleFontColor,IsHot from "&tbname&"_Article where yn = 0"

If ClassID<>0 then
If Yao_MyID(ClassID)="0" then
SQL1=SQL1&" and ClassID="&ClassID&""
else
MyID = Replace(""&Yao_MyID(ClassID)&"","|",",")
SQL1=SQL1&" and ClassID in ("&MyID&")"
End if
End if

If msql<>"no" then
SQL1=SQL1&" and "&msql&""
End if

SQL1=SQL1&" Order by "&P&""

rs1.open sql1,conn,1,3
If Not rs1.Eof Then
do while not (rs1.eof or err)
Response.Write("<li>")
Response.Write("<span style=""float:right;"">"&rs1(3)&"</span>")

If ClassName=1 then
If Html=3 then
Response.Write("[<a href="""&SitePath&"Class_"&rs1(2)&".html"">"&Classlist(rs1(2))&"</a>]")
Else
Response.Write("[<a href="""&SitePath&"Class.asp?ID="&rs1(2)&""">"&Classlist(rs1(2))&"</a>]")
End if
End if
Response.Write(""&ICO&"<a href=""")
If Html=1 then
Response.Write(""&SitePath&"List.asp?ID="&rs1(0)&"""")
elseif Html=2 then
Response.Write(""&SitePath&"Html/?"&rs1(0)&".html""")
elseif Html=3 then
Response.Write(""&SitePath&"Html/"&rs1(0)&".html""")
end if
If target=1 then
Response.Write(" target=""_blank""")
End if
Response.Write(" >")
If rs1(4)<>"" then
Response.Write("<font style=""color:"&rs1(4)&""">"&left(rs1(1),Z)&"</font></a>")
else
Response.Write(""&left(rs1(1),Z)&"</a>")
end if
Response.Write("</li>") & VbCrLf
rs1.movenext
loop
else
Response.Write("<li>没有</li>")
end if
rs1.close
set rs1=nothing
End Sub
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式