Playing a one time sound in mchat

Support area for phpBB's mChat extension
Post Reply
User avatar
wads24
Donor
Posts: 6
Joined: 26 Aug 2018, 02:16
Location: Boise Idaho
Contact:

Playing a one time sound in mchat

#1

Post by wads24 » 16 Oct 2018, 20:49

I have a welcome to chat mp3 sound that I would like to play one per session.

How would I do this?

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

Re: Playing a one time sound in mchat

#2

Post by kasimi » 16 Oct 2018, 20:55

Add this to mchat_body.html at the top:

Code: Select all

{% if user.data.is_registered and not user.data.session_admin and user.time_now - user.data.session_start < 3 %}
    <audio class="hidden" src="URL.mp3" autoplay></audio>
{% endif %}
It will only work if mChat is displayed on the first page after logging in.

kaptangula
Posts: 1
Joined: 17 Oct 2018, 07:47

Re: Playing a one time sound in mchat

#3

Post by kaptangula » 17 Oct 2018, 07:50

mod help

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

Re: Playing a one time sound in mchat

#4

Post by kasimi » 17 Oct 2018, 08:04

What is it that you need help with?

User avatar
wads24
Donor
Posts: 6
Joined: 26 Aug 2018, 02:16
Location: Boise Idaho
Contact:

Re: Playing a one time sound in mchat

#5

Post by wads24 » 18 Oct 2018, 19:29

kasimi wrote:
16 Oct 2018, 20:55
Add this to mchat_body.html at the top:

Code: Select all

{% if user.data.is_registered and not user.data.session_admin and user.time_now - user.data.session_start < 3 %}
    <audio class="hidden" src="URL.mp3" autoplay></audio>
{% endif %}
It will only work if mChat is displayed on the first page after logging in.
Awesome sauce! Thanks! It worked great

Post Reply

Who is online

Users browsing this forum: Yandex [Bot] and 1 guest