Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 25. Apr 2024, 16:36

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Comment on file
PostPosted: 2. May 2009, 17:45 
Offline

Joined: 7. Feb 2009, 17:06
Posts: 3
Hi

I'm currently using JFU on my school website. Pupils are uploading their work to me to be marked. I have two questions:

1) Is there any way that I could get a preview thumbnail of pdf files to display?

2) I need to give feedback to pupils on their work. Can I add a feature to comment on files uploaded? If not, would anyone be interested in implementing this for a fee?

Regards


Top
 Profile  
 
 Post subject:
PostPosted: 2. May 2009, 20:16 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
1. A preview can be generated with image magick. I have never doens this but this should be easy to extend

2. How should this look like? Can you tell me how the handling should be.

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 4. May 2009, 11:22 
Offline

Joined: 7. Feb 2009, 17:06
Posts: 3
I'm not entirely sure on the best way to go about this. I would imaging, that certain users, i.e. teachers, would have the option to select a file and click a comment button. Then leave a comment on the file. I would ideally like to have some kind of versioning of files. For example:

- Pupil uploads version 1 of file
- Teacher leaves comment for improvements
- Pupils makes improvements and uploads version 2 of file
- Teachers leaves further feedback etc.

If the files are deleted - the comments are deleted.

I would like a comment box at the bottom of the current uploader, with a date, time and username of person that has commented on the file. When a file is selected, comments are displayed.

If no comment has been given, the box is empty.

- Mark


Top
 Profile  
 
 Post subject:
PostPosted: 4. May 2009, 12:01 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
I would not include this in the flash. This is a whole workflow scenario you like/need.

A good idea would be to use the Javascript callbacks to do the commenting. The comments can then be saved to the database and even the versioning can be done there.

But this would then be a custom version you need (actually not of the flash but of the workflow.). Please contact me directly by e-mail to get in detail about this.

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 4. May 2009, 12:02 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
about pdf preview. I implemented this for TFU already. You only need image magick support to enable this.

- Michael


Top
 Profile  
 
PostPosted: 22. May 2009, 10:51 
Offline

Joined: 21. May 2009, 01:08
Posts: 11
Hi Michael,

I am interested in accomplishing this functionality exactly:

Quote:
A good idea would be to use the Javascript callbacks to do the commenting. The comments can then be saved to the database and even the versioning can be done there.


When files are uploaded, I would like to be able to specify some text (or pick from a dropdown of options) that will apply to all files which are then uploaded. I'm guessing this would be some type of html/php form that is on the same page as the flash uploader.

Which Javascript callback could I use to capture the specified text? How could this text then be saved to a database, as you mentioned above?

Thanks,

Frank


Top
 Profile  
 
 Post subject:
PostPosted: 22. May 2009, 11:13 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
There are many ways you can do this.

check the help how to use callbacks in JFU:

http://www.tinywebgallery.com/en/tfu/web_jfu.php

The saver solution is always to use 2 pages because then you can validate the stuff the users e.g. selects in a dropdown (it the dropdown is mandatory).

For more complex scenarios you can use the plugin of JFU.

- Michael


Top
 Profile  
 
PostPosted: 23. May 2009, 00:39 
Offline

Joined: 21. May 2009, 01:08
Posts: 11
Hi Michael,

I read the how-to you mentioned above, and I followed the basic example, however I am still unclear as to how I would have the Javacript callback function capture a value from a form field on the page (or a previous page), and then pass it into php so it could be recorded into a database.

If this is easy enough to demonstrate here, I would much appreciate an example, otherwise please email me if this is a bit more involved than that.

Thanks,

Frank


Top
 Profile  
 
 Post subject:
PostPosted: 23. May 2009, 08:18 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
If you do if on a previous page you don't need to use the Callback because there use a form. On the same page you can use the callback to submit the form or Javascript (AJAX) to send it to the server...

- Michael


Top
 Profile  
 
PostPosted: 25. May 2009, 08:08 
Offline

Joined: 21. May 2009, 01:08
Posts: 11
Hi Michael,

I have a form setup previous to the JFU component page. When the form is submitted, the page is redirected to the JFU component, with variables appended in the URL query string. The variable I am trying to capture is "fab_upload_results___album_name", and it appears clearly in the URL that the JFU component is at.

I am trying to capture this variable in the TFU_upload.php so it can be written to a database table along with other variables that are already setup and working fine (info about the writing to the database can be found in this thread: http://www.tinywebgallery.com/forum/vie ... =tfuupload ).

At this point I am just trying to successfully debug the variable, and I haven't done the extra step of writing it to the database, but that part won't be an issue. Here is the code I inserted into TFU_upload.php, near where the other variables are being set (originally for the notification email section, but modified to write to a db):

Code:
debug("Tour ID from Session: " . $_GET['fab_upload_results___album_name']);


When I look at the debug info in tfu.log, I see:

Code:
ERROR 8 in joomla_flash_uploader/tfu/tfu_upload.php, line 202: Undefined index:  fab_upload_results___album_name


This is strange, seeing as the variable is definitely in the query string of the JFU component's URL. Ideas?

This is the last step towards getting JFU to function exactly as my project(s) require, so I would definitely appreciate some assistance!

Thanks,

Frank


Top
 Profile  
 
PostPosted: 25. May 2009, 08:51 
Offline

Joined: 21. May 2009, 01:08
Posts: 11
I believe I have found the root of the problem, but not yet a solution. To debug the issue further, I entered:

Code:
debug($url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']."?".$_SERVER['QUERY_STRING']);


The url that appeared in tfu.log was very different from what was being displayed in the browser:

Code:
http://[mysite.com]/[mySubdirectory]/administrator/components/com_joomla_flash_uploader/tfu/tfu_upload.php?dir=&remaining=1&TFUSESSID=[************]&size=10000&firstStart=true&zeit=1243236863374&tfu_rn=1248754269349866339983237932456&tfu_is_flash_10=1


So, what I've gathered is tfu_upload.php is NOT seeing the same URL that appears in the browser window. Additionaly, I'm guessing it must have a different session from the Joomla session, as TFUSESSID seems to be assigning its own session?

How can I $_GET my variable from the Joomla session in tfu_upload.php?

Thanks,

Frank


Top
 Profile  
 
 Post subject:
PostPosted: 25. May 2009, 09:02 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
you are on the right track - Session!

you are trying to get a request parameter! this parameter is of course not available in the session.

You have to store this in the session when you get it from your form and then read from the session in tfu_upload.php.

Like I do this with the parameters for JFU itself. It is done the same way.

- Michael


Top
 Profile  
 
PostPosted: 25. May 2009, 21:54 
Offline

Joined: 21. May 2009, 01:08
Posts: 11
Hi Michael,

You are correct, session is the way to go! In the form previous to JFU, I was able to assign the form field to a session variable with the following code:

Code:
$_SESSION['TourIDDD'] = $_POST['fab_upload_results___album_name'];


Back in tfu_upload.php, I could capture this variable by using $_SESSION['TourIDDD'] to pull it out of the session array. Once I had the variable, I could then write it to a database table with other variables from the session.

Thanks for your help!

-Frank :D


Top
 Profile  
 
 Post subject:
PostPosted: 25. May 2009, 22:08 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
you are welcome ;).

- Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy