跳到内容

pjblog tags添加为关键字

把每篇文章tags属性添加为网页的关键字,从而提高我们的网站被搜索引擎搜到的概率。具体的操作:
首先打开article.asp,找到
[code]if blog_postFile then
SQL=”Select top 1 log_ID,log_CateID,log_title,Log_IsShow,log_ViewNums,log_Author,log_comorder,log_DisComment FROM blog_Content Where log_ID=”&id&” and log_IsDraft=false”
else
SQL=”Select top 1 log_ID,log_CateID,log_title,Log_IsShow,log_ViewNums,log_Author,log_comorder,log_DisComment,log_Content,log_PostTime,log_edittype,log_ubbFlags,log_CommNums,log_QuoteNums,log_weather,log_level,log_Modify,log_FromUrl,log_From,log_tag FROM blog_Content Where log_ID=”&id&” and log_IsDraft=false”
end if[/code]
把它改成:

程序代码 程序代码
SQL=”Select top 1 log_ID,log_CateID,log_title,Log_IsShow,log_ViewNums,log_Author,log_comorder,log_DisComment,log_Content,log_PostTime,log_edittype,log_ubbFlags,log_CommNums,log_QuoteNums,log_weather,log_level,log_Modify,log_FromUrl,log_From,log_tag FROM blog_Content Where log_ID=”&id&” and log_IsDraft=false”

然后打开header.asp,找到

程序代码 程序代码

这一句,改成:
[code] <%dim tmpTag,tmp_tags,len_name len_name=Len(SiteName) If Left(Title,len_name)=SiteName Then %>
“&log_Tag(1)&”“&log_Tag(1)&” “)
Next
Dim re
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern=”\{(\d)\}”
str=re.Replace(str,””)
filterHTML=str
end if
end function[/code]
在其后添加如下代码
[code] Public function filterKeys(str) 'Theosoft (C) 2001-2006
If isEmpty(str) or isNull(str) or len(str)=0 Then
Exit Function
filterKeys=str
else
dim log_Tag,log_TagItem
For Each log_TagItem IN Arr_Tags
log_Tag=Split(log_TagItem,”||”)
str=replace(str,”{“&log_Tag(0)&”}”,log_Tag(1)&”,”)
Next
Dim re
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern=”\{(\d)\}”
str=re.Replace(str,””)
filterKeys=str
end if
end function[/code]

2 条评论

  1. shuiyao

    两种可能:
    一、代码加的有错误
    二、没在后台重新生成一下

  2. kevin

    改完以后原来的文章页就不能正常显示了。不知道这个是怎么回事。
    我的也是这样的。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注