Client interface update

shawn
2011-02-23
2012-11-15
  •  shawn

    shawn - 2011-02-23

    How does the client chat update, the mechanism - I edited some code to allow for multiple chat (i could share it), but the problem I have is when the client checks for updates, I cannot find the code for this.

     
  •  shawn

    shawn - 2011-02-23

    The problem is: when the client checks gets an update, I require to pass it the channelID (get/post) so the server knows which tables to do a lookup.

    I know that chat.js -> updateChat() does not do the updates, since rem'ing this out, still allows for update messages to pass.

     
  •  shawn

    shawn - 2011-02-23

    I have edited the client side ajaxconfig  which allows me to customize the page to connect to for searching updates, everything I tested so far works (new messages from other users, login, logout, etc).

    BUT there is still a connection to the index.php page at regular intervals, which I don't know what is calling.  I doesn't seem to affect anything, but I'm not sure what code is calling this:

    Using my error console in firefox, I still see a connection to:

         http://www.mywebsite.com/chat/?ajax=true&lastID=8176

    What is calling this? and why didn't the config ajaxURL override the link it's connecting to?

     
  •  shawn

    shawn - 2011-02-23

    I got multiple chat rooms working correctly, without having to duplicate any code, but inserting about 25 lines of code into the original code, but each room must have it's own SQL tables (which is easily doable).  I ran into a problem with changing settings….  I'm not exactly sure why changing settings will not make the same call as sending a message…

    If people want, I will post the changes necessary to handle multiple chat rooms.

     
  •  shawn

    shawn - 2011-02-23

    I solved the problem of language modification, by editing
    switchLanguage: function(langCode) {
    window.location.search = '?lang='+langCode;
    }

    to:
    window.location.search = '?channelID='+this.loginChannelID+'&lang='+langCode;

    Now I can have multiple chatrooms on a single page (I removed the feature allowing to jump to another chat room, but it  should work), no reloading etc.

    Files requiring modification:
    clientside -
       chat.js (additional 5 lines + 10 lines of personal code)

    serverside -
      AjaxChat.php - 0 lines
      Config.php - 14 lines (could put somewhere else, but I'm not to sure how)

      index.php - 2 line modification

    your call to open the page must include a channelID GET VARIABLE, or the system will break

    basically each chatroom has it's own Session variables, and own DB Tables, in the config.php, I modified the page to load up dynamically a unique set of session variables and DB tables, it's adhoc, but works elegantly.

     
  •  shawn

    shawn - 2011-02-23

    Sorry, I read my posts, they don't really make sense, the long and short is, if you guys want to have multiple chat rooms, I've figured it out, it has no known glitches, and I think no one has shared how to do it, if you want, I could put the changes I made online for everyone.  It's quite easy, as long as you understand the basics of Ajax Chat (which takes some time to learn).

     
  • Anonymous - 2011-09-11

    Sboy,  I think it would be great to see the code.

    I am currently trying to figure out how to open a new chatbox window for private rooms (an actual room ) that would be seperate from the main chat room window.  The goal is to enable the client to have a private conversation AND to continue with the main room.

    I am also looking through the code to sort the online users by name instead of the random list it is now.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks