Announcement

Collapse
No announcement yet.

Clearing Chatroom after exiting it

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hi there conquer,

    I haven't changed the code on your site, only you can do that.

    What I am saying is that I can modify the code that you gave me in the zip file.

    Post #12 is a report of my testing.



    ~ the original bald headed old fart ~

    Comment


    • #17
      I'm a bit confused. Are you saying you can fix the code that it will delete stuff?

      Comment


      • #18
        Hi there conquer,

        Yes, I can make the clicking of "Exit Chat" option clear all the messages.

        I also pointed out...

        Of course, this option will also be available to other occupants of the chat room.

        This means that a visitor could enter the room, leave a message, click "Exit Chat"
        and you would be totally unaware of the messages.

        I await your comments, with interest.


        ~ the original bald headed old fart ~

        Comment


        • #19
          Hi there conquer,

          I have now amended the code so that only you can clear the message box when clicking the "Exit Chat" option.

          Replace your chatroom folder with the one in the attachment.

          I have assumed that you are using "Louis Gaudry when signing in.

          If you want to change it something else then open the index.php file in the chatroom folder and go to line #33
          where you will find this...

          Code:
          
          if ($_SESSION ['name']== "Louis Gaudry") {
              ftruncate($fp, 0);
           }
          
          Just change it to suit. :agree;

          Attached Files


          ~ the original bald headed old fart ~

          Comment


          • #20
            The chat room is not used to leave messages. So if someone leaves the chatroom. there screen will clear. but when they go back in, and theres a conversation going on. That person can start seeing it. Does that make scence?

            Comment


            • #21
              Hi there conquer,

              The code that I have given you in the attachment works like this...

              1. For everyone, EXCEPT YOU ,the chat room stays as it was, OK.

              2. For YOU, the content box is cleared of ALL CONTENT only when you click "Exit Chat".
              Sorry, but I cannot make the explanation any simpler than that.


              ~ the original bald headed old fart ~

              Comment


              • #22
                Ok thank you

                Comment


                • #23

                  So, have you now tested it to your satisfaction?


                  ~ the original bald headed old fart ~

                  Comment


                  • #24
                    yup. Thumbs up

                    Comment


                    • #25

                      Oh great, it's 2am this side of the pond and I can now go to bed for some zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.


                      ~ the original bald headed old fart ~

                      Comment


                      • #26
                        Hi there conquer,

                        I forgot to mention that you can also manually clear the contents of the message box.

                        1. If you open the chatroom folder you find an HTML file named log.

                        2. If you open this file with your editor you will find content similar to this...

                        Code:
                        
                        <div class='msgln'><i>User coothead has joined the chat session.</i><br></div>
                        <div class='msgln'>(10:41 AM) <b>coothead</b>: this a test message!!<br></div>
                        <div class='msgln'><i>User coothead has left the chat session.</i><br></div>
                        
                        3. These lines can be deleted individually or completely.


                        ~ the original bald headed old fart ~

                        Comment


                        • #27
                          thank you very much

                          Comment

                          Working...
                          X