forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: vesodimov on October 24, 2012, 02:30:27 pm

Title: About new albums
Post by: vesodimov on October 24, 2012, 02:30:27 pm
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
Title: Re: About new albums
Post by: Αndré on October 25, 2012, 11:24:07 am
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.
Title: Re: About new albums
Post by: vesodimov on October 25, 2012, 01:08:04 pm
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
Title: Re: About new albums
Post by: Α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.
Title: Re: Re: About new albums
Post by: vesodimov on October 25, 2012, 02:46:59 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".
Title: Re: About new albums
Post by: Αndré on October 25, 2012, 07:05:27 pm
Open cpg15x_config.
Title: Re: Re: About new albums
Post by: vesodimov on October 25, 2012, 09:04:28 pm
Open cpg15x_config.
In cpg15x_config no row with the name "upload_create_album_directory" .
Title: Re: About new albums
Post by: Αndré on October 26, 2012, 06:40:24 am
Then add a new row.
Title: Re: Re: About new albums
Post by: vesodimov on October 26, 2012, 09:48:19 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.
Title: Re: About new albums
Post by: Αndré on October 26, 2012, 04:53:27 pm
Just execute the following query in PHPMyAdmin:
Code: [Select]
INSERT INTO cpg15x_config (name, value) VALUES ('upload_create_album_directory', '1');
Title: Re: Re: About new albums
Post by: vesodimov on October 27, 2012, 01:36:29 pm
Just execute the following query in PHPMyAdmin:
Code: [Select]
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
Title: Re: About new albums
Post by: Αndré on October 29, 2012, 02:44:46 pm
Please post a link to your gallery and a test user account with upload privileges.
Title: Re: Re: About new albums
Post by: vesodimov on October 29, 2012, 03:24:38 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 ...
Title: Re: About new albums
Post by: Α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.
Title: Re: Re: About new albums
Post by: vesodimov on October 29, 2012, 06:40:09 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]
Title: Re: About new albums
Post by: Αndré on October 30, 2012, 10:03:31 am
I just removed the provided FTP data. Please post a Coppermine user account.
Title: Re: Re: About new albums
Post by: vesodimov on October 30, 2012, 11:37:11 am
I just removed the provided FTP data. Please post a Coppermine user account.
user: andre
pass: 112233
Title: Re: About new albums
Post by: Αndré on October 30, 2012, 12:39:24 pm
Works as expected in my testbed, but not in your gallery. Please attach your zipped upload.php file to your next reply.
Title: Re: About new albums
Post by: vesodimov on October 30, 2012, 01:07:04 pm
Hi.
Title: Re: About new albums
Post by: Αndré on October 30, 2012, 02:08:36 pm
Weird. The code says
Code: [Select]
        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.
Title: Re: About new albums
Post by: vesodimov on October 30, 2012, 02:35:22 pm
This is my config DB. Please see it.
Title: Re: About new albums
Post by: Αndré on October 30, 2012, 02:38:58 pm
Obviously this is a different table. It doesn't contain the row upload_create_album_directory. The table prefix in your screenshot is cpg15x_, the attached table's prefix is gallery_.

Execute this query:
Code: [Select]
INSERT INTO gallery_config (name, value) VALUES ('upload_create_album_directory', '1');
Title: Re: Re: About new albums
Post by: vesodimov on October 30, 2012, 03:00:02 pm
Obviously this is a different table. It doesn't contain the row upload_create_album_directory. The table prefix in your screenshot is cpg15x_, the attached table's prefix is gallery_.

Execute this query:
Code: [Select]
INSERT INTO gallery_config (name, value) VALUES ('upload_create_album_directory', '1');
Sorry. That's my mistake. gallery_config is correct table.
I execute a query /insert data in SQL window and push Go /. Then i see new table in gallery_config. With Album manager i make new album called "2249" and upload a pictures in. But when I enter through FTP I can's see a folder "2249". That is my problem  ???