rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: Mars on October 04, 2007, 02:04:48 PM

Title: to rejetto about templates
Post by: Mars on October 04, 2007, 02:04:48 PM
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
Title: Re: to rejetto about templates
Post by: TSG on October 04, 2007, 02:11:10 PM
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...
Title: Re: to rejetto about templates
Post by: rejetto on October 04, 2007, 02:39:15 PM
1. accepted
2. you can already use ?offset=10&limit=20 in the URL. try yourself.
Title: Re: to rejetto about templates
Post by: TSG on October 04, 2007, 03:16:35 PM
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...
Title: Re: to rejetto about templates
Post by: Mars on October 04, 2007, 06:28:08 PM
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?
Title: Re: to rejetto about templates
Post by: bacter on October 04, 2007, 07:01:42 PM
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 (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?




Title: Re: to rejetto about templates
Post by: Unknown8063 on October 04, 2007, 09:17:29 PM
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.
Title: Re: to rejetto about templates
Post by: ledufe on October 05, 2007, 01:12:14 AM
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?
Title: Re: to rejetto about templates
Post by: Unknown8063 on October 05, 2007, 02:06:15 AM
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.
Title: Re: to rejetto about templates
Post by: Mars on October 05, 2007, 08:52:11 AM
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
Title: Re: to rejetto about templates
Post by: Mars on October 08, 2007, 10:20:55 PM
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

Title: Re: to rejetto about templates
Post by: rejetto on October 10, 2007, 02:02:32 AM
<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
Title: Re: to rejetto about templates
Post by: TSG on October 10, 2007, 06:03:11 AM
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)?
Title: Re: to rejetto about templates
Post by: Mars on October 10, 2007, 08:42:53 AM
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 >:(?...
Title: Re: to rejetto about templates
Post by: Mars on October 10, 2007, 10:28:46 AM
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 ?


Title: Re: to rejetto about templates
Post by: Giant Eagle on October 10, 2007, 12:09:05 PM
You know ;D there's something thats called 'JavaScript' that can do all this

Anyway, the %message% idea.. i dont get it. You have to give someone a direct link with the message already stored in the url, and hope they are already logged in cause else they wont even see it. It ruins the idea of having a personal message.

And different language support is nice and all.. but its a file server, not a weblog or something. The most text that will be displayed are the names and the stats of the files that are being served. If you want to host your file server in a different language, then go ahead and be my guest. But i dont think that multi-language or personal message support should be considered more important than remote file deletion or folder creation.

If i get it all wrong, please correct me. But this is just my opinion
Title: Re: to rejetto about templates
Post by: Mars on October 10, 2007, 12:57:36 PM
Thank you for your point of view, but what I present in this post is only the visible part of the iceberg.

If you can present me a function javascript which makes the same result  as I wish to obtain then you are hardly, it seems to me that the javascript runs only on the customer and not on the server.

As for %user%, it is introduced by the url when you become identified and then it is available for hfs under the shape of a defined variable, it is this principle which I want to spread(widen).


What you propose me is only the recursion, while what I look for by this means it is an interactivity enters the user and hfs.

My question will thus be: how to make cross(spend) a parameter by the url to use a trick(thing) of the kind(genre):


If condition(url) then includehere(%section1%) else includehere%section2%;

I hope not that is possible.

Title: Re: to rejetto about templates
Post by: TSG on October 10, 2007, 01:57:50 PM
Personal messages are a stupid idea.

I also agree with Giant Eagle about the language support, it is quite useless with a file server.

If there is a single thing i'd request of the templates, it is a proper login screen, not using %login-link% and jerry rigging it to give a login, but a proper login screen. Because even if a folder is unprotected you are shown a login screen with that method (if you were to direct link a friend for example). Simply because the user is not logged in.

And yes i think you could do the silly message idea with javascript. But you wont get me working on it any time soon.
Title: Re: to rejetto about templates
Post by: rejetto on October 10, 2007, 02:06:33 PM
it is very hard for me to comprehend what you want in little time.
and these days i have very little time, i'm working hard.
maybe i would comprehend more if you post in français, but be concise.
or ask TCube for help.

additional hint: use different topics for different requests. a long thread is harder to follow.
Title: Re: to rejetto about templates
Post by: bacter on October 10, 2007, 04:33:20 PM
Quote
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=....

In your posts some day ago (http://www.rejetto.com/forum/index.php?topic=4990.msg1028367#msg1028367) you didn't want such 'subtleties' like ?lang=... and user parameters for hfs. ... Now you need a kind of them, and even .... with "exactly this syntax" !!!

I am with Giant Eagle, that for values local to a template, with Java-script, we can do almost everything.
Where I see the problem, is to pass values once established by the user, to a next template. I did'nt want conditional html generation by use of parameters, because this implies a lot  more work in code. Your problem might be different, and I'm sorry not to understand the visible part of your iceberg, so I dont want to dive in that cold water to see the invisible rest.

I'm also with rejetto, perhaps if you write in french, you will be better understood.
Title: Re: to rejetto about templates
Post by: Foggy on October 11, 2007, 03:59:16 AM
PHP and other server side languages arnt going to be here for a very long time, So i suggest that you do what you can with javascript, flash, or any other client side language.

Im also with GE and TSG that personal messages arnt real necessary in a file server because put simply a file server isnt designed for social interaction.
Title: Re: to rejetto about templates
Post by: Mars on October 11, 2007, 06:17:53 AM
So that we are all right all I am anxious to say that I do not say white in a post and black in the other one.
If I use certain terms in my examples it is to show that what is not possible in a way we can make him(it) of the other one. I believe that I am going to delete(eliminate) the term LANGUAGE of my post for not more create of confusion on my future explanations.

Spending easily more than one hour or two to translate and to re-translate for a long time all that I put you because of my level weakness in English and that in spite of all my attention to avoid against senseI would post mainly my finds here

http://www.rejetto.com/forum/index.php?board=37.0

And you can use this tools as you wish it

Http: // www.reverso.net/

To translate in the language (OUPS! Sorry) of your choice.