forum.coppermine-gallery.net
Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: sbpoole on October 21, 2003, 01:32:03 am
-
Is it possible to have colored text in the album description? I know about using and to get bold and italic text. Thanks for any help.
-
out-of-the box: no.
But you could take a look into include/functions.inc.php and search for // [b] and [/b] for bolding text.
$text = str_replace("[b]", '<b>', $text);
$text = str_replace("[/b]", '</b>', $text);
// [u] and [/u] for underlining text.
$text = str_replace("[u]", '<u>', $text);
$text = str_replace("[/u]", '</u>', $text);
// [i] and [/i] for italicizing text.
$text = str_replace("[i]", '<i>', $text);
$text = str_replace("[/i]", '</i>', $text);
Add after it something like // [red] and [/red] for red text.
$text = str_replace("[red]", '<span style="color:red">', $text);
$text = str_replace("[/red]", '</span>', $text);
Please note that I haven't tested this, but should work along those lines...
If it works, you could try to make this even more sophisticated, using "real" bbcode tags like[color=red][/color]
GauGau
-
Thanks for your patience and quick reply GauGau. I'll give it a go and see what happens. Thanks again. Sonny Poole
-
just to note: if anyone want to change the colour of the album desc. text try changing it as a style if your just after 1 particular colour.
in style.css :
.maintable {
border: 1px solid #0E72A4;
background-color: #FFFFFF;
margin-top: 1px;
margin-bottom: 1px;
color: #123456;
}
and also:
.tableb_compact {
background: #EFEFEF ;
padding-top: 2px;
padding-right: 5px;
padding-bottom: 2px;
padding-left: 5px;
color : #123456;
}
just change the colour value. basic but it may help you?. I tried it and all my album description colour texts changed, but only to 1 colour of my choice, not many at same time. Although you may want to define new styles to ensure consistency.......
John
-
You're the man GauGau. I added these lines into functions.inc.php and it worked beautifully. Thank You, Sonny Poole
// and for red text.
$text = str_replace("", '<span style="color:red">', $text);
$text = str_replace("", '</span>', $text);
// and for green text.
$text = str_replace("", '<span style="color:green">', $text);
$text = str_replace("", '</span>', $text);
// [orange] and [/orange] for orange text.
$text = str_replace("[orange]", '<span style="color:orange">', $text);
$text = str_replace("[/orange]", '</span>', $text);
// [yellow] and [/yellow] for yellow text.
$text = str_replace("[yellow]", '<span style="color:yellow">', $text);
$text = str_replace("[/yellow]", '</span>', $text);
-
Wonderful! BTW, sbpoole you left out a $ next to "text" in the line for orange! If anyone wants to use any of this feature you must put it in otherwise none of them (colours) will work i discovered, as I just copied and pasted blindly... :)
-
My bad John. Good eye you've got. Actually I had the $text on the orange line, must have screwed it up when I copied and pasted here while trying to arrange it in a nice layout. I've since created an entry for lots more colors. Have to be careful not to create a psycodelic nightmare! Thanks for the notification.
P.S. I went back and edited my previous post and added the $ sign to the "orange" line in case someone wants to copy and paste. It's correct now. Sonny Poole