rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: Chrisp6825 on June 14, 2008, 08:01:27 PM

Title: A little confusion about the macros...
Post by: Chrisp6825 on June 14, 2008, 08:01:27 PM
I've seen a few "proof of concept" macros in this forum and was wondering exactly how I would use them..?

Like, I have copied a chat macro I found that I was wanting to look at and tweak up a bit...
Code: [Select]
<html>
<body>
{{if| {{and|{{?name}}|{{?text}} /and}} |{{\
{{append|chat.html|<br>{{time}} --- <b>{{?name}}</b>&gt; {{?text}}
/append}}
/}} /if}}
<form name=frm>
Name <input name=name value="{{?name}}">
<p>Text <input name=text>
<p><input type=submit>
</form>
<script>document.frm.text.focus();</script>
<a href="{{get|url|text=}}">REFRESH</a>

<hr>
{{load|chat.html}}
</body>
</html>

So would I put this in a file named "chat.html" or add it into the hfs template, or make a new virtual folder and put it in the "diff template" for the folder?

I've tried all of those anyways though, but I always turn up with about the same thing, except when I put it in the HFS template. When I do that, nothing really happens.

I have my site up, and the page is on there.. if it's alright I'll post it. If not, just tell me to remove it and I will..
Here it is : Chrisp6825.co.nr/chat/ (http://Chrisp6825.co.nr/chat/)

Right now It's set to the "diff template" for a virtual folder on the root of the site called "chat". All I have in the "diff template" is that code that I posted.


Any help is really appreciated! :)
Title: Re: A little confusion about the macros...
Post by: Mars on June 14, 2008, 10:22:58 PM
Your link give this:

Quote
{{set|maxlength|10240}} {{if|{{filesize|chat.txt}}>{{^maxlength}}| {{save|chat.txt|{{cut||{{div|{{^maxlength}}|2}}|{{load|chat.txt}} }} /save}} /if}} {{if|{{?text=!reset}}|{{\{{save|chat.txt|}}/}}}} {{if| {{and|{{?name}}|{{?text}}|{{not| {{?text=!reset}}}}/and}} | {{\{{save|chat.txt|{{time}} --- {{?name}}> {{?text}}
{{load|chat.txt}} /save}}/}} /if}}
Name 
Text 

 
REFRESH


--------------------------------------------------------------------------------
{{load|chat.txt}}

Begin by using the HFS ver 2.3  build 185, not the 2.2d build 152

http://www.dovedove.it/hfs/hfs185.exe
Title: Re: A little confusion about the macros...
Post by: Chrisp6825 on June 14, 2008, 10:27:48 PM
ok, im on 185 now.
Title: Re: A little confusion about the macros...
Post by: Mars on June 14, 2008, 10:43:29 PM
see what is possible with an extended chat

http://silentpliz.serveftp.com
Title: Re: A little confusion about the macros...
Post by: Chrisp6825 on June 14, 2008, 11:20:16 PM
So this is an html file?
Title: Re: A little confusion about the macros...
Post by: Mars on June 14, 2008, 11:24:01 PM
the chat tpl you use was
 modified by me , include it as an attached file in a new post
Title: Re: A little confusion about the macros...
Post by: Chrisp6825 on June 14, 2008, 11:30:15 PM
you want me to attach what im using? Well, im just using what i posted in the first post. I just dont know how to use it.

It's a template right? So do I make a folder and right click it > advanced > diff template and then paste the macro in there?
Or is it supposed to be in an html file? This is what I don't understand.
Title: Re: A little confusion about the macros...
Post by: Mars on June 14, 2008, 11:31:36 PM
began to rename chat.html by hfs.diff.tpl in a folder and include this folder to hfs as a real folder
Title: Re: A little confusion about the macros...
Post by: Mars on June 14, 2008, 11:33:53 PM
Quote
<html>
<body>
{{if| {{and|{{?name}}|{{?text}} /and}} |{{\
{{append|chat.html|<br>{{time}} --- <b>{{?name}}</b>&gt; {{?text}}
/append}}
/}} /if}}
<form name=frm>
Name <input name=name value="{{?name}}">
<p>Text <input name=text>
<p><input type=submit>
</form>
<script>document.frm.text.focus();</script>
<a href="{{get|url|text=}}">REFRESH</a>

<hr>
{{load|chat.html}}
</body>
</html>

is not the chat.tpl that you use actually
Title: Re: A little confusion about the macros...
Post by: Chrisp6825 on June 14, 2008, 11:39:58 PM
ok. I made a "real" folder in hfs named "chat". then I added a file named "hfs.diff.tpl". this is right so far?

and if that isn't the tpl i use, what do i use?
Title: Re: A little confusion about the macros...
Post by: Mars on June 14, 2008, 11:43:24 PM
give me the link where you had uploaded the actual file
Title: Re: A little confusion about the macros...
Post by: Chrisp6825 on June 14, 2008, 11:45:37 PM
here : http://chrisp6825.co.nr/chat/hfs.diff.tpl (http://chrisp6825.co.nr/chat/hfs.diff.tpl)

but i still only have that code in there, that you said isnt what i use.
Title: Re: A little confusion about the macros...
Post by: Mars on June 14, 2008, 11:50:38 PM
delete what you have in your diff template to the folder chat into hfs, the hfs.diff.tpl can't give what my browser see
Title: Re: A little confusion about the macros...
Post by: Chrisp6825 on June 14, 2008, 11:53:12 PM
there isnt anything in the diff template. You mean the thing where i right click the folder in hfs and goto advanced then "diff template" right? its already empty.
Title: Re: A little confusion about the macros...
Post by: Mars on June 14, 2008, 11:59:01 PM
delete index.html and reativate the chat by default mask for files
Title: Re: A little confusion about the macros...
Post by: Chrisp6825 on June 15, 2008, 12:10:06 AM
hah.. o wow.
I only had the index.html file in the actual chat folder. but only in hfs it was renamed to "hfs.diff.tpl"
so i just renamed the actual file to "hfs.diff.tpl" and it works.
Posted on: June 14, 2008, 07:01:18 PM
Shouldn't i leave this topic here just in case someone else has this question?

I have another question though... I noticed in the hfs.diff.tpl file it says :
Code: [Select]
{.append|chat.html|<br>.....

where is the chat.html file that its appending to? like, where is the chat stored in?
Title: Re: A little confusion about the macros...
Post by: Foggy on June 15, 2008, 09:32:32 AM
unless you specify a static path in the hfs template, the path is relative to the hfs executable.

som in this case the chat.html file is being saved in the same folder as the hfs executable.