Daily Lucky Numbers:
9
11
21
38
40
44

Recent posts

#1
can it work in notifications? or make a different sound in notifications?

let it work in messages and notifications
#2
Quoteecho '
</head>
<body id="', $context['browser_body_id'], '" class="action_', !empty($context['current_action']) ? $context['current_action'] : (!empty($context['current_board']) ?
        'messageindex' : (!empty($context['current_topic']) ? 'display' : 'home')), !empty($context['current_board']) ? ' board_' . $context['current_board'] : '', '">';

     
global $boardurl, $context;
// use video, audio or audio2
list($type, $path, $width, $height) = array(
    'audio2',
    'EhMedia',
    '200px',
    '200px'
);

if ($type == 'video' && $context['user']['unread_messages'] >= 1) {
    echo '
<div style="display: none;margin: 0 auto;width: 100%;" class="centertext newPMessageCheckOnce" id="newPMessageCheck"></div>
    <video style="position: relative;left: 50%;transform: translateX(-50%);" width="' . $width . '" height="' . $height . '" id="eh_video_player" poster="">
        <source id="ehvideo_mp4" src="" type=\'video/mp4; codecs="avc1.42E01E, mp4a.40.2"\' />
    </video>
</div>
<script>
    if ($("#newPMessageCheck").hasClass("newPMessageCheckOnce")) {
        $(document).one("mousemove", function(event){
            ehPlayVideo(\'' . $boardurl . '/' . $path . '/alert_bell.mp4\');
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/alert.mp3\');
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/message.mp3\');
            $("#newPMessageCheck").css("display", "flex");
        });
    }
    function ehPlayVideo(url) {
        var ehvideo = $("#eh_video_player");
        ehvideo
[o].autoplay = true;
        ehvideo
[o].src = url;
        ehvideo
[o].load();
        ehvideo
[o].play();
    }
    function ehPlayAudio(url) {
        const audio = new Audio(url);
        audio.play();
    }
</script>';
}
else {
    echo '
<div style="display: none;" class="newPMessageCheckOnce" id="newPMessageCheck"></div>
<script>
    function ehPlayAudio(url) {
        const audio = new Audio(url);
        audio.play();
    }
</script>';

    if ($context['user']['unread_messages'] >= 1) {
        echo '
    <script>
        $(document).one("mousemove", function(event){' . ($type == 'audio' ? '
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/whistle_alert.wav\');' : '
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/alert.mp3\');
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/message.mp3\');') . '
            $("#newPMessageCheck").attr("class", "newPMessageCheckOnce");
        });
    </script>';
    }
}

WORKED THANKS

you really know this job   ;)

#3
General Code/Script Inquiries / Re: adapting the voice alert m...
Last post by Chen Zhen - June 09, 2023, 06:47:22 PM
You have to download the file I provided to make it work.
Put the EhMedia folder in your main forum path (directory).
#4
Site Discussion / Re: Canadian Fires
Last post by Dave - June 09, 2023, 05:15:52 PM
Quote from: Chen Zhen on June 09, 2023, 11:27:38 AMThis week you could see the haze from the smoke and it smelled like burning plastic. Wednesday was the worst as it had a bit of a smothering feeling.
Luckily today we have rain so that cleared the air. We haven't had any rain before this for at least a month, maybe longer.

How about the UK?

We need rain here too.

We have been having some fires in places but it looks like it could get worse as we have not had any significant rain for some weeks and this week we're meant to be getting temperatures in the 30+c range.

At least you and the family are safe that a good thing
#5
Site Discussion / Re: Canadian Fires
Last post by Chen Zhen - June 09, 2023, 11:27:38 AM
This week you could see the haze from the smoke and it smelled like burning plastic. Wednesday was the worst as it had a bit of a smothering feeling.
Luckily today we have rain so that cleared the air. We haven't had any rain before this for at least a month, maybe longer.

How about the UK?
#6
Site Discussion / Canadian Fires
Last post by Dave - June 09, 2023, 09:06:02 AM
Have you been affected by the fires Chen. It's made headline news here in the UK
#7
General Code/Script Inquiries / Re: adapting the voice alert m...
Last post by Chen Zhen - June 09, 2023, 04:58:01 AM

So use the audio2 option.


global $boardurl, $context;
// use video, audio or audio2
list($type, $path, $width, $height) = array(
    'audio2',
    'EhMedia',
    '200px',
    '200px'
);

if ($type == 'video' && $context['user']['unread_messages'] >= 1) {
    echo '
<div style="display: none;margin: 0 auto;width: 100%;" class="centertext newPMessageCheckOnce" id="newPMessageCheck"></div>
    <video style="position: relative;left: 50%;transform: translateX(-50%);" width="' . $width . '" height="' . $height . '" id="eh_video_player" poster="">
        <source id="ehvideo_mp4" src="" type=\'video/mp4; codecs="avc1.42E01E, mp4a.40.2"\' />
    </video>
</div>
<script>
    if ($("#newPMessageCheck").hasClass("newPMessageCheckOnce")) {
        $(document).one("mousemove", function(event){
            ehPlayVideo(\'' . $boardurl . '/' . $path . '/alert_bell.mp4\');
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/alert.mp3\');
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/message.mp3\');
            $("#newPMessageCheck").css("display", "flex");
        });
    }
    function ehPlayVideo(url) {
        var ehvideo = $("#eh_video_player");
        ehvideo[0].autoplay = true;
        ehvideo[0].src = url;
        ehvideo[0].load();
        ehvideo[0].play();
    }
    function ehPlayAudio(url) {
        const audio = new Audio(url);
        audio.play();
    }
</script>';
}
else {
    echo '
<div style="display: none;" class="newPMessageCheckOnce" id="newPMessageCheck"></div>
<script>
    function ehPlayAudio(url) {
        const audio = new Audio(url);
        audio.play();
    }
</script>';

    if ($context['user']['unread_messages'] >= 1) {
        echo '
    <script>
        $(document).one("mousemove", function(event){' . ($type == 'audio' ? '
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/whistle_alert.wav\');' : '
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/alert.mp3\');
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/message.mp3\');') . '
            $("#newPMessageCheck").attr("class", "newPMessageCheckOnce");
        });
    </script>';
    }
}
#8
General Code/Script Inquiries / Re: adapting the voice alert m...
Last post by replikacep - June 09, 2023, 01:28:58 AM
Quote from: Chen Zhen on June 08, 2023, 04:54:55 PMDoes this new message alert just play a sound or a video?

it only plays sound
#9
General Code/Script Inquiries / Re: adapting the voice alert m...
Last post by Chen Zhen - June 08, 2023, 05:53:31 PM
You can try what I've attached.
I didn't view your swf file except for extracting the mp3 audio files from it.

Download the attachment, unzip it on your PC/Mac & upload the EhMedia folder to your main forum directory path.

Put this in a PHP block:

global $boardurl, $context;
// use video, audio or audio2
list($type, $path, $width, $height) = array(
    'video',
    'EhMedia',
    '200px',
    '200px'
);

if ($type == 'video' && $context['user']['unread_messages'] >= 1) {
    echo '
<div style="display: none;margin: 0 auto;width: 100%;" class="centertext newPMessageCheckOnce" id="newPMessageCheck"></div>
    <video style="position: relative;left: 50%;transform: translateX(-50%);" width="' . $width . '" height="' . $height . '" id="eh_video_player" poster="">
        <source id="ehvideo_mp4" src="" type=\'video/mp4; codecs="avc1.42E01E, mp4a.40.2"\' />
    </video>
</div>
<script>
    if ($("#newPMessageCheck").hasClass("newPMessageCheckOnce")) {
        $(document).one("mousemove", function(event){
            ehPlayVideo(\'' . $boardurl . '/' . $path . '/alert_bell.mp4\');
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/alert.mp3\');
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/message.mp3\');
            $("#newPMessageCheck").css("display", "flex");
        });
    }
    function ehPlayVideo(url) {
        var ehvideo = $("#eh_video_player");
        ehvideo[0].autoplay = true;
        ehvideo[0].src = url;
        ehvideo[0].load();
        ehvideo[0].play();
    }
    function ehPlayAudio(url) {
        const audio = new Audio(url);
        audio.play();
    }
</script>';
}
else {
    echo '
<div style="display: none;" class="newPMessageCheckOnce" id="newPMessageCheck"></div>
<script>
    function ehPlayAudio(url) {
        const audio = new Audio(url);
        audio.play();
    }
</script>';

    if ($context['user']['unread_messages'] >= 1) {
        echo '
    <script>
        $(document).one("mousemove", function(event){' . ($type == 'audio' ? '
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/whistle_alert.wav\');' : '
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/alert.mp3\');
            ehPlayAudio(\'' . $boardurl . '/' . $path . '/message.mp3\');') . '
            $("#newPMessageCheck").attr("class", "newPMessageCheckOnce");
        });
    </script>';
    }
}

You can change the first setting from video to audio or audio2.

#10
General Code/Script Inquiries / Re: adapting the voice alert m...
Last post by Chen Zhen - June 08, 2023, 04:54:55 PM

Does this new message alert just play a sound or a video?