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

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

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

      設為首頁加入收藏業務一覽表公司歷程公司介紹聯系我們
      當前位置網站運營 >> Joomla技巧 - 如何禁止未分類文章被站內搜索

      Joomla技巧 - 如何禁止未分類文章被站內搜索

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

      要解決這個標題,我們需要修正這個文件:

      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 );

      第二種方法,假如你盼看做的更具體些,例如使某些特定的文章頁面避開站內搜索,那么需要在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;

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

      譯者:Viiiix

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

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

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

        久久不射视频网 | 中文乱码在线精品日本 | 久久国产精选AV免费 | 亚洲天天久久中文字幕 | 最新中文一区二区在线播放 | 色综合久久中文字幕综合网 |