Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Once the users uses imce and leaves it in a directory, when the users logins again, imce shows the same directory where he was. So,
How do i write the imce link, so it always show the default directory? [.]
Another question.
I want each users has a private dir, that only him can see it (not only the content, but it shouldn't be shown in the directory tree), but that the admin can see it.
Thanks
Comment | File | Size | Author |
---|---|---|---|
#3 | imce-283707.patch | 2.51 KB | jcisio |
Comments
Comment #1
hexbase CreditAttribution: hexbase commentedIm using IMCE stand-alone version.
Comment #2
ufku CreditAttribution: ufku commented/imce?dir=. starts from root
/imce?dir=images starts from root/images
Comment #3
jcisio CreditAttribution: jcisio commentedWhen we use PHP in the directory name, it would change (for example images/y/m/d), and the day after the user is at the wrong place.
The 'dir=' parameter is something in the WYSIWYG editor and normally it is not configurable. So it would be nice if imce have an option to use the first allowed directory as the default start when the $dir parameter is not specified.
I have a patch for this.
Comment #4
3dloco CreditAttribution: 3dloco commentedHello Jcisio,
Thanks for this patch! I've been looking for a way to set the default starting directory to the user's own directory, like files/[uid] using tokens if possible.
To start, I'd like first to check with you whether your patch above is for 6.x-1.0 or 6.x-1.3.
Thanks,
KH
Comment #5
jcisio CreditAttribution: jcisio commentedI can't remember, but in looking at it, this patch should be usable for both 1.3 and 1.x-dev.
Comment #6
ufku CreditAttribution: ufku commented6.x-2.x does not use session if the profile uses a single directory with no sub-directories under it.
Comment #7
jcisio CreditAttribution: jcisio commentedEuh, I have not tested the 2.x, but what happens if a profile has multiple directories? For example, the first one (/files/uid or /files/year/month/day) with read/write permission and the second (/files or /files/common) with read only permission. My patch tries to always open the first directory on start.
Comment #8
ufku CreditAttribution: ufku commentedSorry, that's a very rare case.
You can always unset($_SESSION['imce_directory']) in the template.php
Comment #9
petu CreditAttribution: petu commentedThere is an easy way to do it for Drupal 6:
After these changes default directory for IMCE will be /sites/default/files/2012. The old directory /sites/default/files will be accessible too.
Comment #10
jcisio CreditAttribution: jcisio commentedThanks, petu, but it's not what I want. I don't use "2012" for the default directory, but I use PHP to return a value that change from day to day (date('y/m/d') for instance). Secondly, of course I want "2012" to be accessible, but I also want that if the last time, I was in 2012/1/6, today I visit, IMCE should not pick this folder as default (even it is always accessible for read, not for write), but it should pick "2012/1/9".
I've used the method suggested in #8 for nearly two years now, and it works great.