Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Support for Article Search v 1.0


aldaffodil

Recommended Posts

This is the support thread for Article Search v 1.0

 

This contribution will add a search box that will allow you to search

 

articles using Article Manager v 1.2. Article Results will give the

 

Article Title with a link to the article and a 300 character

 

truncation of the article. Sorry, I did not write an advanced search

 

to go with this.

 

Contribution Located at: http://www.oscommerce.com/community/contributions,2393

Edited by aldaffodil
Link to comment
Share on other sites

HI all

 

I have installed the "Articles Search" and I found two points which needs to be addressed.

 

1 - it doesn't take care of the "STATUS" of the article.

2- it doesn't take care of the multi languages.

 

To start with I have tried to make it multy language but I don't know why it doesn't work

 

$search_query = tep_db_query("select articles_name, articles_id, language_id, articles_description from " . TABLE_ARTICLES_DESCRIPTION . " where articles_name like '%" . $keywords . "%' or articles_description like '%" . $keywords . "%' or articles_head_desc_tag like '%" . $keywords . "%' or articles_head_keywords_tag like '%" . $keywords . "%' or articles_head_title_tag like '%" . $keywords . "%' and language_id = '" . (int)$languages_id . "' order by articles_name ASC");

} else {

 

 

$search_query = tep_db_query("select articles_name, articles_id, language_id, articles_description from " . TABLE_ARTICLES_DESCRIPTION . " where articles_name like '%" . $keywords . "%' or articles_head_desc_tag like '%" . $keywords . "%' or articles_head_keywords_tag like '%" . $keywords . "%' or articles_head_title_tag like '%" . $keywords . "%' and language_id = '" . (int)$languages_id . "' order by articles_name ASC");

 

 

Maybe someone with much more experience the me can address these two issues.

 

Thanks

 

Salvo

Link to comment
Share on other sites

Ok, I have uploaded a new package that includes support for articles status and have somewhat improved the layout of search results.

 

I do not think I am going to touch on the languages_id. My reasoning being that the search will most likely return english results if you enter an english keyword and will return spanish results if you enter a spanish keyword, etc.

 

If a lot of people feel this is something that needs to be addressed, then I'll start working on it.

 

Thanks for the feedback!

Link to comment
Share on other sites

Upon further reflection, I have decided to give the language_id a try.

 

Salvo (or anyone else willing to give it a try), please try these sql statements:

  if (isset($HTTP_GET_VARS['description'])) {
   $search_query = tep_db_query("select ad.articles_name, 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)$languages_id . "' and (ad.articles_name like '%" . $keywords . "%' or ad.articles_description like '%" . $keywords . "%' or ad.articles_head_desc_tag like '%" . $keywords . "%' or ad.articles_head_keywords_tag like '%" . $keywords . "%' or ad.articles_head_title_tag like '%" . $keywords . "%') order by ad.articles_name ASC");
 }  else {
   $search_query = tep_db_query("select ad.articles_name, 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)$languages_id . "' and (ad.articles_name like '%" . $keywords . "%' or ad.articles_head_desc_tag like '%" . $keywords . "%' or ad.articles_head_keywords_tag like '%" . $keywords . "%' or ad.articles_head_title_tag like '%" . $keywords . "%') order by ad.articles_name ASC");
 }

 

I cannot fully test it because I do not use two languages on any of my sites. If it works for you, please let me know and I'll add it to the package.

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...