forum.coppermine-gallery.net

Support => Older/other versions => cpg1.3.x Support => Topic started by: bpops on September 21, 2005, 05:58:38 am

Title: set ablum DEFAULT to "Visitors can upload files"=yes?
Post by: bpops on September 21, 2005, 05:58:38 am
Hello, I am really enjoying setting up my coppermine gallery, and was wondering if there was a way to set the album to allow visitors to upload files by default?
I plan on having a large gallery I want all my members to be able to upload to, and I don't want to spend the time setting each album individually.
Thanks for the help.

And Thanks to the dev team for this great product!

Bpops
Title: Re: set ablum DEFAULT to "Visitors can upload files"=yes?
Post by: Abbas Ali on September 21, 2005, 07:59:42 am
If you know how to use phpMyAdmin, then this would be very easy.

Open your database in phpMyAdmin and run following query

Quote
ALTER TABLE `cpgPrefix_albums` CHANGE `uploads` `uploads` ENUM( 'YES', 'NO' ) DEFAULT 'YES' NOT NULL

Replace cpgPrefix with table prefix you used for coppermine.

Note : This will affect only the new albums which you create from now onwards.
Title: Re: set ablum DEFAULT to "Visitors can upload files"=yes?
Post by: bpops on September 22, 2005, 04:44:27 am
thanks so much!
I'll do this now
Title: Re: set ablum DEFAULT to "Visitors can upload files"=yes?
Post by: bpops on September 22, 2005, 04:53:05 am
hmm.. okay I used phpmyadmin and ran the code with myprefix. I checked the table strucutre and it did work. the default value is now set to YES.
although when I make a new table, it still is NO. I suppose the php in the gallery sets it to NO. so do you (or anyone else) know where in the code this is set? I'd like to change it
Title: Re: set ablum DEFAULT to "Visitors can upload files"=yes?
Post by: Abbas Ali on September 22, 2005, 07:43:05 am
Edit delete.php

Find and REPLACE (somewhere around line 253)

Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos) VALUES ('$category', '" . addslashes($op['album_nm']) . "', 'NO',  '{$op['album_sort']}')";

with

Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos) VALUES ('$category', '" . addslashes($op['album_nm']) . "', 'YES',  '{$op['album_sort']}')";

Title: Re: set ablum DEFAULT to "Visitors can upload files"=yes?
Post by: bpops on September 22, 2005, 03:56:13 pm
Thanks again, I'll do this as soon as I get home.
You can mark this as solved as I'm sure it will work now!