Different Chat ID's on the same page

I am looking at customising the chat plugin by using the chat id to my advantage.

I am thinking that each ID serves what is stored on that chat.

So ideally:
- Chat id="7"
- Chat id="8"

are completely different chats and will hold completely different conversations, is that correct?

So that way, I can store the short code within my dreamweaver template, and run a WP loop that will create 100's of different chats for different users that chose a different option when signing up.

Is this correct, would using the chat ID in this way work?

(Providing, that this is how chat's are distinguished differently).

  • Mike

    Hi @owen_o_neill

    Thanks for posting your question!

    I'm afraid that I'm no coder, so I could be horrendously wrong, however I have looked through the plugin files and it looks to me as though you are correct, the chat ID is regularly referenced when displaying, logging, loading chats.

    If you know PHP, what you might be able to do is change the ID that is used, to the user ID, that way each user could have their own chat that is only displayed to them.

    Don't ask me how you would go about doing that though!

    I hope I have been able to add some clarification and that my comment has helped point you in the right direction.


  • Paul


    As they say you don't want to be messing with the code underneath. Yes, in the current version the ID of the shortcode is used and useful for your needs. But in the upcoming Chat 2.0 we have done away with the public chat ID.

    Basically the ID within chat is used to group all the message for a given chat session. You can see this via the wp_chat_messages and wp_chat_logs database tables. All messages are stored within the wp_chat_messages table. The wp_chat_logs table provides a way to group the messages by session.

    So how does this change in Chat 2.0? When you add the shortcode to a Page a unique number is created and used for the chat id. This seems silly since each post type already has a unique post ID. So we are dropping the use of the ID within the shortcode. Each shortcode will instead assume the ID from the post_type ID. Similarly we have widget chat. Well each widget within the WorPress system has a unique ID assigned to it. So that will be used in place of the random ID we were using. Also, in Chat 2.0 we are introducing private 1-to-1 chat session. These will be a random 16 alphanumeric ID.

  • owen_o_neill


    Right it seems that that will work fine, but to be fair there is a bit fo a flaw with the chat 2.0 if it originates the page/post template ID, as that means the chat id cannot be used several times on one template. I would have to use a a different template per page, or run a loop that spits our a post and then changes the ID, which means I have to have 100's of different posts as appose to one template, and several chat IDs.

    What would you recommend, to have it working as seamlessly as possible?


  • Paul


    You can still use the ID parameter for shortcode. What I meant was it was being removed for new post/pages. So the basic shortcode should be just [chat] instead of [chat id='345']

    But yes this is going to create still an issue since you may be using a ID value like 100. Then on a different post where the post ID is actually 100 you use the simple [chat] without the ID. This will create confusion.

    I guess still I'm not following what you are building exactly. You are building a template. Is this like a WP page template? In that case things should be more dynamic. Don't hardcode the chat ID.

    Still not seeing how a page with 100 different chat sessions will function for the user. Mostly from a performance perspective. But I'm sure you have some prototype working, Yes?

  • owen_o_neill

    @Paul - What I will be doing will be using a WP master-template, then hardcoding the chat ID within a WP Loop that displays a certain chat id based on a dropdown box that user chose earlier.

    So each user will only see one chat box, but ONLY one chat box based on their choices - If that makes sense?

    (is there a way to combine chats)

    So say I have a chat ID assigned to page 1 and a separate chat ID assigned to page 2. Could I make a page 3 that collects the data from page 1 and page 2 and combines it into one chat for page 3.

    So Page 3 can talk to page 2 and 1 users, while page 2 talk to page 2 users, and page 1 users only talk to page 1 users.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.