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

注册

 

QQ登录

只需一步,快速开始

发新话题 回复该主题

【分享】如何在文章标题后加new [复制链接]

1#
        看到有人在问如何加new,想想自己也是从xiyou版主的帖子那学来的,何不借花献佛,分享一下?大致流程按以下图片顺序进行即可,具体代码可以搜一下xiyou大神的帖子,再次感谢xiyou的热心解答。









分享 转发
TOP
2#

谢谢楼主,弄好啦,可是为什么后面的日期没有啦
TOP
3#

是不是new图标和日期不能同时存在呀,还请楼主赐教,谢谢啦
TOP
4#

加在</a></span>的中间,不要放标签后面
TOP
5#

多谢版主,弄好啦
TOP
6#

其实我也不懂,还是xiyou大神厉害,谢谢又学到了。
TOP
7#

非常好!学习了!
TOP
8#

这个可以有!马上修改测试效果!
TOP
9#

我要试一下
TOP
10#

为什么我按照楼主所说的做了后刷新页面变成了
Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0103: The name 'newpic' does not exist in the current context

Source Error:


[No relevant source lines]

Source File:    Line: 0
TOP
11#

看看看
TOP
12#

能说得详细点吗
TOP
13#

shool 5应该改哪个表
TOP
14#

非常好,看起来醒目多了!
QQ截图20150206224041.jpg (, 下载次数:0)

(2015/2/6 22:43:09 上传)

QQ截图20150206224041.jpg

TOP
15#

学习了,效果很棒
TOP
16#

导航模型



[attachimg]12694[/attachimg]



<script Language="c#" Runat="server">

string newpic(DateTime D1)

     {

        string rv="";

        TimeSpan ts=DateTime.Now-D1;

        if(ts.Days<=3)  //如果是3天内发布就返回图片,这里可以自己修改

         {

           rv="<img src='/e/images/diy/new.gif' hspace=5>";

         }

        return rv;

     }

</script>




<ul class="fcxx">
<%
string Line;

DataTable dt=Get_Data();
DataRow dr;
for(int i=0;i<dt.Rows.Count;i++)
{
dr=dt.Rows;
if(((i+1)%5)==0)
{
  Line="<li class='line'></line>";
}
else
{
  Line="";
}
%>


<li><span class="title">



<a href="<%=Detail_Url(dr)%>" target="<%=Target%>" title="<%=Server.HtmlEncode
(dr["title"].ToString())%>style="<%=dr["title"]%>"><%=SubStr(dr["title"].ToString(),Title_Num,true)%>
</a>

</span>
<span class="date"><%=((DateTime)dr["thedate"]).ToString("yyyy-MM-dd")%></span>
<%=newpic((DateTime)dr["thedate"])%>

<span class="clear"></span>
</li>
<%
}
%>
</ul>
  以上是需要显示最新标志的栏目及代码所放的位置,咋没显示呢?求指教,谢谢!
TOP
发新话题 回复该主题