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 ... 134
1831
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.


1832
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}}

1833
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

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

1835
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}} }}


1836
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)


1837
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}}





1838
Bug reports / Re: About the download by other download tools.
« on: December 11, 2007, 11:31:28 PM »
look at MENU - others options - Specific HTML for downloader managers
http://www.rejetto.com/wiki/index.php?title=HFS:_Main_menu#Other_Options
Quote
Specific HTML for download managers
Some download managers have an internal browser to browse through the links of a webpage. This feature makes them fetch an optimised HTML, and provides a better browsing experience. At the moment, this options works with the following download managers: Getright, FDM, FlasGet.

and at MENU - URL Encoding - Include password in pages (...)



1839
HTML & templates / Re: Macros
« on: December 11, 2007, 11:22:02 PM »
Quote
>%comment%{{$isimage}}<td

Quote
this means that with alias the expression is evaluated when the macro is defined,

yes it is 
Quote
{{ alias | isimage | {{ if |=|{{cut(-3|3|%item-name%}}||img | This is a disk image|}}}}
{{ if |=|{{cut(-3|3|%item-name%}}||img | This is a disk image|}} is evualuted, and isimage get the result

Quote
if i define this alias in the files section before list:
{{ alias | isimage | {{ if |=|{{cut(-3|3|%item-name%}}||img | This is a disk image|}}}}
{{ alias | isimage | {{ if |{{=|{{cut|-3|3|%item-name%}}|img}} | This is a disk image /if}} }}  is more correct
Quote
Symbols available in section [files]
%list%
%item-archivable%
%item-ext%

Symbols available in sections [file], [folder] and [link]
%new%
%comment%
%item-url%
%item-name%
%item-folder%
%item-added%



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

i will look if that's possible

http://www.rejetto.com/forum/index.php?topic=5353.msg1030947#msg1030947

to have what you will there is new feature {{define|user-function|rejetto-function}}

Quote
Is there something i missed to understand or could you explain what would be the behaviour of alias with expression?

you can use
{{alias|hfsini|{{load|/hfs.ini}} }}
and then alias='
HFS 2.3 beta - Build #161
active=yes
.....
folders-before=yes
'

{{alias|my alias|<body>........</body>}}

whats you put after myalias| must be a string as result

{{alias|len|{{length|%user%}} }}

ce ne sont pas le possibilités qui manquent....

if you will a not evaluated then you must use sections instead alias

[isimage]
{{ if |{{=|{{cut|-3|3|%item-name%}}|img}} | This is a disk image /if}}

and talk it by {{$isimage}} in the section [file] (because you use %item-name%)
 

1840
HTML & templates / Re: Change ?rev
« on: December 11, 2007, 07:09:19 PM »
Hello bacter, do not you leave on your web page the possibility of choosing the order of sorting according to the choice of the user?
Quote
but  hfs knows when building the page by which field and in wich order the list will be sorted.

Yes by user with url line

Quote
instead of evaluating 5 lines of nested macros?

A droplet in an ocean ;D ;D


1841
HTML & templates / Re: Macros
« on: December 11, 2007, 06:23:22 PM »
template to your sample (when all macros are ok to rejetto)

Quote
[files]
{!--
{{alias|fname|}}                                            fname=''
{{alias|maxhits|0}}                                        maxhits=0
--}
....
%list%
....
{{if|{{$fname}}|Best hits to {{$fname}} with {{$maxhits}} downloads}}
....
[folder]
....
[link]
....
[file]
{!--
{{if |{{is >>| %item-hit% | maxhit}} | {{alias | maxhit | %item-hit%}}{{ alias | fname | %item-name% }}  }}
--}
...
that all

initiate  values
%list%
see the result

in this order to what you hope to do


1842
HTML & templates / Re: Change ?rev
« on: December 11, 2007, 10:00:57 AM »
Quote
<th><a href="{{get|url|sort=n|{{if not|{{=|{{urlvar|sort}}|n}}| |rev={{not|{{?rev}} }}  /if}} }}">Filename</a>
         <a href="{{get|url|sort=e|{{if not|{{=|{{urlvar|sort}}|e}}| |rev={{not|{{?rev}} }}  /if}} }}">.ext</a>
   <th><a href="{{get|url|sort=s|{{if not|{{=|{{urlvar|sort}}|s}}| |rev={{not|{{?rev}} }}  /if}} }}">Filesize</a>
   <th><a href="{{get|url|sort=t|{{if not|{{=|{{urlvar|sort}}|t}}| |rev={{not|{{?rev}} }} /if}} }}">Filetime</a>
   <th><a href="{{get|url|sort=d|{{if not|{{=|{{urlvar|sort}}|d}}| |rev={{not|{{?rev}} }}  /if}} }}">Hits</a>

To try it is to adopt, this piece of template will delight it more of one

1843
RAWR-Designs / Re: New template in the works.
« on: December 11, 2007, 09:56:54 AM »
It is the last one template by defaut which I used, I was only interested in the case

Quote
{{if|{{get|%item-archive%}}|{{$archive-on}}|{{$archive-off}} /if}}

[item-archive]
true

[archive-on]
<div class="quickBtn1" onmouseover="onBtn(this)" onmouseout="offBtn(this)"><a href="%item-url%~folder.tar?recursive" title="Download the content of this folder as a .tar Archive"><img src="/template/images/Download.gif" alt="DL" align="middle"></a></div>

[archive-off]
<div class="quickBtn1 disabled" onmouseover="onBtn(this)" onmouseout="offBtn(this)"><img src="/template/images/Download.gif" alt="DL" align="middle"></div>

On the other hand if the couple [mysection] and {{section|mysection}} works, he goes away differently for sections previous to the macro as [login-link] and [loggedin]

{{if not| %user% |{{section|login-link}} }}...{{if| %user% | {{section|login-link}} }}
 same result than  %login-link% ...%loggedin%

you can change %list% to {{section|list}}, it is a special usage to hfs, as for %user%

At the moment your action is limited to the former(ancient) call of section

[sym-section]   %sym-section%  ----> [mysection]   {{section|mysection}}

I think that %symbol% has to keep(guard) his structure of origin not to be confused with the macro, certain manners are in connection with data appropriate for the functioning of hfs and would require a radical modification of the code.

1844
HFS ~ HTTP File Server / Re: "Search" button redirects to main page...
« on: December 11, 2007, 01:00:13 AM »
not for me, all is ok with

{{if| {{get|can recur}} |
  <td nowrap>
    <div class=button>
    <form action='%folder%' style='width:160px'>
    <input name=search size=10 value="{{urlvar|search}}">
    <input type=submit value=search>
    </form>
    </div>



1845
HTML & templates / Re: Macros
« on: December 11, 2007, 12:53:08 AM »
Look at this (alias or define, may be the same)

NO they are different

define use parameters over parameters like

define function left(str,len);
    {
      result:=copy(str,0,len);
    };

ALIAS do not work in the same way

ALIAS is transparent as the macro COMMENT,

{{alias|name|text you want}}

 but what you define is accessible simply by {{$name}}

bacter, you must read all line from begin to end  in my posts ??? here I repeat twice same things

Quote
{{$myalias}}

[myalias]
{{my macro}}

or

Quote
{{$myalias}}

[myalias]
my text

with this sample {{$myalias}} is fixed

but with {{alias|myalias|text you want}} you can redefine it
Quote
<HTML>
<HEAD>
{{alias|myalias| my alias is in head}}

</HEAD>
<body>
here,
{{$myalias}}   

{{alias|myalias|-->now he is in body}}
<br>
{{$myalias}}
</BODY>
</HTML>

here, my alias is in head
-->now he is in body



but {{define| ....} is not a bad thing,

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