PageAdmin网站内容管理系统(CMS)交流论坛

注册

 

QQ登录

只需一步,快速开始

发新话题 回复该主题

如何在文章列表后添加NEW?? [复制链接]

1#

http://bbs.pageadmin.net/showtopic-35851.aspx
你可以看一下,和你要的效果差不多
分享 转发
TOP
2#

  1. <style>
  2. .hh_article{clear:both;} /*文章带置顶样式*/
  3. .hh_article li.tw{text-align:left;border:1px dotted #cccccc;border-width:0 0 1px 0;padding:5px 0 5px 0;overflow:hidden;} /*置顶通用样式*/
  4. .hh_article .tw .pic{float:left;margin:5px 10px 5px 0;border:1px solid #dddddd;display:inline}
  5. .hh_article .tw .title{text-align:left;line-height:25px;}
  6. .hh_article .tw .title a{font-weight:bold;padding-left:0px;font-size:14px;color: #cc0000}
  7. .hh_article .tw .introduct{padding:2px 5px 5px 0px;line-height:20px;color: #666666;}
  8. .hh_article .tw .pixc{float:right;width:30px;height:30px;border:1px solid #000}
  9. .hh_article li.normal{clear:both;height:40px;line-height:40px;text-align:left;overflow:hidden;}
  10. .hh_article .normal .title{float:left;text-align:left;padding:0 0 0 10px;background:url(images/article_arrow.gif) no-repeat left center;}
  11. .hh_article .normal .date{float:right;color: #666666;padding-right:2px}
  12. </style>




  13. <div class="hh_article">
  14. <ul>
  15. <%
  16. string pic="/e/images/diy/toip.jpg",istop="0";
  17. DataTable dt;
  18. DataRow dr;
  19. dt=Get_Data();
  20. for(int i=0;i<dt.Rows.Count;i++)
  21. {
  22. dr=dt.Rows[i];
  23. pic=dr["titlepic"].ToString();
  24. istop=dr["istop"].ToString();
  25. %>
  26. <%if(istop=="1"){%>
  27. <li class="tw">
  28. <span class="title"><a href="<%=Detail_Url(dr)%>" target="<%=Target%>" title="<%=Server.HtmlEncode(dr["title"].ToString())%>" style="<%=dr["pa_style"]%>"><%=SubStr(dr["title"].ToString(),Title_Num,true)%></a></span><span><%=((DateTime)dr["thedate"]).ToString("yyyy-MM-dd")%></span><a href=""><img src="<%=pic%>" class="pixc"></a>
  29. </li>
  30. <%}
  31. else
  32. {%>
  33. <li class="normal"><span class="title">
  34. <a href="<%=Detail_Url(dr)%>" target="<%=Target%>" title="<%=Server.HtmlEncode(dr["title"].ToString())%>" style="<%=dr["pa_style"]%>"><%=SubStr(dr["title"].ToString(),Title_Num,true)%></a></span>
  35. <span class="date"><%=((DateTime)dr["thedate"]).ToString("MM-dd")%></span>
  36. <span class="clear"></span>
  37. </li>
  38. <%
  39. }
  40. }
  41. %>
  42. </ul></div>
复制代码

这一块放在css文件中,

这一块在表单模型中的文章资讯的模型管理中,新建一个数据模型,粘贴到里面,

这个你可以替换你想要的图片路径,

置顶是istop,最新是isnew,推荐是isgood,热门是ishot
TOP
3#

comm.css文件中
TOP
发新话题 回复该主题