rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: yoksan on August 31, 2008, 03:24:27 AM

Title: HFS with ChatROOM or Message box ?
Post by: yoksan on August 31, 2008, 03:24:27 AM
Helo,

I try to check and search the forum, but all link is outdated.
What i want is how to add ChatROOM or Message box like shout mix in hfs ?
I found this function quite interesting in the WWW File Share Pro 5.3 with the plugin Chatroom and Message, so i wonder can hfs do something like this ? or how to edit the template if i just copy the plugin from WFS Pro 5.3 to hfs? is it working ? or do you have any idea how to do it ?

Can you please list down the procedure step by step ?

Expert please help.


THanks,
yoksan
Title: Re: HFS with ChatROOM or Message box ?
Post by: rejetto on August 31, 2008, 12:49:04 PM
Did you consider using a template with chat support?
Title: Re: HFS with ChatROOM or Message box ?
Post by: yoksan on August 31, 2008, 05:08:03 PM
ya i have considered it , but is just that i don't know how to edit or add the code...
mind that you provide me the code and teach me how to use it ? thanks
Title: Re: HFS with ChatROOM or Message box ?
Post by: rejetto on September 01, 2008, 09:42:27 AM
easy: download the template you like, and just drag&drop it over HFS.

but this is true only if you use the last beta version
Title: Re: HFS with ChatROOM or Message box ?
Post by: yoksan on September 01, 2008, 02:05:44 PM
I don't know which one that has the chat support.
can you please provide me the download link for template that have chat function ?
give me a few link ?

thanks..
Title: Re: HFS with ChatROOM or Message box ?
Post by: rejetto on September 01, 2008, 02:10:05 PM
I guess this template has it
http://www.rejetto.com/forum/index.php?topic=5456.0
Title: Re: HFS with ChatROOM or Message box ?
Post by: Mars on September 01, 2008, 09:20:45 PM
A solution on the basis of the work of rejetto: the file of saving 'chat.txt' is situated in the directory of hfs.exe. there is one auto-refresh of 5000 ms (that is 5s) when the field name is filled and when the text field is empty. it is added  the possibility of resetting the chat.txt file with the command
 '!Clear' , her size max is fixed to 10240 characters and divided by two when the max is reached.

You can use this code as diff template in a virtual folder, or to rename it as hfs.diff.tpl in a real folder of the vfs.

To use several copies of chatlight.tpl, rename the chat.txt name by the other one in the line: {.set | chatfile | chat.txt .}

the pass to reset file is at line: {.set | pass | !clear .}   ( ! is used as an IRC command)

auto refresh at line:  if (refresh) setTimeout("Prefresh()",5000);  ( 5000 = 5 second )

max length for chat.txt is at line: {.set| maxlength | 10240.}

Title: Re: HFS with ChatROOM or Message box ?
Post by: ebola on September 02, 2008, 03:14:43 PM
w0w

This is realy cool @ mars!
I like the idea and how you have done this.


Maybee you could help me with the following:
I would like to have a input-field (like your message-field) and a button.
User enters info in textfield and hit button.
After that he will be redirected to a existing html-file.

Checked google and found some things (onsubmit=) but can't get it to work :(

Cheers,
ebola
Title: Re: HFS with ChatROOM or Message box ?
Post by: Mars on September 02, 2008, 03:43:02 PM
better that... google page with an IFRAME
Title: Re: HFS with ChatROOM or Message box ?
Post by: ebola on September 02, 2008, 05:37:43 PM
Hi

anyone knows what's wrong with that:

Code: [Select]
<html>
<head>
<title>BlahBlah</title>

<!-- Define special:begin -->
{.set|Rnd_No|{.random number|1000000000|9999999999/random number.}/set.}

<!-- Save input to file on hard drive -->
{.save|{.^Rnd_No.}.txt|{.?text.}/save.}
</head>

<script language="JavaScript">
<!--
function na_change_location(url)
{
  location=url;
}

// -->
</script>

</head>
<body>

<form name="frm">
    <input type="text" name="text">
    <input type="submit" OnClick="na_change_location('abc.html');">
</form>

</body>
</html>

It saves the file with the userinput just fine - but wont redirect to abc.html :(
Title: Re: HFS with ChatROOM or Message box ?
Post by: rejetto on September 02, 2008, 08:57:44 PM
try
location.href = url;
Title: Re: HFS with ChatROOM or Message box ?
Post by: ebola on September 02, 2008, 10:23:05 PM
Hi

Not working either :(
I think it's not possible to use submit and another action like onClick for same button.
either it is saving text or redirecting. Tried 100 different solutions from google but none is working for both things.


ebola
Title: Re: HFS with ChatROOM or Message box ?
Post by: rejetto on September 02, 2008, 10:50:28 PM
yes, it is possible, in several ways i think.
method1: normal button, onclick, do your job, then
document.getElementById('id_of_the_form').submit();
Title: Re: HFS with ChatROOM or Message box ?
Post by: ebola on September 03, 2008, 07:43:48 PM
Hi

Thx for your answer & help.
I think I leave this thing. Pure html and macros are fine. But for the project I'm running most people have scripts disabled so there is no way for fancy things like that.

Thx anyway,
ebola
Title: Re: HFS with ChatROOM or Message box ?
Post by: rejetto on September 04, 2008, 08:34:22 AM
what's that you cannot get without javascript?
Title: Re: HFS with ChatROOM or Message box ?
Post by: ebola on September 04, 2008, 10:34:38 AM
Hi

- Getting user-input from a txt-field with click on button (working)
- saving input to file after click (working)
- redirecting user to another site after click (not working)


ebola
Title: Re: HFS with ChatROOM or Message box ?
Post by: rejetto on September 04, 2008, 10:47:41 AM
solution without javascript (though i got it working with javascript first)

Code: [Select]
<html>
<head>
<title>BlahBlah</title>

{.if|{.?text.}|{:
{.save|{.random number|1000000000|9999999999/random number.}.txt|{.?text.}/save.}
<meta http-equiv="refresh" content="0; url=abc.html">
:}.}

</head>
<body>

<form>
    <input type="text" name="text">
    <input type="submit">
</form>

</body>
</html>
Title: Re: HFS with ChatROOM or Message box ?
Post by: mmf2 on September 04, 2008, 02:37:10 PM
Have forum.tpl? ;D
Title: Re: HFS with ChatROOM or Message box ?
Post by: ebola on September 05, 2008, 06:52:17 AM
@rejetto:

w0w !

This is just too good.......
Thank you very much!
Nice software, nice forum, nice people, nice support


Thank you,
ebola