ASP代码修改:新闻首页标题字数显示问题。

目前标题字数限制为38字符,即19个汉字。要求修改为:一、当日新闻发布后,标题后会出来一个“NEW”图片,此时要求标题为38字符。二、但是如果不是当天的新闻,标题字数显示... 目前标题字数限制为38字符,即19个汉字。要求修改为:
一、当日新闻发布后,标题后会出来一个“NEW”图片,此时要求标题为38字符。
二、但是如果不是当天的新闻,标题字数显示为44字符。
原代码如下:
<li>
<span><font color="#e63030">(<%=rs3("click")%>)</font><%=datetime%></span>·<a href="<%if rs3("titleface")="无" then %><%=newsurl%><% else %> <%=newswwwurl%><%end if%>" title="<%=htmlencode4(rs3("title"))%>" target="_blank"> <font color="<%=rs3("titlecolor")%>"> <%=CutStr(htmlencode4(rs3("title")),38)%> </font> </a>
<%if year(rs3("updatetime"))=year(date()) and month(rs3("updatetime"))=month(date()) and day(rs3("updatetime"))=day(date()) then%>
<img src="images/new.gif">
<%end if%>
<!--标题后评论提示-->
<% if rs3("titlesize")>=1 then %>
<%end if %>
</li>
展开
 我来答
卢国栋G
推荐于2016-09-28 · 知道合伙人软件行家
卢国栋G
知道合伙人软件行家
采纳数:2205 获赞数:4772
中山大学网络工程专业,网络行业3年从业经验,经验丰富!

向TA提问 私信TA
展开全部
第一个:
<li>
<span>
<font color="#e63030">(<%=rs3("click")%>)</font>
<%=datetime%>
</span>·
<a href="<%if rs3("titleface")="无" then %><%=newsurl%><% else %> <%=newswwwurl%><%end if%>" title="<%=htmlencode4(rs3("title"))%>" target="_blank">
<font color="<%=rs3("titlecolor")%>">
<%if year(rs3("updatetime"))=year(date()) and month(rs3("updatetime"))=month(date()) and day(rs3("updatetime"))=day(date()) then%>
<%=CutStr(htmlencode4(rs3("title")),38)%><img src="images/new.gif">
<%else%>
<%=CutStr(htmlencode4(rs3("title")),44)%>
<%end if%><!--标题后评论提示-->
</font>
</a>
<% if rs3("titlesize")>=1 then %>
<%end if %>
</li>

第二个:
<li>
<span>
<font color="#e63030">(<%=rs3("click")%>)</font>
<%=datetime%>
</span>·

<%if year(rs3("updatetime"))=year(date()) and month(rs3("updatetime"))=month(date()) and day(rs3("updatetime"))=day(date()) then%>
<a href="<%if rs3("titleface")="无" then %><%=newsurl%><% else %> <%=newswwwurl%><%end if%>" title="<%=htmlencode4(rs3("title"))%>" target="_blank">
<font color="<%=rs3("titlecolor")%>"> <%=CutStr(htmlencode4(rs3("title")),38)%> </font>
</a><img src="images/new.gif">
<%else%>
<a href="<%if rs3("titleface")="无" then %><%=newsurl%><% else %> <%=newswwwurl%><%end if%>" title="<%=htmlencode4(rs3("title"))%>" target="_blank">
<font color="<%=rs3("titlecolor")%>"> <%=CutStr(htmlencode4(rs3("title")),44)%> </font>
</a>
<%end if%><!--标题后评论提示-->
<% if rs3("titlesize")>=1 then %>
<%end if %>
</li>
看你自己喜欢哪个
更多追问追答
追问
哦,,,,谢谢谢谢!!!!测试好后,我再加你100分。非常感谢!!!
追答
呵呵,应该没问题
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
利信时代电源技术
2024-07-26 广告
作为利信时代电源技术(北京)有限公司的工作人员,我不推荐或讨论任何非法的或欺诈性的服务。您应该注意网络安全和隐私保护,避免点击不明来源的链接或提供个人信息。如果您需要了解有关电源技术的问题,请与我们联系,我们将尽力为您提供帮助。 利信时代电... 点击进入详情页
本回答由利信时代电源技术提供
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式