账号通
    

账号  

密码  

20441

查看

39

回复
主题:增强文章系统内容页画中画功能 [收藏主题] 本贴被认定为精华 转到:  
悠客 当前离线

213

主题

15

广播

7

粉丝
添加关注
级别:二年级

用户积分:996 分
登录次数:401 次
注册时间:2010/11/8
最后登录:2019/10/28
悠客 发表于:2012/5/7 15:15:01   | 显示全部帖子 查看该作者主题 楼主 

功能:根据文章字数以及内容页是否含有上传的图片、FLSAH代码等自动判断是否加载画中画。



下面是修改方法:

打开KS_Cls/Kesion.Label.CommonCls.asp,找到Function ReplaceAD(ByVal Content,ClassID)这个函数,在其上面增加:

以下内容只有回复后才可以浏览,请先登录!



往下,对应修改Function ReplaceAD(ByVal Content,ClassID)函数。

  1. '替换画中画广告
  2. Function ReplaceAD(ByVal Content,ClassID)
  3. Dim ShowADTF,CLen,Dir,Width,Height,AdUrl,AdLinkUrl,LC,RC,AdStr,ADType
  4. Dim ClassBasicInfo:ClassBasicInfo=KS.C_C(ClassID,6)
  5. Dim ImgFileName:ImgFileName=GetImgFiles(Content)
  6. If ClassBasicInfo="" Then Exit Function
  7. Dim AdP:AdP = Split(Split(ClassBasicInfo,"||||")(4),"%ks%")
  8. ShowADTF=KS.ChkClng(Adp(0))
  9. If ShowADTF=0 Then ReplaceAD=Content:Exit Function
  10. Dim Param:Param=Split(AdP(1),",")
  11. '截取字符串长度
  12. If Len(Content)<KS.ChkClng(Param(0)) Then
  13. Clen=Len(Content)/2
  14. Else
  15. Clen=KS.ChkClng(Param(0))
  16. End If
  17. CLen=KS.ChkClng(Param(0)):Dir=Param(1):Width=KS.ChkClng(Param(2)):Height=KS.ChkClng(Param(3)):AdUrl=Adp(3):AdLinkUrl=Adp(4):ADType=KS.ChkClng(ADP(2))
  18. If CLen<>0 Then LC=InterceptString(Content,Clen)
  19. RC=Right(Content,Len(Content)-Len(LC))
  20. If ADType=2 Then
  21. Adstr="<table border=""0"" width="""& Width & """ height=""" & Height & """ align="""&Dir&"""><tr><td>" & AdUrl & "</td></tr></table>"
  22. Else
  23. If Lcase(Right(AdUrl,3))="swf" Then'判断是否Swf图片
  24. AdStr="<table width=""0"" border=""0"" align="""&Dir&""" style=""margin-top:5px;margin-right:10px""><tr><td><object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"" height=""" & Height & """ width="""&Width&""" ><param name=""movie"" value="""&AdUrl&"""><param name=""quality"" value=""high""><embed src="""&AdUrl&""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" height=""" & Height & """ width="""&Width&"""></embed></object></td></tr></table>"
  25. Else
  26. If AdLinkUrl="" Then AdLinkUrl="../"
  27. AdStr="<table width=""0"" border=""0"" align="""&Dir&""" style=""margin-top:5px;margin-right:10px""><tr><td><a href="""&AdLinkUrl&""" target=""_blank""><img border=""0"" src="""&AdUrl&""" height=""" & Height & """ width="""&Width&"""></a></td></tr></table>"
  28. End If
  29. End If
  30. '自动判断是否显示画中画广告
  31. If Len(Content)<KS.ChkClng(Param(0)) Or ImgFileName<>"" Then AdStr=""
  32. ReplaceAD=LC & AdStr & RC
  33. End Function

欢迎大家测试。
 
科讯NET交流群 321062970
  支持(6) | 反对(6) 回到顶部顶端 回到底部底部
<上一主题 | 下一主题 >
Powered By KesionCMS Version X1
厦门科汛软件有限公司 © 2006-2016 页面执行0.08008秒 powered by KesionCMS 9.0