回复 2楼xiyou的帖子<script Language="c#" Runat="server">
string newpic(DateTime D1)
{
string rv="";
TimeSpan ts=DateTime.Now-D1;
if(ts.Days<=1) //如果是3天内发布就返回图片,这里可以自己修改
{
rv="<img src='../e/images/diy/new.gif' hspace=1>";
}
return rv;
}
</script>
<div class="article">
<ul>
<%
DataTable dt;
DataRow dr;
dt=Get_Data();
for(int i=0;i<dt.Rows.Count;i++)
{
dr=dt.Rows
;
%>
<li><span class="title">
<a href="<%=Detail_Url(dr)%>" target="<%=Target%>" title="<%=Server.HtmlEncode(dr["title"].ToString())%>"><%=SubStr(dr
["title"].ToString(),Title_Num,true)%></a></span>
<%=newpic((DateTime)dr["thedate"])%>
<span class="date"><%=((DateTime)dr["thedate"]).ToString("MM-dd")%></span>
</li>
<%
}
%>
</ul></div>