forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: sbpoole on October 21, 2003, 01:32:03 am

Title: Colored text in album description?
Post 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.
Title: Colored text in album description?
Post by: Joachim Müller on October 21, 2003, 01:49:14 am
out-of-the box: no.
But you could take a look into include/functions.inc.php and search for
Code: [Select]
       // [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
Code: [Select]
       // [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
Code: [Select]
[color=red][/color]

GauGau
Title: Colored Text
Post by: sbpoole on October 21, 2003, 01:52:35 am
Thanks for your patience and quick reply GauGau.  I'll give it a go and see what happens.  Thanks again.  Sonny Poole
Title: Colored text in album description?
Post by: John on October 21, 2003, 02:04:52 am
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
Title: It Worked GauGau!
Post by: sbpoole on October 21, 2003, 02:23:50 am
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);
Title: Colored text in album description?
Post by: John on October 21, 2003, 07:50:48 am
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... :)
Title: Colored $text
Post by: sbpoole on October 21, 2003, 09:16:25 am
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