Gossamer Forum
Home : Products : DBMan : Installation :

http://www.amazon.com ?

Quote Reply
http://www.amazon.com ?
When the search-result for "ama" is an url:
the "bold"-function changes the link http://www.amazon.com to
http://www.<b>ama</B>zon.com
Any idea?
Quote Reply
Re: http://www.amazon.com ? In reply to
Turn off $db_bold. It will mess up anything that includes a URL in a search.


------------------
JPD





Quote Reply
Re: http://www.amazon.com ? In reply to
Is the global "turn off" the only way?
For the topic of this question I used
"http://www.<b>ama</B>zon.com", but it showes "http://www.amazon.com". Can I maybe use a similar filter only for the URL field?
Thanks again.
Quote Reply
Re: http://www.amazon.com ? In reply to
The reason the topic title didn't have the <B>ama</B> is that the forum software strips all html code.

You might try going to the end of sub query in db.cgi and look for

# Bold the results

I think the @search_fields array consists of the field numbers, so if you don't want any field to be bolded, you could try

instead of

Code:
foreach $field (@search_fields) {
$hits[$field + $offset] =~ s,(<[^>]+> )|($regexp_bold[$field]),defined($1) ? $1 : "<B>$2</B>",ge;
}

use

Code:
foreach $field (@search_fields) {
unless ($field == #) {
$hits[$field + $offset] =~ s,(<[^>]+> )|($regexp_bold[$field]),defined($1) ? $1 : "<B>$2</B>",ge;
}
}

replacing # with the number of your URL field.

There was something a while back here on the forum where Alex made a suggestion, but I don't know what the topic title is. You might try doing a search for "bold."

I don't know if this will work.



------------------
JPD





Quote Reply
Re: http://www.amazon.com ? In reply to
foreach $field (@search_fields) {
unless ($field == 4) {
$hits[$field + $offset] =~ s,(<[^>]+> )|($regexp_bold[$field]),defined($1) ? $1 : "<B>$2</B>",ge;

When use this I get an Internal Server Error. I didnīt change anything but adding :unless ($field == 4) {
Any idea?
Thanx
Quote Reply
Re: http://www.amazon.com ? In reply to
If that's all you added, then you didn't add a closing bracket for the "unless" statement.

Add a } after the line that starts with
$hits[$field + $offset]...

You'll end up with two } characters in a row -- one for the "foreach" loop and one for the "unless" statement.


------------------
JPD





Quote Reply
Re: http://www.amazon.com ? In reply to
Curtis, that's great! Thank you. Much better.


------------------
JPD





Quote Reply
Re: http://www.amazon.com ? In reply to
Thanks JPDeni.
Quote Reply
Re: http://www.amazon.com ? In reply to
Glad I could help.


------------------
JPD





Quote Reply
Re: http://www.amazon.com ? In reply to
Another way without modifying the db.cgi file:

Within the sub html_record, include somewhere before the record print statements

# parse out bold indicator for search queries - confuses URL's and date comparisons
if ($db_bold) {
$rec{'ExtraInfo'} =~ s/<\/?B>//g;
$rec{'LastMod'} =~ s/<\/?B>//g;
}