标题过长,在后面加上省略号 - 风讯CMS - 爱建站

,,,,CMS教程,模板无忧,建站教程,CMS教程,风讯Cms教程,

SEO SEO

首页  >   风讯CMS > 标题过长,在后面加上省略号  >  正文

标题过长,在后面加上省略号

2018-09-27 07:33:04 向站长提问 编辑: admin 阅读:

 

直接修改根 inc Function asp中的: Function GotTopic(Str,StrLen)Dim l,t,c, i,LableStr,regEx,Match,Matches,tLenif IsNull(Str) then GotTopic = " " Exit Functionend ifif Str = " " then GotTopic= " " Exit Functionend ifSet regEx = New RegExpregEx Pattern = " [[^ [ ]]* ] "regEx IgnoreCase = TrueregEx Global = TrueSet Matches = regEx Execute(Str)For Each Match in Matches LableStr = LableStr & Match ValueNextStr = regEx Replace(Str, " ")Str=Replace(Replace(Replace(Replace(Str, "&nbsp; ", " "), "&quot; ",Chr(34)), "&gt; ", "> "), "&lt; ", "< ")l=len(str)t=0tLen = Clng(StrLen) - 2for i=1 to l c=Abs(Asc(Mid(str,i,1))) if c>255 then t=t 2 else t=t 1 end if if t>=tLen then GotTopic=left(str,i)& " " exit for else GotTopic=str end ifnextGotTopic = Replace(Replace(Replace(Replace(GotTopic, " ", "&nbsp; "),Chr(34), "&quot; "), "> ", "&gt; "), "< ", "&lt; ") & LableStrend function 查看更多 风讯cms教程  风讯cms模板 来源:模板无忧 所属分类:风讯Cms教程 更新时间:2006-06-16 [收藏][报错][返回列表] 相关风讯Cms教程: 最简单的栏目切换方法(样式系列之栏目切换篇2) 我也放个栏目切换代码,简简单单的


直接修改根/inc/Function.asp中的:

Function GotTopic(Str,StrLen)
Dim l,t,c, i,LableStr,regEx,Match,Matches,tLen
if IsNull(Str) then
GotTopic = ""
Exit Function
end if
if Str = "" then
GotTopic=""
Exit Function
end if
Set regEx = New RegExp
regEx.Pattern = "\[[^\[\]]*\]"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(Str)
For Each Match in Matches
LableStr = LableStr & Match.Value
Next
Str = regEx.Replace(Str,"")
Str=Replace(Replace(Replace(Replace(Str,"&nbsp;"," "),"&quot;",Chr(34)),"&gt;",">"),"&lt;","<")
l=len(str)
t=0
tLen = Clng(StrLen) - 2
for i=1 to l
c=Abs(Asc(Mid(str,i,1)))
if c>255 then
t=t 2
else
t=t 1
end if
if t>=tLen then
GotTopic=left(str,i)&"...."
exit for
else
GotTopic=str
end if
next
GotTopic = Replace(Replace(Replace(Replace(GotTopic," ","&nbsp;"),Chr(34),"&quot;"),">","&gt;"),"<","&lt;") & LableStr
end function

查看更多 风讯cms教程  风讯cms模板


标题过长,在后面加上省略号
http://www.yuedudg.cn/article/15105821.html

 

友情链接
wp之家 帝国cms常识 phpcms之家
cms综合网 discuz经验网 ecshop经验网
zblog之家 织梦之家


Tags: CMS教程 模板无忧 建站教程 CMS教程 风讯Cms教程


手机浏览本文
标题过长,在后面加上省略号

标题过长,在后面加上省略号

站内推荐

网站分类

标签列表

关于我们
文章内容来源互联网仅供参考,如果还有疑问请联系我们!我们将竭力帮您解决您的问题
联系我们:

QQ: 397423577 

email:397423577@qq.com

微信:ganenboy