forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: Joachim Müller on October 06, 2004, 10:05:46 pm

Title: new feature: browsable batch-add
Post by: Joachim Müller on October 06, 2004, 10:05:46 pm
I committed a new feature that let's you decide if you want to have the "classic" view when batch-adding, or have a browsable tree in an iframe (recycling the minibrowser I originally wrote for bridgemgr.php). If the user's browser isn't capable of displaying iframes, the script will fall back to the "classic" interface. Please test-drive (especially on sub-domains and servers where the webroot equals the doc root issues might come up - I wasn't able to test those setups) and report if there are troubles. You will need to run update.php to see the option. Affected files: minibrowser.php, searchnew.php, lang/english.php, sql/basic.sql, sql/update.sql. You can toggle the option both in config and searchnew.php.
If there are issues, please move this thread to the 1.4 bugs board.

Joachim
Title: Re: new feature: browsable batch-add
Post by: kegobeer on October 06, 2004, 11:23:15 pm
Is there supposed to be a check box or something next to the image files for selection, or is it just for displaying the directories?  I just get a list.
Title: Re: new feature: browsable batch-add
Post by: Casper on October 06, 2004, 11:57:33 pm
I have the radio buttons, but I do have 2 problems with this.

1.  The 'edit' folder is shown if you click the 'ok' link, along with all other folders, even when only 1 radio button is selected .  I don't upload to there of course, but somehow there are pics there, probably left over from failed test uploads.

2.  ALL pics in the gallery are pre selected, not just new ones.
Title: Re: new feature: browsable batch-add
Post by: kegobeer on October 07, 2004, 12:01:54 am
To clarify my issue: I have radio buttons next to the directories, but nothing next to the images - just wondering if this is by design.  If so, seems kinda unnecessary to have another way to choose the directory I want to batch add from.
Title: Re: new feature: browsable batch-add
Post by: Casper on October 07, 2004, 12:32:48 am
To clarify my post.

All folders, including the edit folder are shown if you hit the 'OK' link, at the first stage, even if you have selected a button, as shown on my screenshot.

This is also when all pics are pre-selected.

If you open an individual folder first,by clicking on the name, rather than the radio button, it then works correctly.
Title: Re: new feature: browsable batch-add
Post by: Joachim Müller on October 07, 2004, 07:14:46 am
Is there supposed to be a check box or something next to the image files for selection, or is it just for displaying the directories?  I just get a list.
It's only meant as replacement for the very first step of the "classic" batch-add page, to let you choose a folder. No file selection yet.

To clarify my issue: I have radio buttons next to the directories, but nothing next to the images - just wondering if this is by design. If so, seems kinda unnecessary to have another way to choose the directory I want to batch add from.
It becomes necessary imo when you have a large structure within the albums folder, to avoid the classic interface has to run through all subdirs. This feature has been requested before, and Chris has come up with a hack - I just pushed the idea a bit further. I added a section in the docs that explains this as well. On dialup connections and and sites with large structures, it also fixes time-out issues. However it's of course negotiable wether the classic or the new interface should be default.

All folders, including the edit folder are shown if you hit the 'OK' link, at the first stage, even if you have selected a button, as shown on my screenshot.

This is also when all pics are pre-selected.

If you open an individual folder first,by clicking on the name, rather than the radio button, it then works correctly.
I removed the radio buttons. Please check out searchnew.php and minibrowser.php.

The edit folder is however not meant to show up. If it does for you, I'll have to look into this once more.

Joachim

Title: Re: new feature: browsable batch-add
Post by: Casper on October 07, 2004, 10:09:27 am
Ok, that makes it clearer what to do, and the edit folder is not shown in the list.  But if you hit the ok button at stage one, you do get the edit folder in the selection, and all pics pre-selected.

I know if you follow the instructions and don't hit the OK link until at the folder you want, it all works as planned, but we all know how many don't rtfm.

Is it possible to remove the OK link at stage 1, and only show it when on an individual folder page.
Title: Re: new feature: browsable batch-add
Post by: kegobeer on October 07, 2004, 08:49:36 pm
I managed to kill the edit and userpics directories from coming up, but no luck on the file checkboxes being filled.  Here's what I did:

In searchnew.php, find

Code: [Select]
if ($file != "." && $file != "..")
replace with

Code: [Select]
if ($file != "." && $file != ".." && $CONFIG['fullpath'] . $folder . $file != $CONFIG['fullpath'].'/edit' && $CONFIG['fullpath'] . $folder . $file != $CONFIG['fullpath'].'/'.substr($CONFIG['userpics'],0,strlen($CONFIG['userpics'])-1))
and find

Code: [Select]
if (is_dir($CONFIG['fullpath'] . $folder . $file) && substr($file,0,1) != "." && strpos($file,"'") == FALSE && $file != substr($CONFIG['userpics'],0,strlen($CONFIG['userpics'])-1)  && $file != "edit" ) {
and replace with

Code: [Select]
if (is_dir($CONFIG['fullpath'] . $folder . $file) && substr($file,0,1) != "." && strpos($file,"'") == FALSE) {
Title: Re: new feature: browsable batch-add
Post by: Joachim Müller on October 08, 2004, 09:18:17 am
hm, this is not OK imo, as minibrowser.php is used for other things (like the bridgemanager) as well. Take a look at the use of $_REQUEST['hidefolders'] - hiding the edit folder, userpics folder etc. from view is exactly what it's meant to do, as it's filled with
Code: [Select]
rawurlencode('.,..,CVS,edit,'.rtrim($CONFIG['userpics'], '/'))Each forbidden folder name is added to a list with "," as separator, the whole enchilada is made URL-save by rawurlencoding it, in minibrowser it's rawurldecoded, exloded and checked in
Code: [Select]
if (in_array($file,$hiddenfolders) == false) {I'm not sure why it doesn't work for you though...

Joachim
Title: Re: new feature: browsable batch-add
Post by: kegobeer on October 09, 2004, 02:51:23 am
I didn't alter the minibrowser file, just searchnew.  And I think the changes are better than the previous way because we might as well exclude the forbidden directories from being scanned instead of scanning them and then ignoring them.  And what if I have a directory called edit nested inside another directory, like this -> albums/uploads/edit.  The way it is now, that folder will also be excluded because it's not being compared to albums/edit, it's only being compared to edit.

I don't know why it isn't working for me on my test machine.  If I get a chance I'll upload it to my host and see if it runs correctly under their Linux server.
Title: Re: new feature: browsable batch-add
Post by: Joachim Müller on October 09, 2004, 06:54:33 am
k, will look into this as well - runs fine on my IIS test server though...

Joachim
Title: Re: new feature: browsable batch-add
Post by: kegobeer on October 12, 2004, 12:06:34 am
Joachim,

Anything new on this?
Title: Re: new feature: browsable batch-add
Post by: Joachim Müller on October 12, 2004, 07:41:15 am
sorry, not yet. I didn't have the time to work on this at all in the past few days.

Joachim
Title: Re: new feature: browsable batch-add
Post by: Joachim Müller on October 23, 2004, 10:11:55 am
Dave,

finally I had the time to look into this, and I must confess I haven't read closely enough what you were suggesting. Your fix works fine for me, and I have committed it to the devel cvs. I apologize, sorry for being a moron.

Joachim
Title: Re: new feature: browsable batch-add
Post by: kegobeer on October 23, 2004, 05:19:02 pm
No problem.  Did you figure out why all the checkboxes are filled in if a user clicks OK right away?
Title: Re: new feature: browsable batch-add
Post by: Joachim Müller on October 24, 2004, 02:38:05 pm
no, but happens as well if you manually enter http://domain.tld/coppermine/searchnew.php?startdir= when using the classic batch-add. I guess I should just grey out the ok button when the user is within the albums root dir, to force the user to browse at least one folder level deep. Do you think this would be a fix? Another option would be to show the "ok" botton only if there are no more subfolders within the folder selected (only files).

Joachim
Title: Re: new feature: browsable batch-add
Post by: Aditya Mooley on October 25, 2004, 12:25:59 pm
Another option would be to show the "ok" botton only if there are no more subfolders within the folder selected (only files).

This seems to be a better option.

Also we can check that the selected folder is not empty then only show the "Ok" button.
Title: Re: new feature: browsable batch-add
Post by: Joachim Müller on December 28, 2004, 09:26:03 am
just bumping this thread to the first page of the sub-board, will have to look into this (self-assign).

Joachim
Title: Re: new feature: browsable batch-add
Post by: Joachim Müller on January 23, 2005, 09:07:53 am
Another option would be to show the "ok" botton only if there are no more subfolders within the folder selected (only files).
Committed to dev branch. Please check out minibrowser.php, test and report back. Thanks.

Joachim
Title: Re: new feature: browsable batch-add
Post by: Joachim Müller on February 18, 2005, 08:54:17 am
as silence means approval, I guess everybody is happy with this fix, so I'll mark this thread as "fixed".

Joachim