Menu

Run a command when a user enters chat?

Help
Anonymous
2001-07-25
2012-09-14
  • Anonymous

    Anonymous - 2001-07-25

    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.

     
    • Anonymous

      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!

       
      • wickedbob

        wickedbob - 2001-07-30

        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.

         
    • Anonymous

      Anonymous - 2001-08-05

      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!

       
    • wickedbob

      wickedbob - 2001-08-26

      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.

       
    • Anonymous

      Anonymous - 2002-09-29

      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.

       
    • Anonymous

      Anonymous - 2002-10-21

      Anyone have any more info on this?

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.