我对google到是不了解,不过听他们说一个页面存在大量关键字指向同一个链接,google视他在作弊,因而就有朋友提出来,相同的“内部链接关键字”是否可以只替换一次,答案是肯定的:
本次修改,只适合FoosunCMS V3.1.0930,使用前请注意备份相关文件
在/Foosun/Admin/Refresh/Function.asp中大略240行找到下面的函数,红色部分为新增加的:
Function ReplaceInnerLink(NewsContent)
Dim RoutineSql,RsRoutineObj,ReplaceStr
RoutineSql = "Select * from FS_Routine where Type=5"
ReplaceStr = "{ReplaceStr}" '只替换第一次出现的内部连接关键字
Set RsRoutineObj = Conn.Execute(RoutineSql)
Dim StrReplace,Inti,DLocation,XLocation
do while Not RsRoutineObj.Eof
Inti=1
StrReplace=RsRoutineObj("Name")
If instr(1,NewsContent,StrReplace) then
do while instr(Inti,NewsContent,StrReplace)<>0
Inti=instr(Inti,NewsContent,StrReplace)
'response.write Inti & "|"
If Inti<>0 then
DLocation=instr(Inti,NewsContent,">")'如果内容在><之间则替换
XLocation=instr(Inti,NewsContent,"<")
If DLocation>XLocation Then
If Instr(ReplaceStr,"{ReplaceStr}"&StrReplace&"{ReplaceStr}")=0 and instr(1,mid(NewsContent,inti-5,11),"[Page]")=0 then'避免替换[Page]里面的内容后,造成分页混乱
NewsContent=left(NewsContent,Inti-1) & "<a href=" & RsRoutineObj("Url") & " target=_blank>" & StrReplace & "</a>" & mid(NewsContent,Inti+len(StrReplace))
ReplaceStr = ReplaceStr & StrReplace & "{ReplaceStr}"
Inti=Inti+len("<a href=" & RsRoutineObj("Url") & " target=_blank>" & StrReplace & "</a>")
Else
Inti=Inti+len(StrReplace)
End If
Else
Inti=Inti+len(StrReplace)
end If
End If
loop
End If
RsRoutineObj.MoveNext
Loop
Set RsRoutineObj = Nothing
ReplaceInnerLink = NewsContent
End Function
FoosunCMS v3.0版本,找到同名文件,直接注意replace的用法
NewsContent = Replace(NewsContent,RsRoutineObj("Name"),"<a href=""" & RsRoutineObj("Url") & """ target=""_blank"">" & RsRoutineObj("Name") & "</a>",1,1)
FoosunCMS v3.0版本,找到同名文件,直接注意replace的用法
NewsContent = Replace(NewsContent,RsRoutineObj("Name"),"<a href=""" & RsRoutineObj("Url") & """ target=""_blank"">" & RsRoutineObj("Name") & "</a>",1,1)
这段代码在那里?没有找到!
Admin/Refresh/Function.asp
中,有这样一句,直接查找修改就OK了。
[此贴子已经被作者于2005-11-26 12:38:25编辑过]
忘记说了我是3.1的!