rejetto forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Mars

Pages: 1 ... 121 122 123 124 125 ... 135
1831
HFS ~ HTTP File Server / Re: "Search" button redirects to main page...
« on: December 13, 2007, 01:38:30 AM »
your template has a section [up]

can you copy  it into a post?

1832
HTML & templates / Re: Macros
« on: December 13, 2007, 01:22:16 AM »
Quote
Since we don't use macros inside, we don't need extra markers.

Quote
when you use {{left|string|count}} , he is replaced in the template by  {{ cut| 0|$2|$1}}
and all expressions as $1 $2  are replaced by the value string , count

and the template take the following aspect  {{ cut| 0|count|string}}

we don't need extra markers to do this, simplement une zone de stockage pour l'échange des parametres

{{set macro|left| {{ cut| 0|$2|$1}} {{length|$1} {{load|taratata.txt}} }}
 name='set macro'
 pars[0]='left'
pars[1]='{{cut| 0|$2|$1}} {{length|$1} {{load|taratata.txt}}'

stockage de 'left' et  '{{cut| 0|$2|$1}} {{length|$1} {{load|taratata.txt}}'

quand on trouve {{left| ....}} on remplace les $x par les paramètres  de {{left}} et on transfère dans le template , c'est ca que j'appellerai le 'set later'
Quote
{{set| shout at | {{\ HEY YOU, {{upper|$1}}! /}} }}

why not we can use
]{{set| shout at | {{quote| HEY YOU, {{upper|$1}} !}} }}

{{command| parameters}}   au moins ça se retient facillement, sinon on n'arrive plus à se souvenir quel caractère il faut mettre et quand ?, entre {{$name}} pour les sections, {{!name}} pour les {{set var|..}} se souvenir de {{\ en lieu et place de {{" ou de {{'
et que sais je encore ??? ??? ???

multiplier les noms de macros OUI , mais utiliser des symboles praticuliers, là on va flirter avec le linux

1833
HTML & templates / Re: Macros
« on: December 13, 2007, 12:49:13 AM »
{{ define | {{left | string | count } | {{ cut {{ 0 | count |string }}}}}} is to long, you duplicate the expressions and this code is not good

by using   'define' or 'set macro'

{{set macro| left | {{ cut| 0|$2|$1}}  }}

it is more simple to rejetto to evaluate the expression   
{{left|mystring|count}}

if you look at code delphi

left is  the variable(delphi) 'name'
mystring is pars[0] alias $1
count is pars[1] alias $2
....
and in template you see that $1 is the first param of {{left|($1)|($2)}}

Quote
This macro is a real macro for the macro-'language', it must never be evaluated!

when you use %user% in template he is replaced by the login

when you use {{left|string|count}} , he is replaced in the template by  {{ cut| 0|$2|$1}}
and all expressions as $1 $2  are replaced by the value string , count

and the template take the following aspect  {{ cut| 0|count|string}}

simple mais efficace et c'est pareil pour les 'alias', chaque macro est remplacée par son équivalent

tout comme quand on utilise  {{load|file}}, hfs remplace la macro par le texte qui lui correspond; rien de plus.


1834
HFS ~ HTTP File Server / Re: log colors
« on: December 13, 2007, 12:27:34 AM »
quand je choisi de rechercher dans le log à partir d'un masque , le premier item correspondant est colorié en fond noir, ensuite en utilisant les boutons up/down, hfs montre l'item suivant dans le log.

d'ailleurs en utilisant *.* comme masque,le resultat est surprenant si j'utilise le bouton up

bref, au lieu de passer successivement d'un item à l'autre , pourquoi ne pas mettre en évidence tous les items correspondant au masque utilisé?

1835
HFS ~ HTTP File Server / log colors
« on: December 12, 2007, 11:19:31 PM »
It is possible to color in all the items corresponding at the same time

1836
HTML & templates / Re: Macros
« on: December 12, 2007, 11:17:58 PM »
Quote
using $ both for sections and things defined by "set" may lead to colliding names.

j'ai modifié mon post précédent pendant que tu écrivais

Quote
between set macro and set later? no


We see at first glance that the functioning is the one of a macro. It seems to me more significant, with ' later ', one do not know when it will take place.

1837
Bug reports / Re: About the download by other download tools.
« on: December 12, 2007, 11:06:43 PM »
Happy to have been able to resolve your problem ;D

1838
HTML & templates / Re: Macros
« on: December 12, 2007, 10:02:46 PM »
rejetto
 That do you ask SET is I ask ALIAS
 That do you ask SET LATER is I ask DEFINE 

'set' is good instead 'alias' but 'set later' can make confuse, you must choice another word like 'set macro' because their syntax are differents

{{set | name | text or macro}}  call by {{$name}}
{{set var| varname | text or macro immediatly evaluated}}  call by {{!varname}}
{{set macro| macroname | {{M1|...}}{{M2|....}}....}}  call by {{macroname}}

*****************
{{set |.....}}

{{set | you  | %user%}}   it is a fixed string value you can redefine
{{$you}} is replaced by %user%  (working like{{$section}})

works as you use

[you]                                call by           {$you}
%user%


*****************
{{set var|.......}}

can be use as a variable you increase or decrease
{{set var| varname | num value }}  call by {{!varname}}
{{set var|x | 5}}     {{inc | x |2}}  and then {{!x}} give 7
 {{inc | name | value }}    same as     {{set var| x | {{!x}} +2 }}
 {{dec | name | value }}    same as     {{set var| x | {{!x}} -2 }}

result must be stored by hsf to can to work later with  {{inc|..}} and {{dec|..}}


*****************
{{set macro|....}}

{{set macro | yourmacro | {{macro1|$1|$2|$4|$3...}} {{macro2|$5|$6}} {{..}}....}}

call as a normal macro {{yourmacro}} and by {{yourmacro|parameters}} there is no confusion, IT IS A MACRO

The substitute macro 'yourmacro' is in an array of 'section', every 'item-string' contains the text to be substituted ( as a DIFF Template)  when the macro {{yourmacro|parameters}} is found then we substitute it in the template  by the 'item-string' and replacing every $x by the correct parameter of 'yourmacro'

one example with no parameters as section [file] in your template

{{set macro|item-file|<tr><td>%new% %protected% <a href="%item-url%"><img src="/~img_file" /> %item-name%</a>%comment%<td align=right>%item-size%<td align=right>%item-modified%<td align=right>%item-dl-count%}}


and use

[file]
{{item-file}}                   no parameters here but it is an 'alias'

[folder]
{{item-folder}}


{{$file}} is converted to {{item-file}} Which is converted in his turn there 'alias'

See you  the difference now?

1839
HTML & templates / Re: Macros
« on: December 12, 2007, 06:55:48 PM »
Quote
user created macros aka user created functions. The possibility to write a complex macro and place it in a user created function with custom parameters would be useful.
to call it {{call function | function-name | $A$ | $B$ |...}} A and B are the custom parameters.

to create {{function | function-name | $A$ | $B$ |...}}{{the macros to execute}} A and B define the parameters just like in javascript function (A,B,C){}...

eg {{call function | addition | 1 | 3 | 5}} 9 would be returned.

{{function | addition | $A$ | $B$ | $C$}}{{{{add | $A$ | $B$ | $C$}}}}

or you could even have the commands to execute as the last parameter, so the example above would be

{{function | addition | $A$ | $B$ | $C$ | {{add | $A$ | $B$ | $C$}}}}

Edit: Simple addition and subtraction, etc would be useful. Im working on something now that I must subtract one number from another so i know how many times to repeat itself.
Quote
{{ define | left{{#str|#len}} | {{cut | 0 | #len |#str }} }}


After a lot of reflection, I think of having found the solution:

To overload a macro or define a macro instead of the other one, we can use this macro

{{yourmacro|A|B|C|D|.....}}  to use it

parameters  A,B,C,D,.... are passed in this order  $1,$2,$3,$4,..... to the overloaded macro

to define your macro you must use

{{define| yourmacro| {{one_macro|$1|$2|$3|$4}} }}

you can invert some parameters as ...

{{define| yourmacro| {{one_macro|$4|$2|$1|$3}} }}

...to accommodate the order of your parameters in agreement with the macro overloaded

by sample     {{ define | left | {{cut|0|$1|$2}} }}      usage  {{left|($1)|$2}}


It will be possible to extend to more macros as

{{define| yourmacro | {{firstmacro|$3|$4}} {{secondmacro|$1|$2|$3}} {if|$4| then|else}} {{$5}} }}

but is is important  that $5 must be passed as '$name' with the $ before name, otherwise the call of macro {{$name}} will not work, the risk is that you obtain {{name}} on the place.


1840
HTML & templates / Re: Macros
« on: December 12, 2007, 03:28:39 PM »
It increases the number of macros  IF and reduct the field of application
It is easier to have a macro which returns a result and to include him in a IF THEN ELSE

{{file|name|url}}   '' or a name
{{file|size|url}}     '' or >=0
{{file|date|url}}    '' or a date

{{file|empty|url}}  true or false

{{file|exist|url}}    true or false


*************
{{ not | Boolean | /not }} true or false                       
{{ and | Boolean1 | Boolean2 | ... | BooleanN | /and }}  true or false
{{ or | Boolean1 | Boolean2 | /or }}   true or false
{{ xor | Boolean1 | Boolean2 | /xor }} true or false

you dont having

{{if and|.....|then|else}}
{{if or|.....|then|else}}
{{if xor|.....|then|else}}

{{if not |.....|then|else}}   is an exeption

then

{if|{{file|exist|url}}|then|else}}

1841
Beta / Re: Testing build #161
« on: December 12, 2007, 03:08:22 PM »
Quote
my question is now How To write a multi filter file (ex; .wav+.aiff +.text ) on real folders?


*.wav;*.aiff;*.text  as filers under windows  \*.ext to exclude this 'ext'

Quote
recursive listing and folder tar is not always welcome.

If you restrict the access to certain users, the user do not can reach these resources if he has not the good password, and thus even by recursive and folder.tar this resources is not taken

1842
HTML & templates / Re: Macros
« on: December 12, 2007, 02:32:28 PM »
- If the file is in a real folder, even as virtual file, if it is not available on your hard drive, he does not appear in the list  (by  [file]   %item-name% ) hfs exclud possibility to see this file)



- If the file is stored at an external address to the server and accessible only by http or ftp
you can just use in template {{length|{{load|http://server/......./file.ext}} }} to detect if file is accessible. if you use a [link] as http://...../file.ext  then file is in hfs list, even if the link is void.

(virtual link with set url  file:///c:/..../file.ext seem not working but appear in hfs list)

in [link] and [file] sections you can test {{if|{{length|{{load|%item-url%}}}}| file exist|file not exist }}.   you receive the same result as at the first possibility.     

I can certenly help you TSG, but it would be necessary to be more precise to allow me to see the reach of your wait  by a little example in tpl.

1843
HTML & templates / Re: Macros
« on: December 12, 2007, 11:53:09 AM »
I am anxious to remind a very important thing:

ALL THE MACROS ARE EXECUTED AT THE LEVEL OF THE SERVER
ALL THE JAVASCRIPT IS EXECUTED AT THE LEVEL OF THE BROWSER



***********************************************************************


Everything depends on how much file are to be detected and also of the size, because every file is read in its entirety to determine its size. If you make this for all the items, it will be longer than for one ?ecursive, and hfs risks to make an out of memeory (file-size >100Mo by sample)

The ideal would be to have complements to macro for the load function without loading all the file in memory


{{load|url}}
{{file|name|url}}
{{file|size|url}}
{{file|date|url}}
...
sample (it is only a sample):

{{file|size|c:\.....\file.ext}}  will rerturn the exact size

but {{file|size|http://server/......./file.ext}} has no sense then you can by-pass the problem by using
{{length|{{load|http://server/......./file.ext}} }}


1844
Everything else / Re: Shoutbox for guests
« on: December 12, 2007, 09:03:45 AM »
it will bee good if  "Login (Forgot your password?)" was  above the Shoutbox ,not below everything.


Quote
but i think need to be editbox where them write they nickname

and an editbot where guest put a random code giving by forum to confirm his message
 or/and
A guest could not write 2 messages in the continuation so much that another poster does not write a message (to avoid spams)


1845
HTML & templates / Re: Macros
« on: December 12, 2007, 08:49:35 AM »
Eh TSG! What do you think of that?

{{if|{{length|{{load|/rien.txt}}}}|file exist|file is empty or not exist}}

{{if|{{length|{{load|/hfs.ini}}}}|file exist|file is empty or not exist}}





Pages: 1 ... 121 122 123 124 125 ... 135