Gossamer Forum
Home : Products : DBMan : Installation :

Bolding and Not bolding results

Quote Reply
Bolding and Not bolding results
Hi,
I know that there is a variable which can be set to either bold or not bold the results - (I think it's $db_bold in db.cgi). However, what I find is that if I enter an asterix (*) doing a keyword search then everything is bolded, which then sometimes looks a bit strange when displaying results, if you have different length records - i.e. if I had a really long description for example then it would squash up the columns to fit it in, regardless of what the HTML says. Anyway, what I'm wondering is how to modify the bolding routine in db.cgi so that it will bold keyword searches, except when the user enters an *. I'm sure it cant be too difficult, except for the fact that I'm not too much of a Perl programmer. I was thinking of adding an extra piece of code to the line where it checks for $db_bold, to also check the environment query string, but I'm not sure that it might also have some other stuff in it as well, in which case it wouldn't work.

This really isn't top priority by any stretch of the imagination, but would just be nice if I could get it to do it.

Many thanks,
Dave
Quote Reply
Re: Bolding and Not bolding results In reply to
Thanks JPD,

I'll give that a whirl.

Meanwhile, I don't know if you noticed my response to message you posted re the bad-language query, but your code works wonderfully - thankyou very much,

Regards,
Dave
Quote Reply
Re: Bolding and Not bolding results In reply to
No, I didn't see your response about the censor script. (Sometimes I miss messages). Glad it worked for you.



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





Quote Reply
Re: Bolding and Not bolding results In reply to
I'm not sure how to stop it from bolding the results of a keyword search if a * is entered. But I can tell you how to get rid of it before you print it out.

In html_record, just after

my (%rec) = @_;

add

Code:
if ($in{'keyword'} eq "*") {
foreach $column (@db_cols) {
$rec{$column} =~ s/<.?B>//g;
}
}

Possibly someone else will come up with a simpler solution, but this should work.

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