Creating Custom Fields Creating Custom Fields
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Creating Custom Fields

Started by PvtPulse, February 17, 2015, 07:58:25 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

PvtPulse

Is there any way to create a custom field? I would like for photos over 1600px to be able to have a "HQ" tag on it.

netb

What do you mean by a custom field? You could use the keywords for this purpose.

allvip

Maybe this can help Custom fields for image descriptions http://forum.coppermine-gallery.net/index.php/topic,72352.0.html

If you do a search on the forum you will find more topics about custom fields.

PvtPulse

For instance. When uploading, i would like to either:

- be able to check a box, to let the gallery know that the photo is HQ
or
- The  gallery be able to see that the file dimensions are greater than 2000px.

WHEN the gallery is noticed to be HQ, on the album view (http://chrisbrownfan.com/photos/thumbnails.php?album=146) under the photo there will be a customized tag like *HQ*.

PvtPulse


netb

You want this to happen automatically you mean?

PvtPulse

Yer or no. Either I want it to notice the image size in the mysql or give me an option box to check in order to apply the tag.

netb

But there is already such a feature in coppermine http://documentation.coppermine-gallery.net/en/keywords.htm I don't understand what do you need. Can't you use the keywords they are the same thing as "tags".

netb


PvtPulse

I don't think my thoughts are coming across clearly, so I made a little mock-up of what I'm trying to accomplish. I hope that's ok.

http://i.imgur.com/uvoVirf.png

ron4mac

What you are looking to accomplish can be pretty easily done by a bit of modification to the theme.php file in your theme folder. If one of an image's dimensions is above a certain pixel count threshold or the image has a certain keyword (e.g. *HQ*), then some sort of indicator could be displayed along with the thumbnail. No "additional fields" would need to be added.

PvtPulse

Quote from: ron4mac on March 02, 2015, 06:19:18 AM
What you are looking to accomplish can be pretty easily done by a bit of modification to the theme.php file in your theme folder. If one of an image's dimensions is above a certain pixel count threshold or the image has a certain keyword (e.g. *HQ*), then some sort of indicator could be displayed along with the thumbnail. No "additional fields" would need to be added.

EXACTLY what I'm looking for! Can you show me a guide on how to do it, or give me a mock-up? I've been trying to do this for a while now.

ron4mac

Quote from: PvtPulse on March 04, 2015, 04:12:56 PM
EXACTLY what I'm looking for! Can you show me a guide on how to do it, or give me a mock-up? I've been trying to do this for a while now.
What theme are you using? (if it is freely available)

PvtPulse

It is based off the CURVE theme.

ron4mac

Quote from: PvtPulse on March 04, 2015, 11:18:53 PM
It is based off the CURVE theme.
If the site where you want this is chrisbrownfan.com, it looks like it might be water_drop instead.
At any rate, if you attach the theme.php file from your theme folder, I'll put something in place for you to work with. It may not be able to key off keywords but should work for some image dimension thresholds.

PvtPulse

Quote from: ron4mac on March 05, 2015, 01:52:31 AM
If the site where you want this is chrisbrownfan.com, it looks like it might be water_drop instead.
At any rate, if you attach the theme.php file from your theme folder, I'll put something in place for you to work with. It may not be able to key off keywords but should work for some image dimension thresholds.

Ok, thanks for the info. When I opened the theme.php...it was empty. So I zipped the whole theme folder, maybe you can see something that I'm missing. I know I'm using this on a fresh install, so if this is water_drop, then It is based off the original theme that comes with the download.

ron4mac

#16
Quote from: PvtPulse on March 05, 2015, 07:39:10 AM
I know I'm using this on a fresh install
Your site is using CPG 1.5.30 ... you really should upgrade to 1.5.34. I'll be making the mod for you based on the 1.5.34 release (which should be okay whether you upgrade your site or not). It may be a day or two (or 3) before I have time to do this for you.

PvtPulse


ron4mac

Set the image dimension thresholds as you desire at the top of the theme.php file. And set the .thumb_iq class(es) in the style.css file to suit your needs.

PvtPulse

OMG! THANK YOU SO MUCH! U are the best! U brought my thoughts to life!!!