<div id="outer" style="float:left;"> <div id="inner" style="float:left;margin:0;width:200px;height:200px;"></div> 文字内容 </div>
Dim LeftContent,MidAdContent,RightContent,ModifyContent,headlen,tempStr,headAdStr,tailAdStr ''截取合适数量的字符串 if len(ArticleContent)<320 then headlen=200 else headlen=320 end if tempStr=ArticleContent LeftContent=InterceptString(tempStr,headlen) '获得截取的文字内容 RightContent=Right(ArticleContent,Len(ArticleContent)-Len(LeftContent)) ModifyContent=LeftContent &"<div style=""float:left;""><script language=""javascript"" src=""http://www.eryi.org/ad.js""></script></div>"& RightContent
Function InterceptString(txt,length) Dim x,y,ii,c,ischines,isascii,tempStr txt=trim(txt) x = len(txt) y = 0 if x >= 1 then for ii = 1 to x c=asc(mid(txt,ii,1)) if c< 0 or c >255 then '说明是一个中文字符 y = y + 2 ischines=1 isascii=0 else '说明是一个ascii码 y = y + 1 ischines=0 isascii=1 end if '如果长度已经大于定义子字符串长度,就判断是否包含敏感字符串是否分开 if y >= length then if ischines=1 and StrCount(left(trim(txt),ii),"<a")=StrCount(left(trim(txt),ii),"</a>") then txt = left(trim(txt),ii) '"字符串限长 exit for else if isascii=1 then x=x+1 end if end if next InterceptString = txt else InterceptString = "" end if End Function '判断字符串出现的次数 Function StrCount(Str,SubStr) Dim iStrCount Dim iStrStart Dim iTemp iStrCount = 0 iStrStart = 1 iTemp = 0 Str=LCase(Str) SubStr=LCase(SubStr) Do While iStrStart < Len(Str) iTemp = Instr(iStrStart,Str,SubStr,vbTextCompare) If iTemp <=0 Then iStrStart = Len(Str) Else iStrStart = iTemp + Len(SubStr) iStrCount = iStrCount + 1 End If Loop StrCount = iStrCount End Function
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有