Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Colored text in album description?  (Read 3949 times)

0 Members and 1 Guest are viewing this topic.

sbpoole

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 66
Colored text in album description?
« 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Colored text in album description?
« Reply #1 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
Logged

sbpoole

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 66
Colored Text
« Reply #2 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
Logged

John

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 75
Colored text in album description?
« Reply #3 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
Logged

sbpoole

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 66
It Worked GauGau!
« Reply #4 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);
Logged

John

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 75
Colored text in album description?
« Reply #5 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... :)
Logged

sbpoole

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 66
Colored $text
« Reply #6 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
Logged
Pages: [1]   Go Up
 

Page created in 0.03 seconds with 19 queries.