rejetto forum
February 12, 2012, 12:13:09 PM *
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: filesize limit viewable  (Read 339 times)
0 Members and 1 Guest are viewing this topic.
auphyr
Guest


Email
« on: June 25, 2010, 12:19:29 AM »

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.
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1469



View Profile WWW
« Reply #1 on: June 25, 2010, 03:17:41 AM »

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. Wink
Logged
auphyr
Guest


Email
« Reply #2 on: June 25, 2010, 06:45:14 AM »


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.
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11759


View Profile
« Reply #3 on: June 25, 2010, 09:11:17 AM »

good mars, but i have a nicer magic Smiley

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.}:}.}
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1469



View Profile WWW
« Reply #4 on: June 25, 2010, 10:27:11 AM »

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 Wink
 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.
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11759


View Profile
« Reply #5 on: June 25, 2010, 12:10:16 PM »

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.
Logged
rejetto forum
« Reply #5 on: June 25, 2010, 12:10:16 PM »

Do you like this software? Consider even $2
 Logged
auphyr
Guest


Email
« Reply #6 on: June 25, 2010, 04:45:19 PM »


Thanks all.

Will check.
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 February 04, 2012, 05:00:56 PM