Page 1 of 1

Need help solving problem with the Filetime and Useruploads

Posted: 26 Apr 2013, 12:01
by l.enfant.terrible
Hi!

I've been searching the web and this forum but I didn't find any answers/solutions to my problems:

- I need the exact time and not only the date, a file was uploaded. Where can I add this? It would be great to display not only the date in the details/description.

- If user uploads are allowed, how can I manage to use only one folder. At my site there are different users uploading the same file for our collegues who are downloading them. So the old file should be overwritten by the newer one and there should only exist one file at all and not the same file in different paths, because these files are all visible and downloadable in the frontend, but we only need one file!

BTW: why is the details sometimes shown and sometimes not ? Is it possible that the details is only shown if there is a description to the file?

I'm using Joomla 2.5.9 and Phocadownload 2.1.8!

GERMAN:

Hi!

Ich benötige Hilfe bei folgenden Problemen:

- Wie kann ich zum Datum des Uploads auch noch die Zeit ausgeben? Der User soll also eine genauere Zeitangabe erhalten. Und warum werden die Details manchmal nicht angezeigt und sind nur im Overlib zu sehen? Werden die Details in der Dateiansicht nur ausgegeben, wenn man beim Upload auch eine Beschreibung hinzufügt?

- Wir nutzen die Seite, um Einsatzpläne zum Download bereitzustellen. Es gibt mehrere User, die über das Frontend die entsprechenden Dateien hochladen. Von jeder Datei soll es jedoch nur eine Version geben, die beim Upload immer überschrieben werden soll. Wie verhindere ich, dass für jeden User ein eigener Ordner angelegt wird? Uploader und Downloader sollen immer auf den selben Ordner und die gleichen Dateien zugreifen.

Lieben Dank!

Re: Need help solving problem with the Filetime and Useruplo

Posted: 27 Apr 2013, 16:54
by Jan
Hi, not sure why it is displayed sometimes? I should be displayed allways.

To get exact time, the code needs to be customized - depends on where you need to do changes, if in frontned, e.g. in UCP:

components\com_phocadownload\models\user.php
function _save

Every user gets one folder while uploading - there he can upload more files and if one the same file will be uploaded, you can decide in parameters if this file will be overwritten or error message will be displayed.

Jan

Re: Need help solving problem with the Filetime and Useruplo

Posted: 29 Apr 2013, 07:29
by l.enfant.terrible
@Jan: It is really this way: only if you fill out the form before uploading a file you can see the description without hovering the details button (overlib)

- I'm not quite familiar with coding - could someone please explain me how I have to change the code, so user are able to upload their file in the same folder? I think I have to change the "..../components\com_phocadownload\models\user.php". Also, I still want to have the time stamp of the file with more than only the date but the time the file has been uploaded.

Is there anybody with a the same problems out there who already solved them?

Re: Need help solving problem with the Filetime and Useruplo

Posted: 07 May 2013, 19:27
by Jan
Hi, yes as it is MVC, you need to look at all parts of MVC:

model:
models/user.php
controller:
controllers/user.php
view:
views/user/ ...

and of course for all the functions which are included and link to helper classes

you need to see the upload functions (single or multipe) to see where the file is uploaded

e.g.

Code: Select all

if (!JFile::exists($filepathUserFolder . DS ."index.html")) {
						$data = "<html>\n<body bgcolor=\"#FFFFFF\">\n</body>\n</html>";
						JFile::write($filepathUserFolder . DS ."index.html", $data);
					}
					$file['name']	=  'userupload/'.$userFolder.'/' . $file['name'];
etc. etc.