Insert username...

Support area for phpBB's mChat extension
User avatar
wads24
Distinguished Donor
Posts: 26
Joined: 26 Aug 2018, 02:16
Location: Idaho

Insert username...

Post by wads24 »

How would I add variable username in the language file for announcing user logged in?
I am a crazed lunatic that has desires... :lol: :lol: :D
User avatar
kasimi
mChat developer
Posts: 1154
Joined: 06 Oct 2016, 09:56
Location: Germany

Re: Insert username...

Post by kasimi »

Hi,
  • Open ext/dmzx/mchat/core/notifications.php
  • Find, around line 286:

    Code: Select all

    $row['message'] = $this->lang->lang_array($lang_key, $lang_args);
  • Add after:

    Code: Select all

    if (in_array($type, [self::LOGIN_VISIBLE, self::LOGIN_HIDDEN]))
    {
        $lang_args[] = $row['username'];
    }
Now you can use %s in this language key to get the name of the user who just logged in: https://github.com/kasimi/mChat/blob/92 ... on.php#L81

Who is online

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