[HowTo] Individual static messages for rooms

Chat rooms for mChat with optional password protection and 1-on-1 chats
Post Reply
User avatar
kasimi
mChat developer
Posts: 728
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

[HowTo] Individual static messages for rooms

#1

Post by kasimi » 13 Jul 2018, 19:04

@BanterFace mentioned this idea of having a different static message for each room. There is no feature for this built into Rooms, but with the following code samples you can do this yourself in a much more flexible way. Rooms 1.2.1 or later is required.

For each static message you need two parts:
  • HTML container that wraps your message text that you add to your static message box on mChat's global settings page
  • CSS that you can add to any .css file that is loaded with mChat, the most obvious one being ext/dmzx/mchat/styles/prosilver/theme/mchat.css, although you will need to re-apply the changes after the next mChat update.

You can combine the codes below however you like.

  1. Display static message in all rooms
    • HTML

      Code: Select all

      - This code is only accessible to donors -
    • no CSS needed
  2. Display static message only in the lobby
    • HTML

      Code: Select all

      - This code is only accessible to donors -
    • CSS

      Code: Select all

      - This code is only accessible to donors -
  3. Display static message only in room with ID 3
    • HTML

      Code: Select all

      - This code is only accessible to donors -
    • CSS

      Code: Select all

      - This code is only accessible to donors -
      Tip: an easy way to find out the IDs of your rooms is to run this code in your browser console when you're on a page where rooms are displayed:

      Code: Select all

      - This code is only accessible to donors -
  4. Display static message in all public rooms, including the lobby
    • HTML

      Code: Select all

      - This code is only accessible to donors -
    • CSS

      Code: Select all

      - This code is only accessible to donors -
  5. Display static message in all public rooms, excluding the lobby
    • HTML

      Code: Select all

      - This code is only accessible to donors -
    • CSS

      Code: Select all

      - This code is only accessible to donors -
  6. Display static message in all password-protected rooms
    • HTML

      Code: Select all

      - This code is only accessible to donors -
    • CSS

      Code: Select all

      - This code is only accessible to donors -
  7. Display static message in all private rooms
    • HTML

      Code: Select all

      - This code is only accessible to donors -
    • CSS

      Code: Select all

      - This code is only accessible to donors -

terry2
Donor
Posts: 152
Joined: 22 Oct 2016, 18:22
Location: My castle

Re: [HowTo] Individual static messages for rooms

#2

Post by terry2 » 13 Jul 2018, 20:10

Another tip to get room id's look at mchat room table in database.

rammstein
Donor
Posts: 20
Joined: 13 Jan 2018, 01:11

Re: [HowTo] Individual static messages for rooms

#3

Post by rammstein » 15 Jul 2018, 10:52

hello Kasimi

what are the files we need to nodify ?

User avatar
BanterFace
Donor
Posts: 51
Joined: 01 Feb 2017, 12:42

Re: [HowTo] Individual static messages for rooms

#4

Post by BanterFace » 16 Jul 2018, 06:25

Thanks kasimi for making this guide, think it will be helpful for many people who use this ext (including me ;) ).
terry2 wrote:
13 Jul 2018, 20:10
Another tip to get room id's look at mchat room table in database.
Or you can just inspect ul.mchat-rooms, id's in id-html-attributes and data-room-id.

User avatar
kasimi
mChat developer
Posts: 728
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: [HowTo] Individual static messages for rooms

#5

Post by kasimi » 16 Jul 2018, 20:42

rammstein wrote:
15 Jul 2018, 10:52
what are the files we need to nodify ?
I updated the first post to make that a little clearer. Please read again at the top.

User avatar
jan_2017
Distinguished Donor
Posts: 120
Joined: 13 May 2017, 18:07

Re: [HowTo] Individual static messages for rooms

#6

Post by jan_2017 » 19 Aug 2018, 16:10

Hello. And where get the html code?
What file does the HTML code need to be in?

ACP?

Solved.....who can read has a clear advantage :D :beer: :+1:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest