rejetto forum
May 25, 2012, 10:12:29 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [Solved] How comment a file from the webpage... Possible or not?  (Read 1620 times)
0 Members and 1 Guest are viewing this topic.
SilentPliz
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1046


....... chut ! shh!


View Profile WWW
« on: September 18, 2009, 09:02:20 AM »

Hi  Smiley
   
I wish I could comment a file from the webpage ... I tried this (the "add to log' is for see if it work)
---
Quote
<form method='post'>
    <input type='text' name='filecomment' value="{.!Filename to comment.}"
             onclick="if(this.value=='{.!Filename to comment.}')this.value='' "
             style="background-color:#fff; border:1px solid #000;" size="28">
    <input id=texto name=text value="{.!Enter your comment here.}"
             onclick="if(this.value=='{.!Enter your comment here.}')this.value='' "
             style="background-color:#fff; border:1px solid #000;"
             onfocus="javascript:refresh='true';" size="77"  onchange="textsend();">
    <input type='submit' name='commentfile'>
</form>

---
Quote
[special:begin]
{.if|{.and| {.postvar|commentfile.} | {.filename|{.postvar|filecomment.}.} .}|{:
{.add to log| commentaire sur
  %folder-resource%\{.filename|{.postvar|filecomment.}.}
  {.postvar|text.}
.}
:}/if.}

This is displayed in the log ... but at this moment, the comment is not saved and not displayed on the web page.

My questions are:

This is it possible with the existing macros?

If yes, someone would be a solution to suggest?

Thank you in advance. Wink



* 2009-09-17_141542.jpg (126.92 KB, 1073x407 - viewed 243 times.)
« Last Edit: November 04, 2009, 12:15:35 PM by SilentPliz » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11830


View Profile
« Reply #1 on: September 24, 2009, 05:37:12 AM »

you should use {.set item|/this-folder/file|comment={.postvar|text.}.}

in such case, i see we miss a way to have the text of the comment untouched.
i mean, consider if it contains this.}
once postvar is expanded, it would break the syntax.
{:quoting:} around {.postvar.} cannot be used to solve this problem, because postvar would never be expanded to its value.
the only way i can imagine is to have another command, quote, and use it this way
{.quote|{:{.postvar|text.}:}.}

i explain what this would do. Let's say 'text' value is "hello .} i break!".
the final result, with {.quote.} would be
{:hello .} i break!:}
that's harmless.

if someone has a better idea....
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11830


View Profile
« Reply #2 on: September 24, 2009, 05:42:04 AM »

you can use this modified #246 to test the new {.quote.}
http://www.sendspace.com/file/iq4d7f
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #3 on: September 25, 2009, 05:57:15 AM »

Quote
if someone has a better idea....

not actually without your delphi code  of macro quote
Logged
SilentPliz
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1046


....... chut ! shh!


View Profile WWW
« Reply #4 on: September 25, 2009, 06:42:26 AM »

Rejetto thank you!  Smiley Smiley Smiley Smiley

With the current beta...
This works perfectly with hfs.comments.txt files.
For this to work normally with descript.ion files, it was necessary that I apply the code modified by Mars:

http://www.rejetto.com/forum/index.php?topic=7475.msg1046472#msg1046472

Now everything works perfectly. Wink

The code used in template:

{.if|{.and| {.postvar|commentfile.} | {.filename|{.postvar|filecomment.}.} .}|{:
  {.set item|%folder%/{.filename|{.postvar|filecomment.}.}|comment={.postvar|text.}.}
:}/if.}


Thank you again for you two!


PS: Mars torture your hfs.exe (with new {.quote.})... the hunter of bugs is on the teeth Grin... Continued...

« Last Edit: September 25, 2009, 11:57:32 AM by SilentPliz » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11830


View Profile
« Reply #5 on: September 29, 2009, 06:47:24 PM »

until now, comments could not contain macros, except internal comments. those contained in the VFS.
this exception was made because such comments were considered safe, always set by the admin.
i see now that this assumption is wrong.
with such script you will end by exposing editing of in-VFS comments to the web.

think of a user setting {.delete|C:\boot.ini.} to a comment.
if this comment is saved to an external file, no problem, it's quoted.
if it is set for a virtual element, let's say, a virtual folder, enter the troubles.
because such virtual elements stores the comment internally, as said before.

at the moment the easier solution i see to this is to prevent macros also to such comments. in next release.
Logged
rejetto forum
« Reply #5 on: September 29, 2009, 06:47:24 PM »

Do you like this software? Consider even $2
 Logged
SilentPliz
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1046


....... chut ! shh!


View Profile WWW
« Reply #6 on: September 29, 2009, 08:16:38 PM »

   
rejetto, thank you for the warning ! Wink

I'm always a little wary of certain "forms"... so even if the macros are quoted with external files, so no great danger, I included this option in my "sector" reserved for forms with many restrictions ... Users must "vraiment montrer patte blanche" for access it.

{.if |{.and|%user%|{.!=|%user%|anonymous.}.}|
{.if|{.get|can delete.}{.and|{.get|can access.}|{.get|can upload.}.}|
etc etc...

But it is true that this kind of script may give some bad ideas to some people.  Undecided

---Thus the "247" beta will be welcome as usual!

« Last Edit: September 29, 2009, 08:27:45 PM by SilentPliz » Logged
Steven
Occasional poster
*
Offline Offline

Canada Canada

Posts: 13


View Profile Email
« Reply #7 on: October 06, 2009, 08:50:09 AM »

What would happen if you were to upload the .comment file via web browser?
brb i'm going to see what will happen
Logged
Steven
Occasional poster
*
Offline Offline

Canada Canada

Posts: 13


View Profile Email
« Reply #8 on: October 06, 2009, 08:53:05 AM »

Confirmed. Uploaded a .comment file from within the site (Via Firefox) and on a page refresh, the .comment file had disappeared and the file had a comment.
Very interesting Wink
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 15, 2012, 04:41:45 PM
anything