View Full Version : strange thing with search
When I try some keyword with "any word" - dont find (but it's exists!)
when with "all words" - OK
with exact match - OK
and don't work highlight
in search results only words with tags
[hl]keyword[/hl]
why?
tested this all in your directory (Demo) - all it's good =)
maybe I have this problem, because use non-latin characters?
what I need to do :?: :)
Simon Gooffin
12-03-2005, 07:01 AM
hmm, really strange thing. please check if you have the following code in your search.php
foreach($links as $key=>$value)
{
if (3 == $type)
{
$links[$key]['title'] = str_replace($what, "[hl]{$what}[/hl]", $links[$key]['title']);
$links[$key]['description'] = str_replace($what, "[hl]{$what}[/hl]", $links[$key]['description']);
}
else
{
foreach($what_arr as $word)
{
$links[$key]['description'] = str_replace($word, "[hl]{$word}[/hl]", $links[$key]['description']);
}
}
}
ok! I was put this code instead of old code - now "any word" work! ;)
but results with
[hl]keyword[/hl]
don't really high light. why it ? and what I can try to do? =)
echopulse
12-05-2005, 02:39 AM
Are you using 1.3 or 1.4?
And shouldn't those tags, and in the code below be <h1> and </h1> instead?
Also, only words that match the case of the word searched for are higlighed. For instance, if you search for fair, all links containing FAIR and fair will be found, but only those matching fair will be highlighted.
Simon Gooffin
12-05-2005, 04:35 AM
ahh, now I see what can be a problem of this. I forgot you changed one function in order your links to be displayed correctly. Well, here is instruction what you should do.
*** open search.php ***
*** find the following code ***
$links[$key]['title'] = str_replace($what, "[hl]{$what}[/hl]", $links[$key]['title']);
$links[$key]['description'] = str_replace($what, "[hl]{$what}[/hl]", $links[$key]['description']);
*** change it to the following ***
$links[$key]['title'] = str_replace($what, "<span class=\"highlight\">{$what}</span>", $links[$key]['title']);
$links[$key]['description'] = str_replace($what, "<span class=\"
highlight\">{$what}</span>", $links[$key]['description']);
*** save changes ***
Make sure you have span.highlight in your css file.
ok! now it works!
thank you, Simon! :D
echopulse
12-06-2005, 02:33 AM
Simon, what about the highlight being case sensitve? Will there be a fix for that?
Simon Gooffin
12-06-2005, 04:19 AM
can you please clarify? do you want it to be case sensitive or insensitive?
echopulse
12-06-2005, 05:21 AM
Case Insensitive. I don't really think users would search for case sensitve words in a directory.
Simon Gooffin
12-07-2005, 03:59 AM
thanks, I will fix this asap :)
hwhite2
12-13-2005, 05:20 PM
I am having the same issue with any word search (come up with no items). All words and exact match work.
I found the code in the search.php and changed it to
foreach($links as $key=>$value)
{
if (3 == $type)
{
$links[$key]['title'] = str_replace($what, "<span class=\"highlight\">{$what}</span>", $links[$key]['title']);
$links[$key]['description'] = str_replace($what, "<span class=\"highlight\">{$what}</span>", $links[$key]['description']);
}
else
{
foreach($what_arr as $word)
{
$links[$key]['description'] = str_replace($word, "{$word}", $links[$key]['description']);
}
}
}
Test URL http://www.pagesinblack.com/directory/ (searching on test)
Simon Gooffin
12-15-2005, 07:28 AM
unfortunately, it's a known bug :( we will fix it asap.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.