Перейти к содержанию
Форум поддержки пользователей VamShop

4.Статьи/разделы - поиск


KoVaLsKy

Рекомендуемые сообщения

Порой маловато выдает поиск в статейном поиске.

Лечить можно, например выведя краткие описания статей, которые задаются в админке.

Открываем

/articles.php

находим

[/font][/color]
if (isset($_GET['description'])) {
$listing_sql = "select ad.articles_name, a.articles_date_added, a.articles_date_available, a.articles_id, ad.articles_description from " . TABLE_ARTICLES_DESCRIPTION . " ad inner join " . TABLE_ARTICLES . " a on ad.articles_id = a.articles_id where a.articles_status = '1' and ad.language_id = '" . (int)$_SESSION['languages_id'] . "' and (ad.articles_name like '%" . $_GET['akeywords'] . "%' or ad.articles_description like '%" . $_GET['akeywords'] . "%' or ad.articles_head_desc_tag like '%" . $_GET['akeywords'] . "%' or ad.articles_head_keywords_tag like '%" . $_GET['akeywords'] . "%' or ad.articles_head_title_tag like '%" . $_GET['akeywords'] . "%') order by ad.articles_name ASC";
} else {
$listing_sql = "select ad.articles_name, a.articles_date_added, a.articles_date_available, a.articles_id, ad.articles_description from " . TABLE_ARTICLES_DESCRIPTION . " ad inner join " . TABLE_ARTICLES . " a on ad.articles_id = a.articles_id where a.articles_status='1' and ad.language_id = '" . (int)$_SESSION['languages_id'] . "' and (ad.articles_name like '%" . $_GET['akeywords'] . "%' or ad.articles_head_desc_tag like '%" . $_GET['akeywords'] . "%' or ad.articles_head_keywords_tag like '%" . $_GET['akeywords'] . "%' or ad.articles_head_title_tag like '%" . $_GET['akeywords'] . "%') order by a.sort_order, ad.articles_name ASC";
}
[/CODE] [color=#282828][font=helvetica, arial, sans-serif]меняем на [/font][/color] [color=#282828][font=helvetica, arial, sans-serif]
[CODE][/font][/color]
if (isset($_GET['description'])) {
$listing_sql = "select ad.articles_name, a.articles_date_added, a.articles_date_available, a.articles_id, ad.articles_head_desc_tag from " . TABLE_ARTICLES_DESCRIPTION . " ad inner join " . TABLE_ARTICLES . " a on ad.articles_id = a.articles_id where a.articles_status = '1' and ad.language_id = '" . (int)$_SESSION['languages_id'] . "' and (ad.articles_name like '%" . $_GET['akeywords'] . "%' or ad.articles_description like '%" . $_GET['akeywords'] . "%' or ad.articles_head_desc_tag like '%" . $_GET['akeywords'] . "%' or ad.articles_head_keywords_tag like '%" . $_GET['akeywords'] . "%' or ad.articles_head_title_tag like '%" . $_GET['akeywords'] . "%') order by ad.articles_name ASC";
} else {
$listing_sql = "select ad.articles_name, a.articles_date_added, a.articles_date_available, a.articles_id, ad.articles_head_desc_tag from " . TABLE_ARTICLES_DESCRIPTION . " ad inner join " . TABLE_ARTICLES . " a on ad.articles_id = a.articles_id where a.articles_status='1' and ad.language_id = '" . (int)$_SESSION['languages_id'] . "' and (ad.articles_name like '%" . $_GET['akeywords'] . "%' or ad.articles_head_desc_tag like '%" . $_GET['akeywords'] . "%' or ad.articles_head_keywords_tag like '%" . $_GET['akeywords'] . "%' or ad.articles_head_title_tag like '%" . $_GET['akeywords'] . "%') order by a.sort_order, ad.articles_name ASC";
}
ниже ищем
[/font][/color]
'ARTICLE_SHORT_DESCRIPTION' => $articles['articles_head_desc_tag']
[/code] [color=#282828][font=helvetica, arial, sans-serif] [/font][/color] [color=#282828][font=helvetica, arial, sans-serif]меняем на[/font][/color] [color=#282828][font=helvetica, arial, sans-serif]
[code][/font][/color]
'ARTICLES_HEAD_DESC_TAG' => $articles['articles_head_desc_tag']
Потом в /tempals/шаблон//module/articles.html ищем

{if $module_data.ARTICLE_SHORT_DESCRIPTION}
<p>
{$module_data.ARTICLE_SHORT_DESCRIPTION}
</p>
{/if}
[/code] меняем на
[CODE]
{if $module_data.ARTICLES_HEAD_DESC_TAG}
<p>
{$module_data.ARTICLES_HEAD_DESC_TAG}
</p>
{/if}

все.

в принципе метку можно было не менять. но порядок-так порядок.

Как всегда спасибо Саше за помощь и терпеливость.

Удачи.

Ссылка на сообщение
Поделиться на другие сайты
×
×
  • Создать...