文章页面添加真正的“关键字”

废话就说到这里,下面是具体的操作:
      首先打开article.asp,找到

程序代码 程序代码

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
把它改成

      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,找到

程序代码 程序代码

<meta name="keywords" content=...这一句,改成
<%dim tmpTag,tmp_tags,len_name
   len_name=Len(SiteName)
    If Left(Title,len_name)=SiteName Then
%>
  <meta name="keywords" content="mesothelioma,zhangjun,<%=SiteName%>" />
<%else
   set tmpTag=new tag
   tmp_tags=tmpTag.filterKeys(log_ViewArr(19,0))
%>
  <meta name="keywords" content="<%=tmp_tags%>mesothelioma,zhangjun,<%=SiteName%>" />
<%end if%>


最后打开common\library.asp,找到

程序代码 程序代码

Public function filterHTML(str) '过滤标签
    If isEmpty(str) or isNull(str) or len(str)=0 Then
        Exit Function
     filterHTML=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)&"}","<a href=""default.asp?tag="&Server.URLEncode(log_Tag(1))&""">"&log_Tag(1)&"</a><a href=""http://technorati.com/tag/"&log_Tag(1)&""" rel=""tag"" style=""display:none"">"&log_Tag(1)&"</a> ")
  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
在其后添加如下代码
  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)&",")//此处于11月20日修改,修复中文tag的转换问题
  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

保存,上传,收工!

欢迎大家和我一起交流!


文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: Blog
评论: 1 | 引用: 0 | 查看次数: -
回复回复xJwW{RmR[2007-06-04 11:59 AM | del]
Just An Good atricle!
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.