News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

Main Menu

Recent posts

#1
cpg1.6 miscellaneous / Re: Can admin assign pid?
Last post by treehstn - Today at 09:03:42 PM
Yes, and some of the galleries are going on different domains so having separate galleries makes sense.  I'm thinking of each photo as the same as specimens in a museum.  Being able to easily find specific ones is going to be important. I'll be writing several books that will have some of the photos in them and want to put the image number in the caption so it can be found easily.  I don't have a lot of confidence in my users (family) changing all of their image names on their computers to what the system will assign so if the file name in coppermine includes their name by default and then adds the prefix I think that will work for everyone.

Yes, other software will potentially be accessing the gallery databases and links may be used in other documents also. 
#2
cpg1.6 miscellaneous / Re: Can admin assign pid?
Last post by ron4mac - Today at 04:30:09 PM
I can see why you might want more than one gallery. And I can see why you might want a reference id attached to each uploaded item. What is not clear to me is how that reference id would be used external to the galleries. Will there be other software that accesses the databases of all the galleries? If not, will just links to gallery items be used in other documents?
#3
cpg1.6 miscellaneous / Re: Can admin assign pid?
Last post by treehstn - Yesterday at 09:20:33 PM
I'm working on designing a project that really is going to be my life's work.  I'm a genealogist who is transforming into a family archivist.  Instead of using just a family tree program as I have for the last 20 years or so, I'm going to be adding databases of information, documents, books, articles, indexes of thousands of records, etc. One of the databases is Coppermine which will manage all of the scans of photos and documents.  I'm not going to be the only person adding to Coppermine.  My whole family will be able to add images. The unique identifier has to be just that in order for the images to be easily id'd in whatever other part of the system it might be referred to.  It needs to be something that never changes and is not too cumbersome for an average user of the system to be able to work with.

To give you an idea of the scope of the project, my mother's research is completely on paper. All notes and photo copies are hard copy.  I have about 50 large plastic tubs of her research that needs to be organized and scanned which a rough estimate of size is about 115 cubic feet of papers.  My research is almost completely on the computer and is of a similar scope.  Then add in a couple of dozen family members that will be contributing their data and images.

So you can get an idea of why this single number is going to be very important and I have to get it right the first time around.  I don't want to jump the gun and certainly don't want anyone spending time building anything until I'm sure of what it needs to be beforehand.

Now that I've thought about it for a bit I think that I'm getting more hung up on how to format the actual prefix than I am on what the plugin requirements might be. 
#4
cpg1.6 miscellaneous / Re: Can admin assign pid?
Last post by ron4mac - Yesterday at 03:04:55 PM
Maybe if you try to articulate, with detail, the big picture of what you are trying to accomplish, some of us may have some good suggestions as to how that could be best achieved.
#5
cpg1.6 miscellaneous / Re: Can admin assign pid?
Last post by treehstn - August 12, 2026, 07:39:13 PM
Quote from: ron4mac on August 12, 2026, 03:28:40 PMIf that method (prefix on the filename) will work for what you are tying to do, I will build a suitable plugin that you will be able to use. Let me know .. and then give me a few days to put it together.

I'm going to need a couple of days at most for me to work through if this will work.  That is just fantastic that you'd be willing to do this!  I am no web programmer for sure and would just be fumbling through trying to do it on my own.  I really appreciate it!  I'll let you know as soon as I'm sure it will work for what I'm doing.

Thank you!!
#6
cpg1.6 miscellaneous / Re: Can admin assign pid?
Last post by ron4mac - August 12, 2026, 03:28:40 PM
If that method (prefix on the filename) will work for what you are tying to do, I will build a suitable plugin that you will be able to use. Let me know .. and then give me a few days to put it together.
#7
cpg1.6 miscellaneous / Re: Can admin assign pid?
Last post by 406man - August 12, 2026, 09:38:45 AM
Here's the long answer to your question. A plugin hook is just a place where a custom-written PHP function - a plugin - is called.

Here's an example of a plugin call which I took from line 301 of uniload.php

$picture_name = CPGPluginAPI::filter('upload_file_name', $picture_name);
The plugin being called allows you to manipulate the file name of the image and it's definitely possible to add a prefix to the existing file name. Your plugin PHP code will include something like this in its main file of PHP code - codebase.php

function myplugin($picfilename) {
    $picfilename = `prefix` . $picfilename;
    return $picfilename;
}
There's a lot more to a plugin than just the above. The prefix has to come from somewhere, for example. Hopefully it helps with explaining some of the basic principles.

Plugins are documented here:
https://coppermine-gallery.com/docs/curr/en/dev_plugins.htm

Plugin hooks are here:
https://coppermine-gallery.com/docs/curr/en/dev_plugin_hooks.htm
#8
cpg1.6 miscellaneous / Re: Can admin assign pid?
Last post by treehstn - August 11, 2026, 08:37:45 PM
Thank you for the info!  Do you think there's any chance the "upload_file_name" plugin hook could add the unique identifier to the beginning of the user's file name so there would be both in that field?
#9
Feature requests / Re: Old thumbnail creation met...
Last post by AnnieHoney - August 11, 2026, 05:46:04 PM
It doesn't show when building all folders
Just the progression bar that stops
#10
cpg1.6 miscellaneous / Re: Can admin assign pid?
Last post by 406man - August 11, 2026, 11:18:44 AM
Having written a few plugins my view is that the pid (Picture ID) is too widely used to risk changing it and in any case its data type is integer so you are restricted to a number. It's not possible to use this for something like "FAM-REC-0000001" as it's the wrong data type.

Instead, I think there might be a realistic solution in changing the file name. This could include your unique identifier in some way. The file name would be changed when uploading the image. There is a plugin hook "upload_file_name" which allows you to add your own code in the right place. There are numerous places where CPG displays the file name automatically so this might provide what you need.

Another possibility is to use the add_file_data plugin to manipulate the information stored when an image is uploaded. For example adding your unique identifier as a prefix to the Title field. This will clearly show the identifier in the Title when an image is displayed.

We can guide you if you need help with creating a plugin.