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

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

直接修改根/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模板

来源:模板无忧//所属分类:风讯Cms教程/更新时间:2006-06-16
相关风讯Cms教程