new feature: browsable batch-add new feature: browsable batch-add
 

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

new feature: browsable batch-add

Started by Joachim Müller, October 06, 2004, 10:05:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joachim Müller

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

kegobeer

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.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Casper

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.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

kegobeer

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.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Casper

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.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Joachim Müller

Quote from: 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.
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.

Quote from: 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.
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.

Quote from: Casper on October 07, 2004, 12:32:48 AM
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


Casper

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.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

kegobeer

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

if ($file != "." && $file != "..")

replace with

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

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

if (is_dir($CONFIG['fullpath'] . $folder . $file) && substr($file,0,1) != "." && strpos($file,"'") == FALSE) {
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Joachim Müller

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 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 inif (in_array($file,$hiddenfolders) == false) {
I'm not sure why it doesn't work for you though...

Joachim

kegobeer

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.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Joachim Müller

k, will look into this as well - runs fine on my IIS test server though...

Joachim

kegobeer

Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Joachim Müller

sorry, not yet. I didn't have the time to work on this at all in the past few days.

Joachim

Joachim Müller

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

kegobeer

No problem.  Did you figure out why all the checkboxes are filled in if a user clicks OK right away?
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Joachim Müller

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

Aditya Mooley

Quote from: GauGau on October 24, 2004, 02:38:05 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.
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

Joachim Müller

just bumping this thread to the first page of the sub-board, will have to look into this (self-assign).

Joachim

Joachim Müller

Quote from: GauGau on October 24, 2004, 02:38:05 PM
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

Joachim Müller

as silence means approval, I guess everybody is happy with this fix, so I'll mark this thread as "fixed".

Joachim