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 展开
<%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 展开
1个回答
展开全部
<%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
'文章调用
'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
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询