Mibew Messenger Community

General => Support => Topic started by: Afrit on May 29, 2015, 02:06:17 PM

Title: Chat invitation pop up after x seconds on page
Post by: Afrit on May 29, 2015, 02:06:17 PM
Hi,

I would like to alter mibew so that the chat invitation pop up pops up after the user has been on the same page for x seconds.
Can someone please direct me to which classes I should look in to change this?
I'm new to mibew and don't really know what all the classes do.

I'm using mibew 2.0.1.

Thanks in advance.

-Afrit
Title: Re: Chat invitation pop up after x seconds on page
Post by: Dmitriy Simushev on May 29, 2015, 02:37:02 PM
Hi,

I believe you can create a server-side Mibew plugin which will invite visitors after checking some conditions (pages visited, time spent on site, etc...).

To start with plugins take a look at Boilerplate plugin (https://github.com/Mibew/boilerplate-plugin). Also you definitely should take a look at Events::VISITOR_TRACK event (http://docs.mibew.org/development/server-side-events.html#visitor-events). It could be useful.

An example of simple auto-invitation logic can be seen here: https://github.com/JustBlackBird/aggressive-messaging/blob/master/Bug/Mibew/Plugin/Aggressive/Plugin.php#L109-L130 . The code is outdated and has to be rewritten but it can be the starting point for you.
Title: Re: Chat invitation pop up after x seconds on page
Post by: Afrit on May 29, 2015, 09:41:43 PM
Thank you very much Dmitriy! I'm going to look at those projects.