标题过长,在后面加上省略号-风讯CMS教程

来源:模板无忧 作者:netfound 更新时间:2006-06-16 点击:

直接修改根/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教程:
最新评论:
loading.. 评论加载中....
发表评论:不能超过250字节,请自觉遵守互联网相关政策法规.
  • 昵称: 验证:

最新风讯CMS教程