修正关键字替换显示错误的BUG并增加关键字前的标示图片
作者:小戒 日期:2008-08-28
特别提醒,之所以不弄补丁,是因为此方法修改后,如果日志比较多的话,全静态下生成日志时可能会非常缓慢,所以请做选择性修改。可能是由于此方法不对,望高人指出。
话外音:一般在编辑代码时,请尽量不要用记事本。Dreamweaver或者Editplus是很不错的选择。
在本BLOG上通过。
修改方法:
1、打开COMMON\UBBCODE.ASP,找到:
从此行到本文档最后的代码,全部替换为:
在后台生成时可能会出现超时的错误,打开const.asp,找到
把90适当地改成更大值,比如900甚至9000。
注意:此时在出错后,不要关闭后台,先更新缓存,否则前台会打不开。
增加关键字标示图片:
打开control\c_smilies.asp,找到如下代码
到
话外音:一般在编辑代码时,请尽量不要用记事本。Dreamweaver或者Editplus是很不错的选择。
在本BLOG上通过。
修改方法:
1、打开COMMON\UBBCODE.ASP,找到:
复制内容到剪贴板
程序代码
程序代码 '-----------关键词识别----------------
从此行到本文档最后的代码,全部替换为:
复制内容到剪贴板
程序代码
程序代码 '-----------关键词识别----------------
If AutoKEY = 1 Then
Dim log_Keywords, log_KeywordsContent
For Each log_Keywords IN Arr_Keywords
log_KeywordsContent = Split(log_Keywords, "$|$")
strContent = startReplace(strContent,log_KeywordsContent(1),log_KeywordsContent(2),log_KeywordsContent(3))
Next
End If
Set re = Nothing
UBBCode = strContent
End If
End Function
Function AddToDic(reg,key,Index,str,dic)
Set reg=new RegExp
reg.Global=True
reg.IgnoreCase=True
Dim pattern,matches,m,ky
pattern="<a(.*?)>(.*?)</a>|\<[^>]*\>"
reg.Pattern=pattern
Set matches=reg.Execute(str)
For Each m In matches
dic.Add "key"&Index,m.value
str=replace(str,m.value,"$key"&Index&"$")
Index=Index+1
Next
Set matches=Nothing
End Function
Function startReplace(str,KeywordsContent,KeywordsUrl,KeywordsImg)
Dim TempStr:TempStr=str
Dim dic'字典
Set dic=server.CreateObject("scripting.dictionary")
Dim Index:Index=0
Dim reg
Set reg=new RegExp
reg.Global=True
reg.IgnoreCase=True
Dim pattern,matches,m,ky
ky=KeywordsContent
AddToDic reg,ky,Index,TempStr,dic
If KeywordsImg<>"" Then
TempStr=replace(TempStr,ky,"<a href='"&KeywordsUrl&"'>"&ky&"</a>")
Else
TempStr=replace(TempStr,ky,"<img src='"&KeywordsImg&"'><a href='"&KeywordsUrl&"'>"&ky&"</a>")
End If
AddToDic reg,ky,Index,TempStr,dic
Set reg=Nothing
Dim i
For i=0 To Index-1
TempStr=replace(TempStr,"$key"&i&"$",dic.Item("key"&i))
Next
Set dic=Nothing
startReplace=TempStr
End Function
%>
If AutoKEY = 1 Then
Dim log_Keywords, log_KeywordsContent
For Each log_Keywords IN Arr_Keywords
log_KeywordsContent = Split(log_Keywords, "$|$")
strContent = startReplace(strContent,log_KeywordsContent(1),log_KeywordsContent(2),log_KeywordsContent(3))
Next
End If
Set re = Nothing
UBBCode = strContent
End If
End Function
Function AddToDic(reg,key,Index,str,dic)
Set reg=new RegExp
reg.Global=True
reg.IgnoreCase=True
Dim pattern,matches,m,ky
pattern="<a(.*?)>(.*?)</a>|\<[^>]*\>"
reg.Pattern=pattern
Set matches=reg.Execute(str)
For Each m In matches
dic.Add "key"&Index,m.value
str=replace(str,m.value,"$key"&Index&"$")
Index=Index+1
Next
Set matches=Nothing
End Function
Function startReplace(str,KeywordsContent,KeywordsUrl,KeywordsImg)
Dim TempStr:TempStr=str
Dim dic'字典
Set dic=server.CreateObject("scripting.dictionary")
Dim Index:Index=0
Dim reg
Set reg=new RegExp
reg.Global=True
reg.IgnoreCase=True
Dim pattern,matches,m,ky
ky=KeywordsContent
AddToDic reg,ky,Index,TempStr,dic
If KeywordsImg<>"" Then
TempStr=replace(TempStr,ky,"<a href='"&KeywordsUrl&"'>"&ky&"</a>")
Else
TempStr=replace(TempStr,ky,"<img src='"&KeywordsImg&"'><a href='"&KeywordsUrl&"'>"&ky&"</a>")
End If
AddToDic reg,ky,Index,TempStr,dic
Set reg=Nothing
Dim i
For i=0 To Index-1
TempStr=replace(TempStr,"$key"&i&"$",dic.Item("key"&i))
Next
Set dic=Nothing
startReplace=TempStr
End Function
%>
在后台生成时可能会出现超时的错误,打开const.asp,找到
复制内容到剪贴板
程序代码
程序代码Server.ScriptTimeOut = 90
把90适当地改成更大值,比如900甚至9000。
注意:此时在出错后,不要关闭后台,先更新缓存,否则前台会打不开。
增加关键字标示图片:
打开control\c_smilies.asp,找到如下代码
复制内容到剪贴板
程序代码
程序代码 <form action="ConContent.asp" method="post" style="margin:0px">
<input type="hidden" name="action" value="smilies"/>
<input type="hidden" name="whatdo" value="KeyWord"/>
<input type="hidden" name="DelID" value=""/>
<input type="hidden" name="action" value="smilies"/>
<input type="hidden" name="whatdo" value="KeyWord"/>
<input type="hidden" name="DelID" value=""/>
到
评论: 7 | 引用: 0 | 查看次数: -
现在好了。。。。。方法能提供吗? 我不会加在左边 我想加在文章左边
小戒 于 [2008-08-29 02:17 PM] 回复
打开STATIC.HTM,找到:
在下面插入:
然后在你的CSS文件中插入:
复制内容到剪贴板
程序代码
程序代码 <div id="logPanel" class="Content-body">
在下面插入:
复制内容到剪贴板
程序代码
程序代码<div id="paper02"></div>
<div id="aditem_paper01">
<script type="text/javascript"><!--
google_ad_client = "pub-6347887448711969";
/* muzili.com文章页 */
google_ad_slot = "1157673251";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<div id="aditem_paper01">
<script type="text/javascript"><!--
google_ad_client = "pub-6347887448711969";
/* muzili.com文章页 */
google_ad_slot = "1157673251";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
然后在你的CSS文件中插入:
复制内容到剪贴板
程序代码
程序代码#paper02{clear: left;float: left;height: 10px;width: 1px;}
#aditem_paper01{clear: left;float: left;height: auto;width: auto;}
#aditem_paper01{clear: left;float: left;height: auto;width: auto;}
视觉工人博客用了这个修改方法后也解决了问题!谢谢!!
http://www.wjzxy.cn/blog
http://www.wjzxy.cn/blog
解决了!谢谢!!
还有我想问你一下,你的广告挡住了文章文字,你为什么不修复呢。我只会把广告放在文章的上面或者下面 ,不会放在文章左边,不知道能不能把方法做个文章出来
小戒 于 [2008-08-29 00:51 AM] 回复
呃。。。不好意思。我用的IE6,一直是正常状态,最近才有朋友说用FIREFOX和IE7,问题严重。现在如何了?谢谢。
已经解决 谢谢了 哈哈
不错,但是好多字都被你的广告盖住了看不见啊。。。。还有为什么我升级到157以后发表的文章页面的GG广告全部都不显示了,,,而157以前版本发布的文章却显示,,,,但是看你的好像每这个问题,,能指点一二吗?
小戒 于 [2008-08-28 09:09 PM] 回复
后台更新缓存,重新生成一下。
发表评论
上一篇
下一篇

文章来自:
Tags:
回复

后祝中秋节快乐,全家幸福安康平安!