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

CommentFileSizeAuthor
#3 imce-283707.patch2.51 KBjcisio
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hexbase’s picture

Im using IMCE stand-alone version.

ufku’s picture

/imce?dir=. starts from root
/imce?dir=images starts from root/images

jcisio’s picture

Status: Active » Needs review
FileSize
2.51 KB

When 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.

3dloco’s picture

Issue tags: +imce, +PHP, +default directory, +starting directory

Hello 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

jcisio’s picture

Version: 6.x-1.0 » 6.x-1.x-dev

I can't remember, but in looking at it, this patch should be usable for both 1.3 and 1.x-dev.

ufku’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Needs review » Fixed

6.x-2.x does not use session if the profile uses a single directory with no sub-directories under it.

jcisio’s picture

Status: Fixed » Active

Euh, 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.

ufku’s picture

Status: Active » Closed (won't fix)

Sorry, that's a very rare case.
You can always unset($_SESSION['imce_directory']) in the template.php

petu’s picture

There is an easy way to do it for Drupal 6:

  1. Create a new dir for default location inside /sites/default/files. For example /sites/default/files/2012 .
  2. Edit IMCE profile. Go to /admin/settings/imce/profiles and edit your profile.
  3. In "Directories"-settings in the first field enter new directory /sites/default/files/2012 .
  4. In the second Directorie's field enter dot-sign ".".
  5. Check options "Including subdirectories" for both options.
  6. Save settings.

After these changes default directory for IMCE will be /sites/default/files/2012. The old directory /sites/default/files will be accessible too.

jcisio’s picture

Thanks, 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.