Login Message only for the 1st time

Support area for phpBB's mChat extension
Tarantino
Distinguished Donor
Posts: 69
Joined: 21 Oct 2016, 12:59

Login Message only for the 1st time

Post by Tarantino »

Right now the Login message appear for all Logins. I want to change this so it will only appear the 1st login after creating the account.

I was able to do this on the mChat bot for 3.0: https://www.phpbb.com/community/viewtop ... #p13118354

But can't figure out here what to do :|

EDIT: it was not that hard after all, on functions.php just add the bold code:

$is_mode_enabled = !empty($mode_config[$mode]) && $this->settings->cfg($mode_config[$mode]) && (!$this->settings->cfg('mchat_posts_auth_check') || $this->auth->acl_get('u_mchat_use')) && $this->user->data['user_lastvisit'] == 0;
User avatar
kasimi
mChat developer
Posts: 1113
Joined: 06 Oct 2016, 09:56
Location: Germany

Re: Login Message only for the 1st time

Post by kasimi »

Great! :+1: This is in ext/dmzx/mchat/core/functions.php, for anyone who is wondering. :)

If you feel like making an extension for it, hook into dmzx.mchat.insert_posting_before and do this:

Code: Select all

if ($event['mode'] == 'login' && $event['is_mode_enabled'])
{
	$event['is_mode_enabled'] = !$this->user->data['user_lastvisit'];
}
terry2
Posts: 230
Joined: 22 Oct 2016, 18:22
Location: My castle

Re: Login Message only for the 1st time

Post by terry2 »

Admins dont show on login in my chat there blocked from showing logins/post edits :lol:

There is an ext out i'm sure i posted about it here some where it welcome's new users plus other saying you add to it.
Image
User avatar
kasimi
mChat developer
Posts: 1113
Joined: 06 Oct 2016, 09:56
Location: Germany

Re: Login Message only for the 1st time

Post by kasimi »

Yes, there are endless possibilities for interesting customizations. 8-)

Unless you've put them in a new extension, be sure to remember your edits though, or you will lose them during your next update.

Who is online

Users browsing this forum: Bing [Bot], CCBot [Bot], rhyzor99 and 0 guests