rejetto forum

to rejetto about templates

Mars · 22 · 15463

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2063
    • View Profile
A little adpatation for the display of files in web page:

1 It is possible to sort out 'by name',  'by date' and 'by download' , but also nearly sort out the possibility 'by type (.ext )'; an oversight I hope?

2 is there a possibility to limit the number of filesshown on screen  to create a multi-systeme pages
1 ...  12 13 14 15 16  ....  45  as in forums?

A general option would allow to select the number max of files shown by page with variable %FILES-PAGES% with can be modified into template like %FILES-PAGES%=(UNLIMITED|x) (x= nb files/page) and create sections  as [up] with [PAGE-]and [PAGE+] a minimum of javascript being the necessary , good on


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
I like the sort by extension idea, rest are already available.

2 is in the to-do list.  ;) Nice concept for implementation but we cant figure out a nice method for this just yet, we have tried a few times with javascript...
« Last Edit: October 04, 2007, 02:15:54 PM by That_Stevens_Guy »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
1. accepted
2. you can already use ?offset=10&limit=20 in the URL. try yourself.


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Forgot about that one :) I guess its because its kind of useless without the ability to go to the next page. I think now that is the feature we were trying to use the javascript with...


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2063
    • View Profile
Several things are not informed in the help assistant of hfs editor
 
An update of this in the next version beta version would  be indeed.

I read a post concerning %time% and %date% what is it of their use? wich section and information are they return?


Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
to rejetto:

Features like "?offset=nn & limit=mm" are interesting, but almost useless if we cant' access those values in the next page loaded.

We have here an example why we need same values asociated to the user, as I tried tu explain in my post

http://www.rejetto.com/forum/index.php?topic=4990.msg1027859#msg1027859

about userparams and %lang%. With the feature of tree params or variables, we could well control where in the great list of files we were located by passing the current ofset.

%lang% and for example 2 values "upar1" and "upar2" , accessible in the template as %lang%,%upar1%,%upar2% in the same level as %user%.

The values could be set with ?lang= , ?upar1=  etc. If not set, the values should be void.

Would this be difficult tu implement?




your computer has no brain - use your own !


Offline Unknown8063

  • Occasional poster
  • *
    • Posts: 96
    • View Profile
Forgot about that one :) I guess its because its kind of useless without the ability to go to the next page. I think now that is the feature we were trying to use the javascript with...

Isn't this easy? Just use a javascript function like: http://www.11tmr.com/11tmr.nsf/d6plinks/MWHE-695L9Z to fetch the current offset and limit.  The next page then has the offset of offset + limit.  The previous page is the offset - limit.  An arbitrary page X begins at offset = limit * (X - 1).  And you can find how many pages by using %number% / limit.  Right, or am I missing something?

Note: I am not sure what %number% would return if a limit is used.  This assumes it still returns the total number of objects in the folder.
« Last Edit: October 04, 2007, 09:23:08 PM by Unknown8063 »


Offline ledufe

  • Tireless poster
  • ****
    • Posts: 272
  • LEandro DUpont FErreira
    • View Profile
    • http://ledufe.no-ip.info:2222
i may be a total stupid doing this question, but, let me try...

how to use this parameters in a this exemple, i have a folder with 250 files and i want to use this url/parameter to show from the 51 to 100 file .....

since i can use this parameter to show from 1 to 50, how to show the next block of 50 files?

how would this parameter be?
<<LeDuFe>>


Offline Unknown8063

  • Occasional poster
  • *
    • Posts: 96
    • View Profile
That's what the offset is for I assume.  If you set the offset at 50 (or 51?) and the limit at 50, you get the next segment.

The offset is the starting point and the limit is how far from the offset you go.
« Last Edit: October 05, 2007, 02:10:09 AM by Unknown8063 »


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2063
    • View Profile
to use "?offset=10&limit=20"

in tpl, you find [folder] section as default template
[folder]
<tr><td>%new% %protected% <a href="%item-url%"?offset=10&limit=20"><img src="/~img_folder" /> <b>%item-name%</b></a>%comment%<td align=center><i>folder</i><td align=right>%item-modified%<td align=right>%item-dl-count%

"offset" is the first file who will appear 0=first
"limit " is number of total files

"?offset=0&limit=5" define files 1 to  6
"?offset=6&limit=5" define files 6 to  11
and ....


into a scrîpt somes variable are initiate deb=0 increment=limit_defined
 
[folder]
<tr><td>%new% %protected% <a href="%item-url%"?offset=deb&limit=increment"><img src="/~img_folder" /> <b>%item-name%</b></a>%comment%<td align=center><i>folder</i><td align=right>%item-modified%<td align=right>%item-dl-count%

with two button like
<a name=preview onclick=preview()>PRE</a>   
associate with
 function preview()  {deb=deb-increment; if (deb<0) {deb=0}; return}

<a name=preview onclick=nextview()>NEXT</a>   
associate with
 function nextview()  {deb=deb+increment; if (deb>%number%) {deb=deb-increment}; return}

i don't know how to export the value corresponding to %number% in javascript , must be tested..

Post your tests an results

thanks


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2063
    • View Profile
For Rejetto:

Would it be possible to add options in url with  Offset=x & limit=y 

a filter of mask        & mask=*.*   ( example  &mask=*.mp3 )

a filter of direction   & rev     to invert listing of files



Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
<a href="%item-url%"?offset=10&limit=20">

there's an extra double-quote "

a filter of mask        & mask=*.*   ( example  &mask=*.mp3 )
a filter of direction   & rev     to invert listing of files

hmm... ok


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Shouldn't invert occur when you click on "sort by file" for example, like in windows explorer, if u click once the arrow faces down, click again, it faces up (the file listing inverted by sort setting)?


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2063
    • View Profile
Quote
Shouldn't invert occur when you click on "sort by file" for example, like in windows explorer, if u click once the arrow faces down, click again, it faces up (the file listing inverted by sort setting)?

Yes T_S_G, it is exactly the popular purpose but it is necessary to be able to at first spend paramters checks in URL before developing a template using the good tools

In what to build a fortified castle  ;D , if after all we have no good keys to enter it >:(?...


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2063
    • View Profile
Mister Rejetto

I envisage some developpements interraction with hfs by waiting to be able to use of the php, the only possibility at present is the use of the url? Param1; param2...

1) What I wish it is the possibility of being able to define internal variables in the tpl in the kind of
(with exactly this syntax)

<!-- #PRAGMA
%VAR1%="value";
%Lang%="language";

#ENDPREAGMA -->

"<!--"   and   "-->" are essential to not interfere with the html code

2) The possibility of spending this type of affectation by using the url

http://myserver.rejetto.hfs/folder1/folder2/?var$VAR1=value&var$Lang=my%20text&....&sort=n&limit=....

I do not know which characters are forbidden into URL line,  can you answer me for a long time this subject?

After analysis d the url by hfs, this last one will replace any utlisation of %var1% by the content of $var1 in the template with the corresponding value.

an example

i) URL is  http://myserver.rejetto.hfs/folder1/folder2/?var$message=You%like%20It

ii) template as:

<html>
<head>
...
<!-- #PRAGMA
%var1%="good";
%test%="that will works";
#ENDPREAGMA -->
...
</head>
<body>
....
%test% will done if you are logged
</body>
</html>

[loggedin]
...
<p>
We can use variable to say : %test% %var1% , %message% ?
<p>
...


iii) the user can see

that will works will done if you are logged

that will works good , You like it ?


« Last Edit: October 10, 2007, 11:12:10 AM by mars »