Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 10:05:02 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155554 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Search function  (Read 295 times)
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« on: December 26, 2011, 04:39:12 PM »

Hi,

I need a live search function (like search box with suggestions, but with replacing special characters like in search_convert.php), so I would like to analyze WB search function.. In news/search.php there is a news_search() function but I can not find where it is called/used ?

Could someone please point me in right direction ?

cheers

Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
marmot

Offline Offline

Posts: 209


« Reply #1 on: December 26, 2011, 10:28:00 PM »

Hi,

you can find the search functions in /serach/serach.php  wink.
From line 322 is the functionality where module specific seach functions are called.

regards
Logged
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #2 on: December 26, 2011, 11:28:04 PM »

I also dont understand what is __before and __after used ??
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2297



WWW
« Reply #3 on: December 26, 2011, 11:46:11 PM »

The search.php in a module directory is just serving the content for the main search script (in /search).
That way the search engine does not need to know about tables and what fields are important for all modules.

The __before and __after can be used by module developers, but I don't think it is ever used.
Logged

Professional WebsiteBaker Solutions
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2297



WWW
« Reply #4 on: December 26, 2011, 11:47:47 PM »

Some more details can be found here:
http://nettest.thekk.de/doku.php/projects/new_search/description_de_5
Logged

Professional WebsiteBaker Solutions
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #5 on: December 27, 2011, 11:26:36 PM »

Hi Ruud,

I am trying to make searchbox with suggestions, which will match characters from search_convert.php (I have a list of chars like: $t["š"] = array("š", "s"); and it is working ok )

I found the code in news_search:
Code:
$search_sql1 = search_make_sql_part($search_url_array, $match, array('`title`','`content_short`','`content_long`'));

And put it into my search function:
$query = $database->query("SELECT post_id, group_id, link, title FROM `".TABLE_PREFIX."mod_news_posts` WHERE $search_sql1 ");

but it is not working. What is also confusing me is that I found this code inside wysiwyg_search function:
Code:
$search_sql = search_make_sql_part($func_search_url_array, $func_search_match, array('`content`'));
but  $search_sql  is not called in SQL query from wysiwyg_search function...??

could you please point me in right direction ?

cheers,
Ivan



Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2297



WWW
« Reply #6 on: December 28, 2011, 10:46:36 AM »

The "search_make_sql_par t" part in the WYSIWYG search.php is not used.
Must be a leftover of testing/developing/copying new functionality.

The only thing the search.php does is sending all "content" from the database to the search function.

Again... The search.php's in the module directories do not search. They just give the content that should be searched to the main searchenginge.
Logged

Professional WebsiteBaker Solutions
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!