3.1-頁(yè)面關(guān)鍵字標(biāo)簽及采集新聞自動(dòng)添加關(guān)鍵字_風(fēng)訊Cms教程

      編輯Tag賺U幣
      教程Tag:暫無(wú)Tag,歡迎添加,賺取U幣!

      本文討論區(qū): http://bbs.foosun.net/dispbbs.asp?BoardID=22&replyID=81152&id=16688&skin=0

      為了方便搜索引擎,所以仿NB的文章系統(tǒng)制作下頁(yè)面要害字的標(biāo)簽!

      第一步

      在 foosun\Admin\Refresh\Function.asp 找到

      Function GetNewsContent(TempletContent,NewsRecordSet,NewsContent)
      TempletContent = Replace(TempletContent,"{News_Title}",NewsRecordSet("Title"))

      在下面添上

      '要害字標(biāo)簽
      if Not IsNull(NewsRecordSet("keywords")) then
      TempletContent = Replace(TempletContent,"{News_keywords}",NewsRecordSet("keywords"))
      else
      TempletContent = Replace(TempletContent,"{News_keywords}","")
      end if
      '要害字標(biāo)簽

      在最后倒數(shù)第二行,也就是 %>的前面,添上

      '************************************
      'author:lino
      '把標(biāo)題與要害字表中的記錄匹配
      'Start
      '*************************
      Function replaceKeywordByTitle(title)
      Dim whereisKeyword,i,theKeywordOnNews
      Dim keyword,rsRuleObj,theKeywordS

      '***假如你用3.0版,請(qǐng)把下行fs_Routine改成Routine
      Set RsRuleObj = Conn.Execute("Select * from FS_Routine")
      do while Not RsRuleObj.Eof
      keyword = RsRuleObj("name")
      whereisKeyword = InStr(Lcase(title),Lcase(keyword))
      if(whereisKeyword>0) then
      if(theKeywordOnNews="") then
      theKeywordOnNews=keyword
      else
      theKeywordOnNews=theKeywordOnNews&" "&keyword
      end if
      end if
      RsRuleObj.MoveNext
      loop

      '假如keyword的長(zhǎng)度大于100,截去過(guò)長(zhǎng)的
      if(len(theKeywordOnNews)>99) then
      theKeywordOnNews=left(theKeywordOnNews,99)
      end if

      replaceKeywordByTitle = theKeywordOnNews
      End function
      '**********************
      'End

      第二步 在 foosun/funpages/ lablenews.asp

      找到 <option selected>選擇插入字段</option>

      在下面添上

      '頁(yè)面要害字標(biāo)簽
      <option value="{News_keywords}">頁(yè)面要害字</option>
      '頁(yè)面要害字標(biāo)簽

      第三步師在 foosun/admin/info/newswords.asp 中 大約306行左右 找到
      INewsAddObj("KeyWords") = Replace(Replace(Request("KeywordText"),"""",""),"'","")
      將這句修改為
      '************************************
      'author:lino
      '把調(diào)用replaceKeywordByTitle方法,過(guò)濾要害字
      '假如用戶自定義了要害字,自動(dòng)設(shè)置要害字不起作用
      'Start
      '*************************
      Dim KeywordText
      if (Request("KeywordText")="" or isempty(Request("KeywordText"))) then
      KeywordText = replaceKeywordByTitle(ITitle)

      else
      KeywordText = Request("KeywordText")
      end if

      if KeywordText <> "" then
      INewsAddObj("KeyWords") = Replace(Replace(KeywordText,"""",""),"'","")
      end if

      'End
      '***********************************

      第四步 在 Foosun/Admin/Collect/movenewstosystem.asp 中 大約117行,找到
      RsSysNewsObj("TxtSource") = RsNewsObj("Source")

      將之修改為

      RsSysNewsObj("keywords") =replaceKeywordByTitle(RsNewsObj("title"))

      程序改動(dòng)OK!

      下面制作標(biāo)簽, 可以在 自定義標(biāo)簽 的 新聞瀏覽 里,自己選擇 頁(yè)面要害字 標(biāo)簽

      查看更多 風(fēng)訊cms教程  風(fēng)訊cms模板

      共2頁(yè)上一頁(yè)12下一頁(yè)
      來(lái)源:模板無(wú)憂//所屬分類:風(fēng)訊Cms教程/更新時(shí)間:2006-06-16
      相關(guān)風(fēng)訊Cms教程