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: Are check boxes or drop downs possible in File Information Custom Fields?  (Read 3769 times)

0 Members and 1 Guest are viewing this topic.

bbouton

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 10
  • Commit a random act of kindness.
    • The Member Showcase at TheBoutons.com Home of All Things Graphical

Are check boxes or drop downs possible in File Information Custom Fields?

I would like an easy way to provide my members with a way to choose a Creative Commons or other copyright declaration. It would be nice if the choice in the actual File Info display was hyperlinked as well. What I mean is if the member marks an image, by choosing a check box or a drop down item with a specific Creative Commons license, that the visitor display of that member choice is the Creative Commons Logo button that links to the Creative Commons license description.

I also want to provide an easy way for members to enter Release Info -- Model Released
Not Model Released
Minor Released
Not Minor Released
Site Released
Not Site Release

Thank you,
Barbara Bouton
« Last Edit: May 25, 2006, 01:00:00 am by Paver »
Logged
bbouton
At http://TheBoutons.com download free bonus chapters from Gary's newest book, Photoshop Elements AIO Desk Reference for Dummies. Register, and show your best work in TheBoutons.com Member Showcase.

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.

I've also been eyeing my custom fields with scheming eyes.  So far, I haven't done more than write a plugin to select which fields are shown in the file information box.

For the dropdown/checkboxes when using editpics.php, you'd have to modify the script or use a plugin to replace the current <input> with your desired <input> (using the "page_html" plugin filter since editpics.php doesn't have any plugin hooks directly in it).  For modifying the script, you'll see that the form is generated using an array of fields and then functions to create each field.  You'll see the custom fields in this array - for example here's the first custom user field:
Code: [Select]
array($CONFIG['user_field1_name'], 'user1', 0, 255),There is a function to display the album dropdown box, but that function is particular to the album dropdown so you cannot re-use it for your own dropdown.  You could use it as a model for writing your own function to create the dropdown or checkboxes, as desired.  Make sure to put comments around all lines in your modification so you can easily apply these modifications to future versions of Coppermine.

For display of the fields (including hyperlinks), the plugin filter to use is "file_info".  The plugin "Display Fields" (mentioned above) would be a good example to show how to do so since it allows you to unset file information fields.  Change that to showing hyperlinks or whatever for particular fields and you'll all set.

You should also be able to do the display with a theme customization, but it might be difficult - I'm not sure without looking into it more.  I would go the plugin route because that would be fairly easy.

If you want to write the code, go ahead.  Otherwise, I cannot say when I'll get to it.  It's on my "to do" list, which is unfortunately quite long.
Logged

bbouton

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 10
  • Commit a random act of kindness.
    • The Member Showcase at TheBoutons.com Home of All Things Graphical

Thank you Paver for such a thoughtful answer. I've downloaded your plugin because it looks like it could be very useful in my pursuit to balance the display of as much info as possible vs reducing clutter. Thank you for making it. and sharing it.

I wish that this was a programming challenge I could take on; but  while I am good at puzzling stuff out, following or writing instructions and tutorials, DTP, graphics, and gardening I lack the programming skills this would require. I guess I am going to have to use the custom fields as is for now and hope that your to do list gets shorter (as if that ever happens :)).
Logged
bbouton
At http://TheBoutons.com download free bonus chapters from Gary's newest book, Photoshop Elements AIO Desk Reference for Dummies. Register, and show your best work in TheBoutons.com Member Showcase.

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.

You're welcome for the response.  It was easy since I have already been considering such things myself.

I'll mark this thread "closed" since the answer as a support question (for features already in Coppermine) is "No, this is not possible without a mod/plugin".  I think that's the proper use of the "Closed" tag - I'm sure another dev will speak up if not so I'll know how to properly use this tag.

As an FYI, my "to do" list has no set order.  For plugins, I do what I want to get done for my personal gallery weighted by difficulty/time (which I assess by thinking about it as you can see in my response above).  The main issue with getting this specific request done is that I have in mind an overhaul of the custom fields to allow lots of different functions that I want, which requires a larger organization and more code.  So that pushes it down for difficulty- or time-sake.  But one bright note is that I often write the simpler implementations first so I can get things functioning then add complexity from there.  So, I guess the bottom line is "who knows?".  :-\
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.