
leecovuk wrote: Does anyone else think that the phpBB search function below is strangely worded, and doesn't work as you would logically expect :
"Search for any terms or use query as entered"
This says to me that I should be able to enter a collection of words OR a phrase, then any search results will somehow show both sets of results.
However, using this function seems to ignore the 'use query as entered' part, and search results include any of the words but _not_ the phrase.
Do you know what I mean? The 'use query as entered' seems like a meaningless piece of advice.
Code: Select all
cake and ice and creamCode: Select all
cake ice creamCode: Select all
cake and pie and not chocolateIs there a mod to do a 'phrase search' or improve this situation?
If not, I may have to hack away at search.php or somewhere to make the above description less misleading to users.
Code: Select all
####add on to this mod : link to specific searches and group topics by catégorie based on their title#####
#
#OPEN
#
search.php
#
#Find
#
$show_results = ( isset($HTTP_POST_VARS['show_results']) ) ? $HTTP_POST_VARS['show_results'] : 'topics';
$show_results = ($show_results == 'posts') ? 'posts' : 'posts';
#
#REPLACE WITH ##This will show result as topic and not posts
#
$show_results = ( isset($HTTP_POST_VARS['show_results']) ) ? $HTTP_POST_VARS['show_results'] : 'topics';
$show_results = ($show_results == 'posts') ? 'posts' : 'topics';
#
#FIND
#
if ( isset($HTTP_POST_VARS['search_terms']) )
{
$search_terms = ( $HTTP_POST_VARS['search_terms'] == 'all' ) ? 1 : 0;
}
else
{
$search_terms = 0;
}
#
#REPLACE WITH ##This will perform the search on all terms by default
#
if ( isset($HTTP_POST_VARS['search_terms']) )
{
$search_terms = ( $HTTP_POST_VARS['search_terms'] == 'all' ) ? 1 : 0;
}
else
{
$search_terms = 1;
}
#
#FIND
#
$sort_by = ( isset($HTTP_POST_VARS['sort_by']) ) ? intval($HTTP_POST_VARS['sort_by']) : 0;
#
# ##There you can chose the way the search result will be sorted
# ##0 = by time, 1 by topic, 2 by title, 3 = user name et 4 = forum.
#
#
# ##This mod must be installed in order to add the ability to perform a
# ##search on topic titles only.
# ##Then to set the default value on search on title only :
#
#
#IN THE MOD'S CODE FIND
#
// BEGIN Search Titles Only 1.0.0 (www.phpBBDoctor.com)
$search_fields = SEARCH_ENTIRE_MESSAGE;
// END Search Titles Only 1.0.0 (www.phpBBDoctor.com)
#
#REPLACE WITH
#
// BEGIN Search Titles Only 1.0.0 (www.phpBBDoctor.com)
$search_fields = SEARCH_TITLE_ONLY;
// END Search Titles Only 1.0.0 (www.phpBBDoctor.com)
###EOM
Code: Select all
#
#-----[ FIND ]-------------------------------------
#
$sql = "SELECT m.post_id
FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m
WHERE w.word_text LIKE '$match_word'
AND m.word_id = w.word_id
AND w.word_common <> 1
$search_msg_only";
#
#-----[ REPLACE WITH ]-------------------------------------
#
// BEGIN Search Titles Only 1.0.0 (www.phpBBDoctor.com)
$sql = 'SELECT m.post_id
FROM ' . SEARCH_WORD_TABLE . ' w
, ' . SEARCH_MATCH_TABLE . " m
WHERE w.word_text LIKE '$match_word'
AND m.word_id = w.word_id
AND w.word_common <> 1
$search_word_sql";
// END Search Titles Only 1.0.0 (www.phpBBDoctor.com)bigbear wrote: I have some problems with this part here:
...
There's a parse error message with the start of the replacement line.
Users browsing this forum: No registered users and 0 guests