1
HFS ~ HTTP File Server / Re: set expiry to delete content
« on: September 16, 2016, 01:50:47 PM »
So for 3 days from time of upload to delete but no deletion done Saturday, Sunday or Monday I would add into it like this (below) and set the #days to 3 as before ?
Or maybe DJ's post (just before this post) works too:
"if Sunday then 3
else if Saturday then 2
else 1
Code: [Select]
{. if |{.{.time|ddd.}=Sun.} | 3 | {:{.if|{.{.time|ddd.}=Sat.}|2|1.}:} .}
Can one of you piece this together so that I can copy and paste to test. In the end I'd just like to know where to set the # of days before deletion. I apologize again for not knowing this language but very happy you all jumped on the challenge.
********
[file=folder=link|private]
[at 0:00]
{.set|#actionday|0.}
{.for each|theday|,|tuesday,wednesday,thursday,friday|{:{if|{.=|{.lower|{.time|dddd.}.}|{.^theday.}/=.}|{:{.set|#actionday|1.}:}/if.}:}/switch.}
{.if|{.and|{.is file|%item-resource%.}|{.>|{.round|{.calc|%now%-%item-modified-dt%.}.}|3.}/and.}|
{:{.delete|%item-resource%|bin=0|forced=1.}:}|
[+file=+folder=+link|private]
<tr class='{.if|{.mod|{.count|row.}|2.}|even.}'><td>
<input type='checkbox' class='selector' name='selection' value="%item-url%" {.if not|{.or|{.get|can delete.}|{.get|can access.}|{.get|can archive item.}.}|disabled='disabled'.} />
{.if|{.is file protected|%item-name%.}|<span class='flag'> NEW </span>.}
{.if not|{.get|can access.}|<img src='/~img_lock'>.}
<a href="%item-url%"><img src="%item-icon%"> %item-name%</a>
{.if| {.length|{.?search.}.} |{:{.123 if 2|<div class='item-folder'>{.!item folder.} |{.breadcrumbs|{:<a href="%bread-url%">%bread-name%/</a>:}|from={.count substring|/|%folder%.}/breadcrumbs.}|</div>.}:} .}
{.123 if 2|<div class='comment'>|{.commentNL|%item-comment%.}|</div>.}
[+file]
<td>%item-size%B<td>%item-modified%<p>{.round|{.calc|%now%-%item-modified-dt%.}.}<td>%item-dl-count%
[+folder]
<td class='nosize'>folder<td>%item-modified%<p>{.round|{.calc|%now%-%item-modified-dt%.}.}<td>%item-dl-count%
[+link]
<td class='nosize'>link<td colspan='2'>
[+file=+folder=+link|private]
/if.}
Or maybe DJ's post (just before this post) works too:
"if Sunday then 3
else if Saturday then 2
else 1
Code: [Select]
{. if |{.{.time|ddd.}=Sun.} | 3 | {:{.if|{.{.time|ddd.}=Sat.}|2|1.}:} .}
Can one of you piece this together so that I can copy and paste to test. In the end I'd just like to know where to set the # of days before deletion. I apologize again for not knowing this language but very happy you all jumped on the challenge.
********
[file=folder=link|private]
[at 0:00]
{.set|#actionday|0.}
{.for each|theday|,|tuesday,wednesday,thursday,friday|{:{if|{.=|{.lower|{.time|dddd.}.}|{.^theday.}/=.}|{:{.set|#actionday|1.}:}/if.}:}/switch.}
{.if|{.and|{.is file|%item-resource%.}|{.>|{.round|{.calc|%now%-%item-modified-dt%.}.}|3.}/and.}|
{:{.delete|%item-resource%|bin=0|forced=1.}:}|
[+file=+folder=+link|private]
<tr class='{.if|{.mod|{.count|row.}|2.}|even.}'><td>
<input type='checkbox' class='selector' name='selection' value="%item-url%" {.if not|{.or|{.get|can delete.}|{.get|can access.}|{.get|can archive item.}.}|disabled='disabled'.} />
{.if|{.is file protected|%item-name%.}|<span class='flag'> NEW </span>.}
{.if not|{.get|can access.}|<img src='/~img_lock'>.}
<a href="%item-url%"><img src="%item-icon%"> %item-name%</a>
{.if| {.length|{.?search.}.} |{:{.123 if 2|<div class='item-folder'>{.!item folder.} |{.breadcrumbs|{:<a href="%bread-url%">%bread-name%/</a>:}|from={.count substring|/|%folder%.}/breadcrumbs.}|</div>.}:} .}
{.123 if 2|<div class='comment'>|{.commentNL|%item-comment%.}|</div>.}
[+file]
<td>%item-size%B<td>%item-modified%<p>{.round|{.calc|%now%-%item-modified-dt%.}.}<td>%item-dl-count%
[+folder]
<td class='nosize'>folder<td>%item-modified%<p>{.round|{.calc|%now%-%item-modified-dt%.}.}<td>%item-dl-count%
[+link]
<td class='nosize'>link<td colspan='2'>
[+file=+folder=+link|private]
/if.}