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.

Topics - Mars

Pages: 1 ... 6 7 8
Bug reports / function cut() io non comprendere
« on: December 06, 2007, 11:21:31 PM »
 procedure cut();
    from, upTo, l: integer;
    s: string;
(1)  s:=par(2);                               
(2)  l:=length(s);
(3)  from:=strToIntDef(par(0), 1);
(4)  upTo:=strToIntDef(par(1), l);
(5)  if from < 0 then from:=l+from+1;
(6)  if upTo >= 0 then upTo:=from+upTo-1
(7)  else upTo:=l+upTo;
(8)  result:=substr(s, from, upTo);
  end; // cut

(0) {{cut|-3|-4|ABCDEFGH}}
(1) s='ABCDEFGH'
(2) l=
(3)  from=-3
(4)  upTo:=-4
(5)  if from < 0 then from:=l+from+1;         --> from=8-3+1=6
(6)  if upTo >= 0 then upTo:=from+upTo-1
(7)  else upTo:=l+upTo;                            --> upto=8-4=4 
(8)  result:=substr(s, from, upTo)               ---> substr(s,6,4)=copy(s,6,4-6+1)=copy(s,6,-1)=????? 

quelle est dans ton idée l'usage de nombres negatifs dans la macro cut ??

non documentée dans le wiki:
if name = 'replace' then
  result:=replaceText(par(2), par(1), p);

HTML & templates / Mp3 and %item-tags%
« on: December 02, 2007, 10:26:21 PM »
Small one source got back delphi and who shall allow to extract the information, notably with mp3 files
A way towards the variable %items-tags% for [file.mp3]?

HFS ~ HTTP File Server / request about %item-folder%
« on: November 22, 2007, 04:15:00 PM »
i hope to use %item-folder%  for all items in template with ?recursive
it give me  (home)/---/here/---/folder_content       anywhere

<tr><td>%new% %protected% <a href="%item-url%"><img src="/~img_file" /> %item-name%</a>%comment%<p>%item-folder%<td align=right>%item-size%<td align=right>%item-modified%<td align=right>%item-dl-count%

<tr><td>%new% %protected% <a href="%item-url%"><img src="/~img_folder" /> <b>%item-name%</b></a>%comment%<p>%item-folder%<td align=center><i>folder</i><td align=right>%item-modified%<td align=right>%item-dl-count%

<tr><td>%new% <a href="%item-url%"><img src="/~img_link" /> <b>%item-name%</b></a>%comment%<p>%item-folder%<td colspan=3 align=center><i>link</i>

when i am into 'here' folder it give me the same information (home)/---/here/---/folder_content

i would like having a var %item-relative-folder% who give methis syntax "/---/folder_content"

it is possible to add something as  item-relative_folder:=%item-folder% ;chop(%folder%,item-relative_folder);%item-relative_folder%:= item-relative_folder;

HFS ~ HTTP File Server / %new% resolved, Cookies are not necessary
« on: November 17, 2007, 08:03:14 PM »
next topic from

into hfs accounts are a class like

Taccount = record   // user/pass profile
    user, pwd, redir: string;
    enabled, noLimits: boolean;

user = login
pwd = password

Account properties:
redir =  'After login redirect to'
enable = true/false
limits = true/false

 what is new?

Taccount = record   // user/pass profile
    user, pwd, redir: string;
    enabled, noLimits: boolean;
    timecreate,timenew: Tdatetime;

timecreate create will be the date that account was creating
timenew will be the date (next is important) that the registered user has use the 'new' service

we can include an address line operator   ~new (as ~login -->[loggedin] or  ~upload -->[upload])  with a section [new] who work as:

if user is not logged , login and password are required to access the new.
if user is logged web page from url http://server/~new  equal   http://server/&recursive&new

at the difference that
 "http://server/&recursive&new" use time defined with  'flag files added recently" and will continue to work as before.
 "http://server/~new"  use time of last used this command line.

if you have use '~new' 3 days ago then this date was stored into 'timenew' and all files created after this date appears in the '~new' web page. and then actual time is now stored into 'timenew' and another use of '~new' web page after a few minutes give 'No files found' until some files are added into hfs.

For any not constructive comment it's better to read again and to understand the brought solution. In spite of my pitiful English, I think of having given all the necessary explanations; once coded this solution will seem simple in the usage.

HFS ~ HTTP File Server / compiling hfs and ADD-ON
« on: November 15, 2007, 09:39:51 PM »
connais tu quelqu'un qui a dejà reussi à compiler hfs en dehors de toi?

HFS ~ HTTP File Server / Addon for the use of %sequential%
« on: October 25, 2007, 06:25:48 PM »
At first I wished to count the number of links (%nb-links%) in recursive mode (missing in hfs) by means of %sequential% by using this way 



<!-- %sequential% -->    //   masqued in  web page
<TR> .....

not easy ..

I propose this modification to rejetto to include at main.pas

procedure applySequential();
    PATTERN = '%sequential%';
    NBPATERN = '%nb-sequential%';       // total of %sequential%

    idx, p: integer;
    idxS: string;

    p:=pos(PATTERN, result);
    if p = 0 then exit;
    delete(result, p, length(PATTERN)-length(idxS));
    move(idxS[1], result[p], length(idxS));
    until false;

    idxS:=intToStr(idx);               // necessary for second repeat until
    p:=pos(NBPATTERN, result);      // search  all %nb-sequential%
    if p = 0 then exit;
    delete(result, p, length(NBPATTERN)-length(idxS));
    move(idxS[1], result[p], length(idxS)); //replace any where in folder page
    until false;

  end; // applySequential

%sequential% works as before  1,2,3, .... N  and after all %nb-sequential% are substitute  with the  value N where we find it in the web page


HFS ~ HTTP File Server / upload filter
« on: October 24, 2007, 11:46:07 PM »

uploads for hfs.diff.tpl  give  "File name or extension forbidden"   GOOD

but it is possible to overwrite vfs file and hfs.ini by upload          DANGEROUS

HFS ~ HTTP File Server / file overwrite: per-folder
« on: October 23, 2007, 09:53:22 PM »
okey rejetto i have another proposition to you

moving the general option (in main menu uploads-->) number files on upload instead ...

to the context menu for each folder

i admin my hfs by an other computer , users can upload in one folder and are not allowed to  overwritting file but this restrict me when i want to overwrite a hfs.diff.tpl by example in my upload authorized folders hidden for others users

HFS ~ HTTP File Server / accounts in the VFS instead of INI
« on: October 23, 2007, 09:36:03 PM »

user accounts are saving in ini file, is it posssible to store them into vfs file with the directory and permissions for users
i think it's more logical, when your load a file system vfsto have account in it.

when i start differents fvs accounts and folders restrictions  even necessarily are not


after your post in this topic

but if anyone has such need, i could make [sections] optionally invisible, this way
but only if it is really useful.

is it as same to add possibility for a section to be diplay in template only like that

[sym-xxx|login] (user not logged)  and [sym-yyy|loggedin]  (user logged)
in main page if i use  %sym-xxx%%symm-yyy% at the same line like %login-link%%loggedin%

if i am not logged  %sym-xxx% and %login-link% appears and the two other are masked and conversely

HTML & templates / offset page and limit , The beginning of a long story
« on: October 23, 2007, 09:06:00 PM »
By amusement I recovered of the javascript code and I recreated what follows:

insert all section [sym-url] at the end of your template and add %sym-url% anywhere into the [files] and [nofiles] sections (Rather in the beginning of section)

It is not the best possible code but that works.

 Activate checkboxes and modify the possible values (when logged its better)

( Noted: and page is not activated)
It is the beginning, later I attack the presentation


<script language="javascript" type="text/javascript">
var code_value = new Array();

code_value["offset"] = "0";
code_value["page"] = "1";
code_value["limit"] = "-1";

function changeurl(code){
    var check=0;

    switch (code)
        case 4 : code="offset"; check=1; break;
        case 5 : code="page"  ; check=1; break;
        case 6 : code="limit" ; check=1; break;
                   default : check=0; break;

    var valeur = document.form.champ.value;

   if(code == "recursive" )
          {  if ( != -1)
       { valeur = valeur.replace(code,'');
          document.form.champ.value = valeur;
                   { document.form.champ.value= code+valeur}


 else   if ('='+code_value[ code ]) != -1)  {              //le champ existe
             if (check == 1){                                                               //mise à jour des valeurs
                valeur = valeur.replace('&'+code+'='+code_value[ code ],'')
                document.form.champ.value = valeur+'&'+code+'='+document.form.elements[ code ].value;
            else  {
                valeur = valeur.replace('&'+code+'='+document.form.elements[ code ].value,'');
                document.form.champ.value = valeur;
         else {
            if (check==0){
                      document.form.champ.value += '&'+code+'='+document.form.elements[ code ].value;


    <form name="form">
       <input type="text" name="champ" size="50"><br/>
       <input type="checkbox" name="cocher" value="1"  onclick="changeurl('offset');">offset
       <input type="checkbox" name="cocher" value="2"  onclick="changeurl('page');">page
       <input type="checkbox" name="cocher" value="3"  onclick="changeurl('limit');">limit
       <input type="checkbox" name="cocher" value="recursive"  onclick="changeurl('recursive');">recursive
       <input type="text" name="offset" size="4" value="0" onchange="changeurl(4);" onKeyup="changeurl(4);">

       <select name="page"  size="1" onchange="changeurl(5);" >
         <option value="1" selected>1
         <option value="2">2
         <option value="3">3
         <option value="4">4
         <option value="5">5
         <option value="6">6
         <option value="7">7
         <option value="8">8
         <option value="9">9
         <option value="10">10

       <select name="limit"  size="1" onchange="changeurl(6);">
         <option value="-1" type="hidden" selected>0
         <option value="5">5
         <option value="10">10
         <option value="15">15
         <option value="20">20
         <option value="25">25
         <option value="30">30
         <option value="35">35
         <option value="40">40
         <option value="45">45
         <option value="50">50
<INPUT TYPE="button" VALUE="Actualiser" onClick="window.location.href=''+document.form.champ.value">

ref to read

HTML & templates / to rejetto about templates
« 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

Bug reports / bug or not bug topic to rejetto
« on: October 01, 2007, 09:43:27 PM »
By consulting the documentation on wiki I found this

Embedding pages inside a template
If you put a whole HTML page under [a_name_you_choose] section, then it will be available at


Having tested, this is functional but not recursive in subfolders as it is possible with ~login: little bug

The risk is to have access for a user to a section [mysection] which we would like to keep  hidden. To by-pass the problem my solution is to create in the root a named virtual file "~mysection" and to put it hidden

Exepté for sections predefined in hfs, it would be possible that are effectively visible only sections such as [~mysection] and in all subfolders as with ~login?
If a name of section begins by ~, then it will be visible by the url only on this condition.

Modification possible in main.pas

 // provide access to any [section] in the tpl, included [progress]
  if (f = rootFile) and (urlCmd > '') then
    s:='~' +copy(urlCmd,2,MAXINT);
    if tpl.sectionExist(s) then
      getPage(s, data);


HFS ~ HTTP File Server / little bug with %build%
« on: September 26, 2007, 09:57:16 PM »
french user of hfs

rejetto good job with HFS

i use %build% in hfs.tpl and it works very nice but in  the tray mesage i put this:

Version %version% %build%
URL: %url%
IP/Port %ip% : %port%
Uptime: %uptime%
Downloads: %downloads%

and the message is

Version 2.2a %build%
possible to correct that


Pages: 1 ... 6 7 8