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: Background colors for individual photos  (Read 3645 times)

0 Members and 1 Guest are viewing this topic.

Jet_Jaguar

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Background colors for individual photos
« on: December 20, 2003, 01:48:35 am »

I've been looking at other's galleries, and I've noticed that often the color of the background clashes with the actual photos.  Some pictures would look better with a black or a white border, and this varies from shot to shot.

I think it would be cool if each photo could have a preferred background color.  This could be a field in the database containing the RGB codes, just as there are fields for the captions. It wouldn't have to be something definite in HTML like a table cell or a image border;  In fact, it would be preferable if it was a common php variable that style authors could access.
Logged
Admin of the Guytalk.org forums - Guys talking about guy stuff.

rbl

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 60
    • http://lomoblog.com/
Background colors for individual photos
« Reply #1 on: December 22, 2003, 02:06:47 am »

IMHO, this is a feature that few users would want and only half of them would really use. Adding to that, is the huge amount of work needed to make it work properly and not suck ass (have you imagine a page with several table cells each one with a different color?)

I sometimes feel the need for a feature like that and the best I could came up with, after thinking about it for sometime, was something like this:
 - Create a set of css styles that would fit most situations and give them names, example: .5w2b = 5px white padding around picture and 2px solid black border; .4b1c = 4px black padding around picture and 1px solid #cccccc border; etc.
 - Be sure to choose a naming convention that would fit all your needs without exceptions, I mean, all class names have only 4 alpha-numerical characters like the example above
 - Name all your files prior to upload with the appropriate class code separated with a special character (that always must be the same), something like: 5w2b_portrait-of-dorian-grey.jpg, 4b1c_blueflower.jpg
 - Add some regular expressions code in CPG to look for those 4 alpha-numerical characters in the name, extract them and add them to the img tag as a class, example <img src="/albums/10001/4b1c_blueflower.jpeg" class="4b1c" .. />
Logged

Jet_Jaguar

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Background colors for individual photos
« Reply #2 on: December 24, 2003, 10:42:22 am »

First, it wouldn't in the actual galleries, but rather in the intermediate pages (IOW, the displayimage.php pages.)  Sorry I didn't make that clear.

Second, I don't see why all that was necessary (a byzantine numbering scheme and regular expressions?)  

It could be done simply in two ways:

1) have the user type in a BGColor value for each picture, record that value as a database entry (7 char value), assign that value to a variable, and in the page, have the table cell's background color be whatever is in the variable ( like <td bgcolor="<?php echo $bgcolor ?>" >)

-or-

2) Have the user select a color from a drop-down list, record that selection in the database, use that value as a css class (like <td class="<?php echo $bgcolor ?>" >
Logged
Admin of the Guytalk.org forums - Guys talking about guy stuff.

rbl

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 60
    • http://lomoblog.com/
Background colors for individual photos
« Reply #3 on: December 24, 2003, 11:12:42 am »

Quote from: "Jet_Jaguar"
First, it wouldn't in the actual galleries, but rather in the intermediate pages (IOW, the displayimage.php pages.)  Sorry I didn't make that clear.

Second, I don't see why all that was necessary (a byzantine numbering scheme and regular expressions?)


Using it in the displayimage.php would be a lot different and less prone to chromatic mayhem =)

I made that suggestion because it would not alter the current database scheme. Any of the solutions you provided are, of course, much simpler in conception and use than any bizantine numbering systems =)
Question is: changes to the database are rarely made and (from small bits here and there, I believe) the dev team are continuing one of Greg's quests: lighten database calls and load.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.