Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign in to follow this  
aldaffodil

Support for Article Search v 1.0

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Guest

Well, that'sd the good thing about this community....we all work together to improve ideas. :)

Share this post


Link to post
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!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×