Here is my latest question. How do I run the /clear command when a user enters the chat?
For example...
Lots of people are chatting, causing lots of messages. New user logs in. I would like their chat screen to clear.
It seems like it is fairly straightforward... I would just have to plug in the call to the /clear command after the user logs in, but I can't figure it out.
Anyone have any ideas?
Regards,
Cesar L.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2001-07-27
Ok, I got it to work. I've tested it and it seems to work without any problems. I added a call (basicly added an include line) to the index.lib.php3 page right under the section that displays the "Welcome to our chat.." message.
I also changed the /clear command from showing the last 5 lines down to 2.
So far so good!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everyone!
Here is my latest question. How do I run the /clear command when a user enters the chat?
For example...
Lots of people are chatting, causing lots of messages. New user logs in. I would like their chat screen to clear.
It seems like it is fairly straightforward... I would just have to plug in the call to the /clear command after the user logs in, but I can't figure it out.
Anyone have any ideas?
Regards,
Cesar L.
Ok, I got it to work. I've tested it and it seems to work without any problems. I added a call (basicly added an include line) to the index.lib.php3 page right under the section that displays the "Welcome to our chat.." message.
I also changed the /clear command from showing the last 5 lines down to 2.
So far so good!
what code did you use for the include and which position did you add it?
also, how did you change clear command from 5 to 2 lines??
BoB.
I added this code after the second call to the welcome message. Here's what I did...
// Insert a new welcome message in the messages Table.
include("./${ChatPath}lib/welcome.lib.php3");
// added to clear the screen for a new user
include("./${ChatPath}/commands/clear.cmd.php3");
To change the clear command from clearing 5 lines to 2, all I did was open the file "clear.cmd.php3" and change the line
$N = 5;
to
$N = 2;
I hope that helps!
why run a clear command at all?
just change the number of messages displayed at login in the config.lib.php file
the variable is: define("C_MSG_NB", '1');
displaying 1 msg will allow the user to see the chatroom greeting but nothing else
BoB.
If you change define("C_MSG_NB", '1'); it will then only ever list 1 message at a time. Not good.
But there isn't a way to clear the screen at log on normally, which is a great problem if you're talking about something you don't want other to read.
Anyone have any more info on this?