Page 1 of 1

[HowTo] Individual static messages for rooms

Posted: 13 Jul 2018, 19:04
by kasimi
@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 -

Re: [HowTo] Individual static messages for rooms

Posted: 13 Jul 2018, 20:10
by terry2
Another tip to get room id's look at mchat room table in database.

Re: [HowTo] Individual static messages for rooms

Posted: 15 Jul 2018, 10:52
by rammstein
hello Kasimi

what are the files we need to nodify ?

Re: [HowTo] Individual static messages for rooms

Posted: 16 Jul 2018, 06:25
by BanterFace
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.

Re: [HowTo] Individual static messages for rooms

Posted: 16 Jul 2018, 20:42
by kasimi
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.

Re: [HowTo] Individual static messages for rooms

Posted: 19 Aug 2018, 16:10
by jan_2017
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: