Colored text in album description? Colored text in album description?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Colored text in album description?

Started by sbpoole, October 21, 2003, 01:32:03 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

sbpoole

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.

Joachim Müller

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

sbpoole

Thanks for your patience and quick reply GauGau.  I'll give it a go and see what happens.  Thanks again.  Sonny Poole

John

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

sbpoole

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);

John

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... :)

sbpoole

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