The current template I'm using is generating a Multi-comment files hfs.comments.txt but this has some drawbacks:
- When a new file is uploaded, the hfs.comments.txt file is updated
- When a file is deleted, the hfs.comments.txt is not update
--> the hfs.comments.txt grows forever
- Add again the same file, but without a user logged in
--> the hfs.comments.txt contains already an entry for this file and the wrong information is shown
Possible solution: I changed the code in the [upload-success] section so that now a single-comment file is generated with the name of the user who uploaded the file.
Old code.
{.if| %user% |{: {.append| %folder-resource%\hfs.comments.txt |{.filename|%item-resource%.}=uploaded by %user% /append.} :}/if.}
New code:
{.if| %user% |{: {.append| %folder-resource%\{.filename|%item-resource%.}.comment |uploaded by %user% /append.} :}/if.}
This solves the first problem (hfs.comments.txt grows forever)
But now, to evaoid the second problem, I should add a function that when a file is deleted, the "single-comment file" is deleted as well.
Any idea how I can do that?
« Last Edit: January 29, 2009, 09:01:15 AM by luca69 »
Life is what happens to you while you are busy making other plans