rejetto forum

Software => HFS ~ HTTP File Server => Beta => Topic started by: rejetto on July 17, 2008, 11:46:37 PM

Title: Testing build #192
Post by: rejetto on July 17, 2008, 11:46:37 PM
Hey templaters!
2 big news in this build, and the best thing is that they required me just few minutes to make. Holy sweat.

Your templates are now easier to install.
Tell users to just drag&drop the tpl file over HFS window.
No need to tell what to answer to the Install this template? on your screen.

More, a new {.mime.} macro to decide what's the kind of content you are going to deliver.
Do you have a [css] section?
Just put {.mime|text/css.} somewhere in it, and people with wrong mime settings won't complain with you anymore.
Are you going to deliver some RSS content?
Don't forget to put {.mime|application/rss+xml.} and the world will be a better place.

And now let's pray against the bugs.  :-X

download @ www.dovedove.it/hfs/hfs192.exe

what's new
+ template installation through drag&drop
+ new template macro: mime
- "Edit" broken in build #191 (didn't work with spaces in the editor path)
- "Browse it" wasn't working with links http://www.rejetto.com/forum/index.php?topic=6010.msg1035702#msg1035702
- "hints for newcomers" has been extended to more hints   
Title: Re: Testing build #192
Post by: ydwxb on July 18, 2008, 04:03:19 AM
hfs2.3B192汉化版
Title: Re: Testing build #192
Post by: SilentPliz on July 18, 2008, 06:09:55 AM
WooW !, :D fun and useful these new features !
Good job!

Quote
And now let's pray against the bugs. 

If prayer against bugs is ineffective ... Some grigris ;)
Title: Re: Testing build #192
Post by: maverick on July 18, 2008, 07:18:23 AM
Good job rejetto!  I see no problems.  :)
Title: Re: Testing build #192 increase secutity
Post by: Mars on July 21, 2008, 01:23:04 PM
FUNCTION LOADCFG()

OLD:
Quote
ini:=loadFile(cfgPath+CFG_FILE);
if ini > '' then
  begin
  saveMode:=SM_FILE;
  moveLegacyTpl(loadFile(cfgPath+TPL_FILE));  //Do not work if hfs.tpl is destroyed before the launch of hfs
  exit;
  end;
NEW:
Quote
ini:=loadFile(cfgPath+CFG_FILE);
if ini > '' then
  begin
  if fileExists(cfgPath+TPL_FILE) then tpl:=loadFile(cfgPath+TPL_FILE) // load the hfs.tpl if exist
  else begin                   // else load the internal template
        tpl:=defaulttpl;
        tplFilename:='';  //force to create and save to TPL_FILE
        end;
  saveMode:=SM_FILE;
  moveLegacyTpl(tpl); // save the current tpl
  exit;
  end;
At home, I work with a more pushed version, but here it is the minimum necessities.
just for information:
Quote
function loadCfg(var ini,tpl:string):boolean;
  // until 2.2 the template could be kept in the registry, so we need to move it now.
  // returns true if the registry source can be deleted
  function moveLegacyTpl(tpl:string):boolean; //189
  begin
  result:=FALSE;
  if tpl = '' then exit;
  if tplfilename='' then tplfilename:= cfgPath+TPL_FILE;
  try
  saveFile(cfgPath+TPL_FILE, tpl);  //create always hfs.tpl for editor
  //**result:= // until the version is stable, we should not delete the registry anyway
  except result:=false; end;
  end; // moveLegacyTpl
begin
result:=TRUE;
ipsEverConnected.text:=loadfile(IPS_FILE);
ini:=loadFile(cfgPath+CFG_FILE);
if ini > '' then
  begin
  if fileExists(cfgPath+TPL_FILE) then tpl:=loadFile(cfgPath+TPL_FILE) // load the hfs.tpl
  else if fileExists(tplfilename) then tpl:=loadFile(tplfilename)   // else load the tpl filename file
  else                    // else load the internal template
   begin
   tpl:=defaulttpl;
   tplFilename:='';  //force to create  TPL_FILE
   end;
  saveMode:=SM_FILE;
  moveLegacyTpl(tpl); //189
  exit;
  end;
Title: Re: Testing build #192
Post by: rejetto on July 21, 2008, 01:51:20 PM
if ini > '' then
   the file exists for sure, because we just loaded it!

;)
Title: Re: Testing build #192
Post by: Mars on July 21, 2008, 02:20:31 PM
 ;)

1) load CFG_FILE , that ok if  hfs.ini exist

2) if ini>'' is true, if 1) is true, and tplfilename='hfs.tpl'

3) load from TPL_FILE   false if hfs.tpl does'nt exist 
then moveLegacyTpl(loadFile(cfgPath+TPL_FILE)); equivalent to moveLegacyTpl('');

4) call function

Quote
function moveLegacyTpl(tpl:string):boolean;
 ...
 if (tplFilename > '') or (tpl = '') then exit;

somewhere tplfilename (in hfs.ini) can  have as value  '.....\hfs.tpl' but this file has no existence, here is the problem, even if this is compensated by

Quote
if fileExists(tplFilename) then
    if getMtime(tplFilename) > tplLast then
      begin
      tplLast:=getMtime(tplFilename);
      setTplText(loadFile(tplFilename));
      end
    else
  else
    if tplLast <> 0 then
      begin
      tplLast:=0; // we have no modified-time in this case, but this will stop the refresh
      setTplText(defaultTpl);
      end;

I think that it is better necessary to avoid that a grain of sand checks the machine, with a parameter which would not be defined just in time. ;)
Title: Re: Testing build #192 login bug chinesc name
Post by: mmf2 on July 21, 2008, 02:56:20 PM
login bug chinesc name look:

宫 =  [��ѧ��]

 ???
Title: Re: Testing build #192
Post by: rejetto on July 21, 2008, 08:05:39 PM
sorry mars, i was in a hurry and missed the point.
now i had a deeper look at your suggestion, and still don't see the problem with the current code. try rephrasing.
Title: Re: Testing build #192
Post by: TSG on July 22, 2008, 09:52:05 PM
For those that don't peruse the Template board often, RAWR-Template, ToG, and Terayon have been updated using this beta of HFS.

Follow this to get to the RAWR-Designs board:
http://www.rejetto.com/forum/index.php?board=34.0