• Resolved ColdJackle

    (@coldjackle)


    Hello there πŸ™‚

    First of all I would like to thank you for this amazing plugin! This is the only one I found that suits our interests.

    However there are some things I’d like to ask you:

    We need to start a conversation without the widget. I tried to initialize the core handling by calling the “getRenderedChat” function from WiseChat-class and redirect the output. After that I call the “addMessage” function from the MessageDAO (I modified the first two layers to make this public). Adding the message works fine, but it seems, that calling the render-function without displaying the content doesn’t finish the handling. I checked the Database and the channel isn’t created. Before I write my long time trial and error: You know your system the best. Could you provide a way to send a message over a php call?

    And secondly: This could be a related problem, why the handling isn’t finished. We call everything in an AJAX response. This is a result of implementing this plugin in an inbox system. It does nothing more then reading the related channels to the actual user id (stored in a database table) and returning the output of “wise_chat(<channel>)” for the specified channel to the js caller. Just putting it in the InnerHTML of a div-element seems to break some links, because no interactions are handled. It works fine with a static call however.

    I hope you can help us on these problems. And like I said: Nice work! Keep it going πŸ™‚

    https://ww.wp.xz.cn/plugins/wise-chat/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Marcin

    (@marcinlawrowski)

    Hello:)

    It would be better if you provide some link where I can observe these problems with putting the output in InnerHTML of a div-element. Putting just html isn’t enough, you should also initialize the chat with JS call.

    As for the messages sending over PHP – please see just 2 files:
    src/endpoints/index.php
    src/endpoints/WiseChatEndpoints.php
    There is a method messageEndpoint() that serves as an AJAX backend for sending messages. You can do exactly what index.php does:
    1. initialize WiseChatEndpoints object
    2. run messageEndpoint() method

    Thanks!
    Marcin

    Thread Starter ColdJackle

    (@coldjackle)

    We changed the system design, so there is no more need to display it via AJAX. The Box is loaded through a search query instead. This also fixes the php sending problem, because the channel is created later, but this doesn’t affect the messages that were allready sent.

    I also tried to call messageEndpoint(), but this results in an endless loop. (Called from the AJAX PHP function)

    However, there are no more serious problems. I’m sorry I can’t provide the old code, but I would have to recreate the entire system πŸ˜€

    Thanks for your help and keep up the good work πŸ™‚

    (Althoug I didn’t fix the original problem, I’ll mark it as resolved)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Dynamic Usage’ is closed to new replies.