aldaffodil Posted August 29, 2004 Share Posted August 29, 2004 (edited) 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 August 29, 2004 by aldaffodil Quote Link to comment Share on other sites More sharing options...
Salvo Posted August 29, 2004 Share Posted August 29, 2004 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 Quote Link to comment Share on other sites More sharing options...
Salvo Posted August 29, 2004 Share Posted August 29, 2004 (edited) Sorry Edited August 29, 2004 by Salvo Quote Link to comment Share on other sites More sharing options...
Guest Posted August 29, 2004 Share Posted August 29, 2004 Well, that'sd the good thing about this community....we all work together to improve ideas. :) Quote Link to comment Share on other sites More sharing options...
aldaffodil Posted August 29, 2004 Author Share Posted August 29, 2004 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! Quote Link to comment Share on other sites More sharing options...
aldaffodil Posted August 29, 2004 Author Share Posted August 29, 2004 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. Quote Link to comment Share on other sites More sharing options...
aldaffodil Posted August 29, 2004 Author Share Posted August 29, 2004 (edited) I have once again uploaded a new package. This one has support for language_id and elminates the transfer of the keywords to the product search box. http://www.oscommerce.com/community/contributions,2393 Edited August 29, 2004 by aldaffodil Quote Link to comment Share on other sites More sharing options...
el_Juanky Posted April 18, 2007 Share Posted April 18, 2007 I'm adapted the article_search.php code into advanced_search_result.php. When an user want search something, this contribution find results in product and articles database. http://www.oscommerce.com/community/contributions,2393 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.