rejetto forum

A little confusion about the macros...

0 Members and 1 Guest are viewing this topic.

Offline Chrisp6825

  • Occasional poster
  • *
    • Posts: 20
    • View Profile
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/

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! :)


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
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
« Last Edit: June 14, 2008, 10:31:01 PM by mars »



Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
the chat tpl you use was
 modified by me , include it as an attached file in a new post


Offline Chrisp6825

  • Occasional poster
  • *
    • Posts: 20
    • View Profile
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.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
began to rename chat.html by hfs.diff.tpl in a folder and include this folder to hfs as a real folder


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
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


Offline Chrisp6825

  • Occasional poster
  • *
    • Posts: 20
    • View Profile
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?


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
give me the link where you had uploaded the actual file


Offline Chrisp6825

  • Occasional poster
  • *
    • Posts: 20
    • View Profile

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
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


Offline Chrisp6825

  • Occasional poster
  • *
    • Posts: 20
    • View Profile
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.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
delete index.html and reativate the chat by default mask for files


Offline Chrisp6825

  • Occasional poster
  • *
    • Posts: 20
    • View Profile
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?


Offline Foggy

  • Tireless poster
  • ****
    • Posts: 806
    • View Profile
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.