Page 1 of 1

Subfolders name in userupload directory

Posted: 08 Jun 2014, 18:08
by peppesba
Hi,
I'm an old user of Phocadownload and never had problems or issues about this component that I found is probably the best among all.
But now I have a request to do having a particular situation to solve (not linked to Phocadownload).
I need that subfolders in userupload (actually named i.e. 1243844491) be named as the real name of the user (i.e. John).
I'm working in a static situation (users that can upload are only 12 now and after) so I can also modify database ... table ... code and so on.
How can I solve this particual and personal problem?
Thanks
Joseph

Re: Subfolders name in userupload directory

Posted: 09 Jun 2014, 10:53
by Jan
Hi, not sure but maybe you need to customize the part of code which creates the subfolders:

But not sure which version of Phoca Download you are using, but e.g. in version 3, the users folders are named by user names:

components\com_phocadownload\models\user.php

$userFolder = htmlspecialchars(strip_tags($user->username));

Jan

Re: Subfolders name in userupload directory

Posted: 09 Jun 2014, 19:42
by peppesba
Hi Jan,
thanks a lot for your reply.
I forgot to say that my version was 2.1.9 but after your replay I examined the code you indicate me so I simply made a substitution in module user.php.

I replaced in the line 495 the code for version 2.1.9
$userFolder = substr(md5($user->username),0, 10);

with the code for version 3.0 (that you said to me)
$userFolder = htmlspecialchars(strip_tags($user->username));

and all worked perfectly for me.
Again thanks a lot
Joseph

Re: Subfolders name in userupload directory

Posted: 10 Jun 2014, 19:05
by peppesba
Hi,
during this activity I found many errors in Italian translation of the component so I corrected them all.
So how can I send the corrected files to update your documentation? (I was unable to create the zip file to recreate the Italian language package).
Thanks
Joseph

Re: Subfolders name in userupload directory

Posted: 10 Jun 2014, 22:10
by Jan
Hi, sent PM, Jan.