joomla中搜索模板 search
在我的搜索模板中,只能标题搜索,不能文章内容搜索。看程序有表述到文章内容搜索。
代码如下:
$wheres = array();
switch ($phrase) {
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;
$where = '(' . implode( ') OR (', $wheres2 ) . ')';
break;
case 'all':
case 'any':
default:
$words = explode( '
代码如下:
$wheres = array();
switch ($phrase) {
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;
$where = '(' . implode( ') OR (', $wheres2 ) . ')';
break;
case 'all':
case 'any':
default:
$words = explode( '
没有找到相关结果
已邀请:
0 个回复