<u id="14hvx"><sub id="14hvx"></sub></u>

    1. <u id="14hvx"></u>

      <video id="14hvx"><ins id="14hvx"></ins></video>

      設(shè)為首頁加入收藏業(yè)務(wù)一覽表公司歷程公司介紹聯(lián)系我們
      當(dāng)前位置網(wǎng)站運營 >> Joomla技巧 - 如何禁止未分類文章被站內(nèi)搜索

      Joomla技巧 - 如何禁止未分類文章被站內(nèi)搜索

      應(yīng)用Joomla這樣的CMS(內(nèi)容治理系統(tǒng))時,一個常見的標(biāo)題就是如何禁止例如致謝辭頁面、注冊頁面或此類獨立的未分類頁面被站內(nèi)搜索。

      要解決這個標(biāo)題,我們需要修正這個文件:

      joomla根路徑/plugins/search/content.php

      基于你的需求,我們有兩種可選的解決方法。

      第一種方法,假如你將所有這些獨立的頁面都回進“未分類(uncategorised)”這個section,那么可以按照下面的方法往做:

      在上面的content.php文件第56行四周找到如下代碼:

      $sUncategorised = $pluginParams->get( 'search_uncategorised', 1 );

      將它注釋掉;全部代碼段會像下面這樣:

      // load plugin params info
      $plugin =& JPluginHelper::getPlugin('search', 'content');
      $pluginParams = new JParameter( $plugin->params );

      $sContent = $pluginParams->get( 'search_content', 1 );
      // $sUncategorised = $pluginParams->get( 'search_uncategorised', 1 );
      $sArchived = $pluginParams->get( 'search_archived', 1 );
      $limit = $pluginParams->def( 'search_limit', 50 );

      第二種方法,假如你盼看做的更具體些,例如使某些特定的文章頁面避開站內(nèi)搜索,那么需要在content.php文件中83行四周參加這行代碼:

      $wheres2[] = "LOWER(a.metakey) NOT LIKE '{nosearch}'"; 

      終極全部代碼段會像下面這樣:

      $wheres = array();
      switch ($phrase) {
      case 'exact':
      $text = $db->getEscaped($text);
      $wheres2 = array();
      $wheres2[] = "LOWER(a.title) LIKE '%$text%'";
      $wheres2[] = "LOWER(a.introtext) LIKE '%$text%'";
      $wheres2[] = "LOWER(a.`fulltext`) LIKE '%$text%'";
      $wheres2[] = "LOWER(a.metakey) LIKE '%$text%'";
      $wheres2[] = "LOWER(a.metadesc) LIKE '%$text%'";
      $wheres2[] = "LOWER(a.metakey) NOT LIKE '%{nosearch}%'";
      $where = '(' . implode( ') OR (', $wheres2 ) . ')';
      break;

      現(xiàn)在,你可以將“{nosearch}”添加到某篇文章的參數(shù)設(shè)置里的“Meta Info - Keywords”中,這樣,即使該文章中包含站內(nèi)搜索的關(guān)鍵字,它也不會呈現(xiàn)在搜索成果列表里了。搞定。

      譯者:Viiiix

      [來源:原創(chuàng)] [作者:嵊州新時代建站] [日期:10-04-13] [閱讀:]
      精品夜夜爽天天爽视频_无码毛片一区二区本码视频_欧美激情免费观看一区_亚洲啪精品视频网站免费
      <u id="14hvx"><sub id="14hvx"></sub></u>

      1. <u id="14hvx"></u>

        <video id="14hvx"><ins id="14hvx"></ins></video>

        亚洲少妇另类视频 | 中文字幕在线看一区视频 | 亚洲第一区中文字幕在线播放 | 亚洲国产中文精品高清在线 | 亚洲国产综合网站 | 亚洲开心六月在线 |