About new albums About new albums
 

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]

Main Menu

About new albums

Started by vesodimov, October 24, 2012, 02:30:27 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

vesodimov

Hi.
When i upload a pictures everithing is going to folder 10001. How make every upload in diferent album ? Today i upload pictures of my birthday. All is in folder 1001. I watn coppermine make a diferent album for this. How ?
Regards

Αndré

Please don't mix the terms "album" and "folder". Albums will be created with the album manager (with the help of your web browser). Folders will be created in the file system, usually via FTP or automatically by Coppermine.

I guess you want Coppermine to create sub-folders on file system level for each album, right? If so, there's a hidden config option upload_create_album_directory. You have to manually set the value to one in your database's config table, using a tool like PHPMyAdmin.

vesodimov

Hi.
Thank you for answer. Yes, I want when I make a album with album manager Coppermine to create sub-folders on file system level for each album. But your explanations are too complexed to me. If you have a time please tell me when and how manually set the value to one in my database's config table.
Regards

Αndré

Open your Coppermine database with PHPMyAdmin (or your favorite tool), and you'll see a couple of tables. Now just find the row with the name upload_create_album_directory and change its value to '1' in the config table.

vesodimov

Quote from: Αndré on October 25, 2012, 02:16:37 PM
Open your Coppermine database with PHPMyAdmin (or your favorite tool), and you'll see a couple of tables. Now just find the row with the name upload_create_album_directory and change its value to '1' in the config table.
This is a list of my Coppermine DB tables. Here is not "upload_create_album_directory".

Αndré


vesodimov

Quote from: Αndré on October 25, 2012, 07:05:27 PM
Open cpg15x_config.
In cpg15x_config no row with the name "upload_create_album_directory" .

Αndré


vesodimov

Quote from: Αndré on October 26, 2012, 06:40:24 AM
Then add a new row.
This is not for me. I give up  :-[
But this is idea: if you want make this in next update of Coppermine. Will be great  ;)
Thanx and have a nice day.

Αndré

Just execute the following query in PHPMyAdmin:
INSERT INTO cpg15x_config (name, value) VALUES ('upload_create_album_directory', '1');

vesodimov

Quote from: Αndré on October 26, 2012, 04:53:27 PM
Just execute the following query in PHPMyAdmin:
INSERT INTO cpg15x_config (name, value) VALUES ('upload_create_album_directory', '1');
I open PHPMyAdmin and execute this. Result - new row with this data. But this is not working. I make album in Album manager, upload a pictures bur there is not new folder.  :-X

Αndré

Please post a link to your gallery and a test user account with upload privileges.

vesodimov

Quote from: Αndré on October 29, 2012, 02:44:46 PM
Please post a link to your gallery and a test user account with upload privileges.
Hi.
I want to send you copy of DB. How do that ? I dont see how send you personal message ...

Αndré

Please post the link and the test user account (no admin account!) in this topic. After your issue is solved, we remove that data by request.

vesodimov

#14
Quote from: Αndré on October 29, 2012, 03:32:48 PM
Please post the link and the test user account (no admin account!) in this topic. After your issue is solved, we remove that data by request.

http://vesodimov.eu/gallery/

[removed FTP data]

Αndré

I just removed the provided FTP data. Please post a Coppermine user account.

vesodimov

Quote from: Αndré on October 30, 2012, 10:03:31 AM
I just removed the provided FTP data. Please post a Coppermine user account.
user: andre
pass: 112233

Αndré

Works as expected in my testbed, but not in your gallery. Please attach your zipped upload.php file to your next reply.

vesodimov

Hi.

Αndré

Weird. The code says
        if ($CONFIG['upload_create_album_directory']) {
            $filepath .= '/'.$album;
            $dest_dir .= '/'.$album;
            if (!is_dir($dest_dir)) {
                mkdir($dest_dir, octdec($CONFIG['default_dir_mode']));
                if (!is_dir($dest_dir)) {
                    echo sprintf('error|'.$lang_db_input_php['err_mkdir'].'|1', $dest_dir);
                    exit;
                }
                @chmod($dest_dir, octdec($CONFIG['default_dir_mode'])); //silence the output in case chmod is disabled
                $fp = fopen($dest_dir . '/index.php', 'w');
                fwrite($fp, ' ');
                fclose($fp);
            }
        }


As creating the directory userpics/10002 worked as expected and the same code is used to create the sub-directory, it seems that the whole code block isn't executed (otherwise you'll get a error message if creating the directory fails). So the only reason is, that $CONFIG['upload_create_album_directory'] is false, so please double check your database's config table.