Gossamer Forum
Home : Products : DBMan : Customization :

bold predefined words in textarea field

Quote Reply
bold predefined words in textarea field
What would I need to do to make the word "rainbow" or "Rainbow", bold by default in a textarea when a record is viewed?

For example:

"Somewhere over the rainbow" entered in the form would look like "Somewhere over the rainbow" when a record is viewed (not searched for).

Thanks! Smile


DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com
(Mods based on JPDeni's original mods.)
Quote Reply
Re: [shann123] bold predefined words in textarea field In reply to
Does this mean that it's not possible?


DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com
(Mods based on JPDeni's original mods.)
Quote Reply
Re: [shann123] bold predefined words in textarea field In reply to
How would you determine which words are bolded? Is there a certain list of "keywords" that you have in mind?

Also, are you using the auto-generate function?
Quote Reply
Re: [Watts] bold predefined words in textarea field In reply to
There's really just 1 word that I need bolded to make it easier to see in the field. I just need it to show up bold when a record is viewed.

Here's what I need it for:9-12-03 Jungle Gin-social:Play It a Gin, Sam - 9-18-03 Greenback Bayou-topics:Frog Legs! YUMMY! - 09-27-03 Poppit!™-topics:Rainbow Room - 11-05-03 Squelchies-topics:Queen Squelchies - 11-12-03 Tumble Bees-topics:Temporary Members Room 009 - 11-20-03 Word Whomp Whackdown-topics:Temporary Members Room 003 - 11-25-03 Tri-Peaks Solitaire-topics:Raiding Tombs

It's hard to see quickly and I'm looking for a way to make it stand out from the rest of it like below:

9-12-03 Jungle Gin-social:Play It a Gin, Sam - 9-18-03 Greenback Bayou-topics:Frog Legs! YUMMY! - 09-27-03 Poppit!™-topics:Rainbow Room - 11-05-03 Squelchies-topics:Queen Squelchies - 11-12-03 Tumble Bees-topics:Temporary Members Room 009 - 11-20-03 Word Whomp Whackdown-topics:Temporary Members Room 003 - 11-25-03 Tri-Peaks Solitaire-topics:Raiding Tombs

I don't use the auto-generate.


DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com
(Mods based on JPDeni's original mods.)
Quote Reply
Re: [shann123] bold predefined words in textarea field In reply to
Who enters the information into dbman?

If it is yourself (or one person in particular) you should be able to to enter <B>Rainbow</B> whenever you type in the info into the input screen.

Do the bold tags in all caps <B> (as opposed to <b>) and it should work - at least it works with the dbman demo.

If this is not acceptable, we'll try to come up with a work around.
Quote Reply
Re: [Watts] bold predefined words in textarea field In reply to
Just admins enter that info in. We could do it like that since I know it does work, but the whole idea of it is to make it quicker for us by having the script do it automatically.

I really appreciate you looking into this for me. I've done a whole bunch of searching and haven't been able to find anything. I figure if there is a mod to change certain words to **** etc, there should be a way to change words to bold.


DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com
(Mods based on JPDeni's original mods.)
Quote Reply
Re: [shann123] bold predefined words in textarea field In reply to
It'd be really easy if the Rooms or whatever are entered into their own field. Date, Time, Room, Event, Description, etc. Then you could have it formatted in the html.pl file as:

<B>$rec{'Room'}</B>

Of course you know dbman bolds the search results... I bet that part could be hacked for the same purpose.
Quote Reply
Re: [Watts] bold predefined words in textarea field In reply to
I found a way to do it! Using JPdeni's dirty word filter mod, I made a few changes to it and it works! Here is what I did in case anyone is interested:

Installed everything in the mod according to directions.

Made these changes (marked in bold):

Quote:


# Censor dirty words
# 0 = do not censor
# 1 = reject records that contain any of the words
# 2 = replace words with ***
# 3 = replace the middle letters with *s, as in "f**k" "a*****e" "c********r"
# 4 = replace vowels with *s, as in "f*ck" "*ssh*l*" "c*cks*ck*r"
# 5 = replace words with the first letter of the word and * for the other letters, as in f*** a******, c*********
# 6 = replace each letter with a *, as in **** ******* **********
$db_censor = 2;

## You can edit the @dirty_words list however you want. Just be sure to put
## single quotes around each word, keep the list all on one line, and be sure they
## are in lower case.
# Dirty word list
@dirty_words = ('rainbow','Rainbow');


censor routine

if ($db_censor) {
foreach $dirty_word (@dirty_words) {
if (lc($in{$col}) =~ /$dirty_word/) {
if ($db_censor == 1) {
push(@input_err, "$col (Includes a banned word -- $dirty_word)");
}
else {
if ($db_censor == 2) { $replace = "<b>Rainbow</b>"; }
elsif ($db_censor == 3) {
$replace = substr($dirty_word,0,1).("*" x (length($dirty_word)-2)).substr($dirty_word,length($dirty_word)-1,1);
}
elsif ($db_censor == 4) {
$replace = $dirty_word; $replace =~ s/a|e|i|o|u/\*/ig;
}
elsif ($db_censor == 5) {
$replace = substr($dirty_word,0,1).("*" x (length($dirty_word)-1));
}
else {
$replace = ("*" x (length($dirty_word)));
}
$in{$col} =~ s/$dirty_word/$replace/ig;
}
}
}
}


Just a couple of easy changes. I still have to modify all of the forms so that it will change them all to bold, but from here on out, any time any of the records are modified, it will bold them.

Thanks for the suggestions Watts! Sly


DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com
(Mods based on JPDeni's original mods.)