rejetto forum

filesize limit viewable

Guest · 7 · 6234

0 Members and 1 Guest are viewing this topic.

auphyr

  • Guest
hey,

is there a way to limit the view of seeing files by their size ?

for example, i've got a folder with many files and i don't want a users to see files larger than 20MB.
Is it possible ? if so, how ?

thanks.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2068
    • View Profile
yes you can do it with the beta build 260 by using macros


edit the template, you will find some sections in this order (it is very important)
[file=folder=link]  [+folder]  [+file]  [+link]

Quote
[+file=+folder=+link]
   <tr class='{.if not|{.get|can delete.}{.and|{.get|can access.}|{.get|can archive item.}.}|non.}selectable {.if|{.mod|{.count|row.}|2.}|even.}'><td>
      {.if|{.get|is new.}|<span class='flag'>&nbsp;NEW&nbsp;</span>.}
      {.if not|{.get|can access.}|<img src='/~img_lock'>.}

[+folder=+link]

      <a class='the-item' href="%item-url%"><img src="%item-icon%"> %item-name%</a>
[+file]
      <a class='the-item' href="{.if|%user%|%item-url%|#.}"><img src="%item-icon%"> %item-name%</a>

[+file=+folder=+link]
      {.if| {.?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%<td>%item-modified%<td>%item-dl-count%

[+folder]
<td class='nosize'>folder<td>%item-modified%<td>%item-dl-count%

[+link]
<td colspan='3'>link

We are going to set up two actions: to limit the display to the files at least of 20Mo and to show all the files when it is you who are identified.

Small reminder: sections carrying the same name and preceded by a sign "+" are always assembled together to make only the only one.

Quote
[file=folder=link]
start,
[+file=+folder=+link]
 i am a
[+folder]
 folder
[+file]
 file
[+link]
 link
[+file=+folder=+link]
. end

at the result

folder  ->>  start, i am a folder. end
file  ->>  start, i am a file. end
link  ->>  start, i am a link. end

ENJOY!  you have only to change what is under and colored  (orange is to limit the size in Kb) (brown is to allow you to see all files with no limit of size).

one other way is to create a group as "oversize",and  every body belong this group can see all files by replace the macro
{.=|%user%|your_login.} by this {.get account|%user%|member of|oversize.}

Quote
[file=folder=link]
{.if|{.<|%item-size-kb%|100.}{.=|%user%|your_login.}|

[+file=+folder=+link]

   <tr class='{.if not|{.get|can delete.}{.and|{.get|can access.}|{.get|can archive item.}.}|non.}selectable {.if|{.mod|{.count|row.}|2.}|even.}'><td>
      {.if|{.get|is new.}|<span class='flag'>&nbsp;NEW&nbsp;</span>.}
      {.if not|{.get|can access.}|<img src='/~img_lock'>.}

[+folder=+link]

      <a class='the-item' href="%item-url%"><img src="%item-icon%"> %item-name%</a>
[+file]
      <a class='the-item' href="{.if|%user%|%item-url%|#.}"><img src="%item-icon%"> %item-name%</a>

[+file=+folder=+link]
      {.if| {.?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-kb%<td>%item-modified%<td>%item-dl-count%

[+folder]
<td class='nosize'>folder (%item-size-kb%)<td>%item-modified%<td>%item-dl-count%

[+link]
<td colspan='3'>link

[+file=+folder=+link]
.}

that's all. ;)


auphyr

  • Guest

Thanks, I want to try the second option you suggested but I can't find the macros you said.

"one other way is to create a group as "oversize",and  every body belong this group can see all files by replace the macro
{.=|%user%|your_login.} by this {.get account|%user%|member of|oversize.}"

Where and how ?

Thanks.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
good mars, but i have a nicer magic :)

keep your template as it was, and follow this instructions, that should work for any template.

right click on the root/home > properties > diff template
and put this text:

[file]
{.if|{.%item-size-kb% < 20000.}|{:{.$file|back=1.}:}.}


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2068
    • View Profile
Magic, certainly but that applies only to a single folder. Otherwise it is necessary to make it for all the concerned folders, or then by inheritance of diff template ;)
 There is no better solution than no one or the other one, certainly than it will be necessary to combine both together to become widespread at its needs.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
if you apply it to the root as i said, it works for every folder.
another good side is that, if you want, you can limit to a folder.

it's true instead that it doesn't work for other VFSs you may eventually have,
but even with multiple VFS, there's no reason to think you want this feature on all of them.