News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

Recent posts

#1
cpg1.6 miscellaneous / Re: Can admin assign pid?
Last post by treehstn - Today at 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?
#2
Feature requests / Re: Old thumbnail creation met...
Last post by AnnieHoney - Today at 05:46:04 PM
It doesn't show when building all folders
Just the progression bar that stops
#3
cpg1.6 miscellaneous / Re: Can admin assign pid?
Last post by 406man - Today at 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.
#4
cpg1.6 miscellaneous / Re: Can admin assign pid?
Last post by treehstn - Yesterday at 08:20:19 PM
I need a unique ID number added to every uploaded file.  It needs to be in a certain format, i.e. something like FAM-PH-00001.  This number will never change. It would be ideal if the system added them itself as long as they were in a pre-determined format.  Users should be able to see the numbers on each photo but shouldn't be able to change them.  The admin should be able to change them but if working properly should not have to. 

I wasn't sure if the pid number might work but only if I could change the format of the number so that it had whatever prefix was needed for that database.  This project is going to have multiple databases. 
#5
cpg1.6 miscellaneous / Re: Can admin assign pid?
Last post by ron4mac - Yesterday at 05:06:31 PM
It's not totally clear to me what you are looking to accomplish. The 'pid' is an integer value that is entered in the database for each file that is added to the gallery. Am I correct in guessing that you want a value saved somewhere, for each uploaded image, that consists of some prefix followed by the 'pid', as recorded in the database? Example: FAM-BIO-<Db pid>
Having that happen automatically could only happen with some crafted plugin.

I think a plugin that automatically adds that value to the user4, for example, database field might work. There is a plugin that can show that field along with the thumbnail display.
#6
Feature requests / Re: Old thumbnail creation met...
Last post by ron4mac - Yesterday at 04:49:19 PM
Hmmm ... it does normally display what files it has issues with. Make sure the version of CPG is the latest. Without admin access to your site, there isn't a way to determine what the problem could be.
#7
cpg1.6 miscellaneous / Can admin assign pid?
Last post by treehstn - August 09, 2026, 08:59:40 PM
I have a situation where I'm building a large multifaceted system using several programs which uses Coppermine for the images.  I need a field that is a unique image ID but I want to be able to say what the prefix is.  It might be something like FAM-PH-0000001. There will be multiple Coppermine databases so another might have the prefix of FAM-REC-0000001 or FAM-BIO-0000001. It's important that the ID's be unique across the database and the user's should not have access to add or change that field.  But it does need to be viewed on the image view by anyone looking at it. Ideally the number would be automatically assigned to each photo as they are being uploaded but if I have to go in manually and add them as images are loaded that would work also.

I tried to find the pid in the database and couldn't locate it.

Is this possible? Maybe by using one of the custom fields in the image description but I'd have to be able to limit who can change that field...
#8
Feature requests / Old thumbnail creation method
Last post by AnnieHoney - August 09, 2026, 01:58:16 PM
The old thumbnails updated method would give you the image number where an error ocurred in it's URL. Now, it just stops the bar and I don't know where it stopped last.

Is there a way to see the ID number of the image that caused the error and the update to stop?
#9
cpg1.6 plugins / Re: serch for a "userpics to s...
Last post by ron4mac - August 04, 2026, 08:23:27 PM
That would have to be modified to work with CPG 1.6
I've modified a copy of the FileMove plugin to work with only 250 files at a time. Maybe that can work for you. ( I have no way to fully test it )
#10
cpg1.6 plugins / Re: serch for a "userpics to s...
Last post by Chris99 - August 04, 2026, 10:54:28 AM
Hi, thank you. Ive tried this tool, but it seems there are too many files (500.000) in userpics folder. I get a white page and nothing happens.... neither after 30 min...


Andre wrote this tool, it works perfect in those days with 1.5, does it work also with 1.6?

Thank you.
 
<?php
define
('IN_COPPERMINE'true);
define('DB_INPUT_PHP'true);
require(
'include/init.inc.php');

if (!
GALLERY_ADMIN_MODE) {
    
cpg_die(ERROR$lang_errors['access_denied']);
}

$limit 50;
$result cpg_db_query("SELECT pid, aid, filepath, filename FROM {$CONFIG['TABLE_PICTURES']} WHERE filepath LIKE '{$CONFIG['userpics']}%' AND filepath NOT LIKE CONCAT('%/', aid, '/') LIMIT $limit");

if (
mysql_num_rows($result)) {
    
pageheader('Moving''<meta http-equiv="refresh" content="1; URL='.$CPG_PHP_SELF.'">');
    echo 
'<table width="100%"><tr><td class="tableh1" width="50%">File</td><td class="tableh1" width="50%">Moved to</td></tr>';
} else {
    
pageheader('Done');
    echo 
'<table width="100%"><tr><td>Done.</td></tr>';
}

while (
$row mysql_fetch_assoc($result)) {
    
$dest_dir_sql $row['filepath'].$row['aid'].'/';
    
$dest_dir $CONFIG['fullpath'].$dest_dir_sql;
    
$src_dir $CONFIG['fullpath'].$row['filepath'];
    
$images = array($row['filename'], $CONFIG['normal_pfx'].$row['filename'], $CONFIG['thumb_pfx'].$row['filename'], $CONFIG['orig_pfx'].$row['filename']);

    if (!
is_dir($dest_dir)) {
        
mkdir($dest_diroctdec($CONFIG['default_dir_mode']));
        if (!
is_dir($dest_dir)) {
            
cpg_die(CRITICAL_ERRORsprintf($lang_db_input_php['err_mkdir'], $dest_dir), __FILE____LINE__);
        }
        @
chmod($dest_diroctdec($CONFIG['default_dir_mode'])); //silence the output in case chmod is disabled
        
$fp fopen($dest_dir '/index.php''w');
        
fwrite($fp' ');
        
fclose($fp);
    }

    foreach (
$images as $image) {
        if (!
file_exists($src_dir.$image)) {
            continue;
        }
        if (!
rename($src_dir.$image$dest_dir.$image)) {
            
cpg_die(CRITICAL_ERRORsprintf($lang_db_input_php['err_move'], $src_dir.$image$dest_dir), __FILE____LINE__);
        } else {
            echo 
'<tr><td>'.$src_dir.$image.'</td><td>'.$dest_dir.'</td></tr>';
        }
    }

    
cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET filepath = '$dest_dir_sql' WHERE pid = {$row['pid']}");
}

echo 
'</table>';
pagefooter();