Joomla!で検索エンジンを拡張するモジュールはありますか?著者(created_by)と著者のエイリアス(created_by_alias)を記事で検索するには?Joomla!でcreated_by_aliasフィールドを検索してくださいコンテンツ
私はこの意図のためのシンプルなplugingを作ることを考えていたが、最初に私は、単純な次のようなプラグイン/検索/ content.phpファイルを変更してみました:正確なとデフォルト例で
case 'exact':
$text = $db->Quote('%'.$db->getEscaped($text, true).'%', false);
$wheres2 = array();
$wheres2[] = 'a.title LIKE '.$text;
$wheres2[] = 'a.introtext LIKE '.$text;
$wheres2[] = 'a.fulltext LIKE '.$text;
$wheres2[] = 'a.metakey LIKE '.$text;
$wheres2[] = 'a.metadesc LIKE '.$text;
$wheres2[] = 'a.created_by_alias LIKE '.$text; // added
$where = '(' . implode(') OR (', $wheres2) . ')';
break;
case 'all':
case 'any':
default:
$words = explode(' ', $text);
$wheres = array();
foreach ($words as $word) {
$word = $db->Quote('%'.$db->getEscaped($word, true).'%', false);
$wheres2 = array();
$wheres2[] = 'a.title LIKE '.$word;
$wheres2[] = 'a.introtext LIKE '.$word;
$wheres2[] = 'a.fulltext LIKE '.$word;
$wheres2[] = 'a.metakey LIKE '.$word;
$wheres2[] = 'a.metadesc LIKE '.$word;
$wheres2[] = 'a.created_by_alias LIKE '.$word; // added
$wheres[] = implode(' OR ', $wheres2);
}
$where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')';
break;
が、運がない。著者エイリアスで検索すると、結果は期待どおりに返されません。事実は同じ結果を返すということです。
他のファイルは変更する必要がありますか?事前に
おかげ
PS:私はJoomlaのを使用しています! 1.5
確かにこれをやっていると確信していますが、保護手段としてテンプレートの上書きを使用してこれを達成し、コアを変更しないようにしてください。将来のアップグレードでは仕事が消えません!私はそれが少し話題だと知っています - しかし、より多くの情報をより良いと考えました!あなたの話題について特に私は助けの方法で多くを持っていない、恐れている、申し訳ありません! – Hanny
@ハニー私はそれを念頭に置いています。私は今開発サーバーで作業しています。ですから、テンプレートオーバーライドについて読む前にそれが可能かどうかを知りたいと思います。ご意見ありがとうございます! – pQB