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 ... 120 121 122 123 124 ... 134
1816
RAWR-Designs / Re: New template in the works.
« on: December 13, 2007, 12:31:33 PM »
Quote
{{if|{{is substring|127.0.0.|%ip%}}|{{$update-mod}}}}
{{if|{{is substring|10.0.0.|%ip%}}|{{$update-mod}}}}
{{if|{{is substring|10.1.1.|%ip%}}|{{$update-mod}}}}
{{if|{{is substring|192.168|%ip%}}|{{$update-mod}}}}

replace it by

Quote
{{if |{{match address|%ip%|127.0.0.;10.0.0.;10.1.1.;192.168.}}| {{\ $update-mod /}}  /if}}
'127.0.0.;10.0.0.;10.1.1.;192.168.'   is passed to hfs as one parameter (as a mask).



new usage : '{{\ '   macro ' /}}'           at the place  of  {{macro}}  when you use  macros into a if even you get some error ( look at wiki about this) http://www.rejetto.com/wiki/index.php?title=HFS:_Template_macros#Problem

1817
HTML & templates / Re: Converting a date format with macros
« on: December 13, 2007, 11:50:17 AM »
Hey yes, it is going to need for some people  that they take the road of the school

1818
RAWR-Designs / Re: New template in the works.
« on: December 13, 2007, 10:57:21 AM »
It is as for a RUBIK'S CUBE, the speed with which you find the solution, depend on the used method.

Certain macro are faster than variables %symbol%, and conversely.
Everything depends in which context they are used.

If we have a symbol and a macro which make the same spot, they appeal to the same function in the language delphi.


The php, it is as of the javascript, but executed by the highly-rated of the server.

Quote
if you place alot of macro's in a template, would that significally reduce the speed on slower computers?

It is always the same problem, any depend of the way you order your code

Quote
if x=a then a();
if x=b then b();
if x=c then c();
....
if x=z then z();

it is faster to do

Quote
if x=a then a()
else if x=b then b()
else if x=c then c()
....
else if x=z then z();
the next

if x= b then test is closed and continue to 'the next'

1819
HTML & templates / Re: Macros
« on: December 13, 2007, 09:46:03 AM »
ok TSG  but if you want to see size of a file  myfavico.ico  to make an include you can't detect him with %item-...%
sample
{{if| {{filesize|myfav.ico}} | <link rel="shortcut icon" href="template/myfavico.ico" />  |<link rel="shortcut icon" href="favicon.ico" />}}

all %item-...% works only in section %list% that is a problem

but you can use {{filezise|%item-url%}} for your ask

1820
HTML & templates / Re: Macros
« on: December 13, 2007, 02:01:31 AM »
where is the real problem? I see how you make the code. problem is it to detect all $x and the last }},  je ne pense pas que la substitution de chaines soit un probleme.
le principe s'appuie sur
Quote
procedure applyMacro(macroname :string;len:integer);
  const
   var
    PATTERN:STRING;
    p: integer;
 
  begin
  idx:=0;
  PATTERN:= '{{'+macroname;
    repeat
    p:=pos(PATTERN, result);
    if p = 0 then exit;   
    delete(result, p, len));
    move(macroname.tpl[1], result[p], length(macroname.tpl));
    until false;
  end; // applyMacro


si on respecte la notation

{{command | parametre1 | parametre2 | parametre3 | ...}}

il n'y a aucun probleme lors de l'utilisation de

{{substring|rejetto|mars|{{$comprehension}} }}


[comprehension]

{{quote rejetto n'est pas pret de convaincre mars sur ce sujet /quote}}

result is n'est pas pret de convaincre

1821
HFS ~ HTTP File Server / Re: "Search" button redirects to main page...
« on: December 13, 2007, 01:51:25 AM »
Another possibility is that you confuse the information

if you make a search in folder privado, he is the current folder and up is the link to root

add a folder under privado like test and go to it

make a search in test, you  receive NO FILES

place your mouse over the link UP and see what is the url in your status bar

1822
HFS ~ HTTP File Server / Re: log colors
« on: December 13, 2007, 01:39:44 AM »
là je comprends mieux la méthode utilisée.

1823
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?

1824
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

1825
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.


1826
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é?

1827
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

1828
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.

1829
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

1830
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?

Pages: 1 ... 120 121 122 123 124 ... 134