rejetto forum

New CHAT.TPL

Mars · 16 · 8930

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
Moved lower in the topic
« Last Edit: January 11, 2008, 10:03:35 PM by mars »


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
Vu, lu, et aprouvé !  :D

Un petit détaïl:
Le fait qu'il commence le "refresh" à l'ouverture, oblige à speeder pour entrer le pseudo, ou à taper une lettre en zone texte.
Ce serait peut-être mieux (si possible), que le "refresh" commence au premier envoi.

Remarque que je peux toujours augmenter le délai entre refresh... mais tous le monde ne met pas les mains dans le "cambouis" si peu soit-il.

C'est juste pour que ce chat ronronne dans tous les foyers. ;D

Sinon, il est toujours aussi sympa.

++
« Last Edit: January 10, 2008, 06:53:02 AM by SilentPliz »


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
If we can make this chat into a shoutbox, i will use it in my new template. The only downside i can think of is editing out spam, they'
ll have to edit the file directly am i right?


Offline Foggy

  • Tireless poster
  • ****
    • Posts: 806
    • View Profile
now that we have save, it would be possible but difficult. When I finish my current project I'll have a look at creating a shoutbox, it will be similar to what I'm doing now except simpler.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
Chat.tpl was supplied by rejetto, and is in the sourcesof the beta version

I use it by creating a virtual directory  CHAT and by authorizing only the identified accounts, and by placing html code  in folder right-click-->> advanced - > diff-template of the concerned directory



Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
Si tu veux jeter un oeil sur ton chat sur mon hfs, j'ai fait des modifs qui fonctionnent (zone d'affichage du dialogue style %comment%,) et j'ai placé des boutons smiley, mais je ne sait pas les faires fonctionner.

A côte de la zone d'affichage de la conversation, j'ai essayé d'insérer un textarea pour éditer directement le fichier chat.txt en temps réel... mais c'est pas pour aujourd'hui. :-\

« Last Edit: January 10, 2008, 08:43:32 PM by SilentPliz »


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
adding auto refresh every 10s , refresh stopped if your TEXT box is not empty or if focus is on name

a text is examined with one pass to reset chat.txt   ( by default !reset)

you can change !reset by {{load|chatpass.txt}} and put your command in chatpass.txt who must be plced in same directory as chat.txt


 
last entry is at first now (changing 'append' to 'save' ) and you can choice the maxlength for the file

Quote
<html>
<head>
<script language="JavaScript" type="text/JavaScript">
<!--
var refresh=true;
function Frefresh() {
if ((document.frm.text.value=='') & (document.frm.login.value>'') & refresh)
 window.location="{{get|url|text=}}";
};
setTimeout("Frefresh()",10000);
//-->
</script>
</head>
<body>
{{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}} --- <b>{{?name}}</b>&gt; {{?text}}<br>{{load|chat.txt}}
/save}}/}} /if}}
<form name=frm>
Name <input id=login name=name value="{{?name|%user%}}" onfocus="javascript:refresh='false';" onblur="javascript:refresh='true';">
<p>Text <input id=text name=text onfocus="javascript:refresh='true';" >
<p><input type=submit>
</form>
<script>document.frm.text.focus();</script>
<a href="{{get|url|text=}}">REFRESH</a>
<hr>
{{load|chat.txt}}
</body>
</html>
</body>
</html>



with chatpass.txt

Quote
<html>
<head>
<script language="JavaScript" type="text/JavaScript">
<!--
var refresh=true;
function Frefresh() {
if ((document.frm.text.value=='') & (document.frm.login.value>'') & refresh)
 window.location="{{get|url|text=}}";
};
setTimeout("Frefresh()",10000);
//-->
</script>
</head>
<body>
{{set|maxlength|10240}}
{{if|{{filesize|chat.txt}}>{{^maxlength}}|
  {{save|chat.txt|{{cut||{{div|{{^maxlength}}|2}}|{{load|chat.txt}} }} /save}}
 /if}}
{{if|{{?text={{load|chatpass.txt}}}}|{{\{{save|chat.txt|}}/}}}}
{{if| {{and|{{?name}}|{{?text}}|{{not| {{?text={{load|chatpass.txt}}}}}}/and}} |
{{\{{save|chat.txt|{{time}} --- <b>{{?name}}</b>&gt; {{?text}}<br>{{load|chat.txt}}
/save}}/}} /if}}
<form name=frm>
Name <input id=login name=name value="{{?name|%user%}}" onfocus="javascript:refresh='false';" onblur="javascript:refresh='true';">
<p>Text <input id=text name=text onfocus="javascript:refresh='true';" >
<p><input type=submit>
</form>
<script>document.frm.text.focus();</script>
<a href="{{get|url|text=}}">REFRESH</a>
<hr>
{{load|chat.txt}}
</body>
</html>
</body>
</html>



Offline maverick

  • Tireless poster
  • ****
    • Posts: 1052
  • Computer Solutions
    • View Profile

If you want to chat with one or more of your users, how do you alert him so he knows that somebody wants to chat?  You won't see people hanging around looking at the chat screen waiting for someone to drop by and say something!
maverick


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs

Offline maverick

  • Tireless poster
  • ****
    • Posts: 1052
  • Computer Solutions
    • View Profile

To solve the alert problem, it might be better for the chat to be in the form of a popup window when in use and manually closed when chat is finished.  Without a chat alert of some type, this feature is somewhat useless IMHO.
maverick


Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
A chat-option is a good example to show what we can do with macros. For test-purposes i have tried with an inlineframe that can be switched on/off and another option with a small new window.

To give it some use, it is limited to some kind of shoutbox, for example to leave some feedback to the admin or to leave some question or suggestion.

But chat would at least imply list of connected users, better an optional connect/disconncet option as not al users may want to chat nor want that others see that they are connected....  ... how many users would be connected to a small home-server to chat ?!

So,  putting a 'chat' on a homepage - fileserver is an other good example of what rejetto calls 'Voidism' .
your computer has no brain - use your own !


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
It is fine as a shoutbox, not much of a chat, i think the name just got 'lost in translation'. People like to leave me messages and I answer them when i notice them. It is great when someone finds a problem or is just simply posting a positive remark about the site. If someone is having problems with the server, they can post their troubles in the shoutbox for the administrator to sort out the problem.

I am going to try out this 'chat' shoutbox now and implement it in the rawr-template if i like it ;)

I can't get my messages to save to the text file...
« Last Edit: January 12, 2008, 11:12:21 AM by That_Stevens_Guy »


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
We do not have to forget that a browser is not a server, A real chat works on the principle client-server, as skype msn irc ...., The advantage with regard to a southbox simple is the refresh all the 10s in the template, you can associate a popup or a music every time last line change and then you obtain an appearance of CHAT


Offline Foggy

  • Tireless poster
  • ****
    • Posts: 806
    • View Profile
Im not sure if you are already using AJAX for the refresh, but if you arnt I recommend that you give it a try as you wont have to refresh the whole page or frame.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
Quote
Im not sure if you are already using AJAX .. , but if you arnt I recommend that you give it..

 ;D ;D ;DIn my country, ajax is a domestic cleaner and I sometimes use it to wash me hands ;D ;D ;D

I use especially the macro and little of javascript when I cannot make otherwise.

It is the purpose of hfs, to be the most autonomous possible, and not to add him external subtleties. Otherwise so much use a server IIS or FTP.

Certainly we cannot do without module to listen to mp3 or show the AVI, but to use hfs as a Christmas tree by putting in it full of decorations, I prefer to see the natural beauty of the tree which hides below
« Last Edit: January 12, 2008, 02:05:55 PM by mars »