The Precious Metal Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Go down
Admin
Admin
Admin
Posts : 3779
Join date : 2021-05-08
Location : England UK
https://www.thepreciousmetalforum.com

Chat facility is being worked on.  Empty Chat facility is being worked on.

Tue Dec 17, 2024 10:38 am
I know that it has been a while, and I am in the mist of coding and sorting out things in the background.

I might not ever look busy.... probably because I am not.. LOL but really I am doing things.. Promise.

I am looking to put potentially ChatGPD onto the forum.

What and why will this help? firstly it will give you a notification of when someone has posted. It will allow members to interact like a lot of other main stream social media accounts. But it will be just as easy to use.

concerns .. I have MANY. but I am looking into all of them that I am aware of right now.

you can see that I am looking.. here are some codes. LOL


document.getElementById('alarm').addEventListener('click', () => {
const audio = document.getElementById('sound');
if (audio) {
audio.play().catch((e) => {
console.warn('Audio playback blocked:', e);
});
}
});

$('#sound').get(0).play().catch((error) => {
console.error('Playback failed:', error);
});



:Select Content
function _DeskSoundNotify() {
$.ajax({
url: '/notification.forum',
dataType: 'json',
success: function(data, txt, xhr) {
if (alarm) {
if (data.unread > prevunread) {
if (prevunread >= 0) {
const soundElement = $('#sound').get(0);
if (soundElement) {
soundElement.play().catch((error) => {
console.error('Audio playback failed:', error);
});
}
}
prevunread = data.unread;
}
}
}
}).always(function() {
setTimeout(_DeskSoundNotify, update_timer);
});


function _DeskSoundNotify() {
$.ajax({
url: '/notification.forum',
dataType: 'json',
success: function(data, txt, xhr) {
if (alarm) {
if (data.unread > prevunread) {
if (prevunread >= 0) {
const soundElement = $('#sound').get(0);
if (soundElement) {
soundElement.play().catch((error) => {
console.error('Audio playback failed:', error);
});
}
}
prevunread = data.unread;
}
}
}
}).always(function() {
setTimeout(_DeskSoundNotify, update_timer);
});
}






Just to give you a idea of what I am doing and what is happening... it is not as easy as the current chat that I set up... But it is much more detailed... the users wont have a issue... but omg... putting all this onto the board which will act like the normal chat is a pain.

So please bear with me .. I promise I am still working hard to get this done


Admin
Admin
Admin
Posts : 3779
Join date : 2021-05-08
Location : England UK
https://www.thepreciousmetalforum.com

Chat facility is being worked on.  Empty Re: Chat facility is being worked on.

Tue Dec 17, 2024 10:39 am
alarm_color_on = "white";
alarm_color_off = "#806060";
alarm_title_on = "Turn off sound notifications";
alarm_title_off = "Enable sound notifications";
update_timer = 1000;

function GetAlarm() {
var al = localStorage.getItem('alarm');
return al === "1";
};

alarm = false;

function SetAlarm(al) {
localStorage.setItem('alarm', al ? "1" : "0");
if (GetAlarm()) {
$('#alarm').text('notifications');
$('#alarm').css('color', alarm_color_on);
$('#alarm').attr('title', alarm_title_on);
DeskInstallNotify();
} else {
$('#alarm').text('notifications_off');
$('#alarm').css('color', alarm_color_off);
$('#alarm').attr('title', alarm_title_off);
}
alarm = al;
};

function SwitchAlarm() {
SetAlarm(!GetAlarm());
};

prevunread = -1;
_DeskSoundNotify = function() {
$.ajax({
url: '/notification.forum',
dataType: 'json',
success: function(data, txt, xhr) {
if (alarm) {
if (data.unread > prevunread) {
if (prevunread >= 0)
$('#sound').get(0).play();
prevunread = data.unread
}
}
}
}).always(function() {
setTimeout(_DeskSoundNotify, update_timer)
});
};

function DeskInstallNotify() {
setTimeout(_DeskSoundNotify, update_timer * 2);
};


$(function() {
$(function() {
if ($('#mNotificationBtn').length == 0 && _userdata["session_logged_in"] > 0) {
alarm = GetAlarm();
$('<span id="notify_alarm" onclick="SwitchAlarm();" style="font-size: 20px; cursor: pointer;" ><i title="' + (alarm ? alarm_title_on : alarm_title_off) + '"class="material-icons" style="font-size: 18px; position: relative; top: 5px; color:' + (alarm ? alarm_color_on : alarm_color_off) + '" id="alarm">' + (alarm ? 'notifications' : 'notifications_off') + '</i></span>') .insertBefore($('#fa_hide'));
if (alarm) DeskInstallNotify();
};
});
});
The Cat's Mother
The Cat's Mother
Moderator
Posts : 3717
Join date : 2021-05-19
Location : UK

Chat facility is being worked on.  Empty Re: Chat facility is being worked on.

Tue Dec 17, 2024 11:11 am
Maybe a few more members will use it.
I do like the concept of 'the mist of coding'. It's all very foggy to me too. Chat facility is being worked on.  1f638

Admin likes this post

Admin
Admin
Admin
Posts : 3779
Join date : 2021-05-08
Location : England UK
https://www.thepreciousmetalforum.com

Chat facility is being worked on.  Empty Re: Chat facility is being worked on.

Thu Dec 19, 2024 2:10 pm
The Cat's Mother wrote:Maybe a few more members will use it.
I do like the concept of 'the mist of coding'. It's all very foggy to me too.  Chat facility is being worked on.  1f638


Well someone mentioned it ages ago about not being alerted when chat is up and when people post.. Not everyone will stick around all day and monitor their computer.

So it might be a nice feature.
But then I realised as I am typing this.... you are going to be excluded. Lack of Tech.
The Cat's Mother
The Cat's Mother
Moderator
Posts : 3717
Join date : 2021-05-19
Location : UK

Chat facility is being worked on.  Empty Re: Chat facility is being worked on.

Thu Dec 19, 2024 4:11 pm
Admin wrote:
The Cat's Mother wrote:Maybe a few more members will use it.
I do like the concept of 'the mist of coding'. It's all very foggy to me too.  Chat facility is being worked on.  1f638


Well someone mentioned it ages ago about not being alerted when chat is up and when people post.. Not everyone will stick around all day and monitor their computer.

So it might be a nice feature.
But then I realised as I am typing this.... you are going to be excluded.    Lack of Tech.

It's ok, I'm one of the sad people who sit around all day monitoring my computer. Nobody cares though  Chat facility is being worked on.  1f63f

Admin likes this post

Admin
Admin
Admin
Posts : 3779
Join date : 2021-05-08
Location : England UK
https://www.thepreciousmetalforum.com

Chat facility is being worked on.  Empty Re: Chat facility is being worked on.

Fri Dec 20, 2024 11:31 am
The Cat's Mother wrote:
Admin wrote:
The Cat's Mother wrote:Maybe a few more members will use it.
I do like the concept of 'the mist of coding'. It's all very foggy to me too.  Chat facility is being worked on.  1f638


Well someone mentioned it ages ago about not being alerted when chat is up and when people post.. Not everyone will stick around all day and monitor their computer.

So it might be a nice feature.
But then I realised as I am typing this.... you are going to be excluded.    Lack of Tech.

It's ok, I'm one of the sad people who sit around all day monitoring my computer. Nobody cares though  Chat facility is being worked on.  1f63f

lol! lol! lol! lol! lol! lol! lol! Sad, no, and we all care about you TCM.

The Cat's Mother likes this post

The Cat's Mother
The Cat's Mother
Moderator
Posts : 3717
Join date : 2021-05-19
Location : UK

Chat facility is being worked on.  Empty Re: Chat facility is being worked on.

Fri Dec 20, 2024 12:03 pm
Bless you dear. You'll go on Santa's Good List for that.
santa santa santa

Admin and AceBullion like this post

Back to top
Permissions in this forum:
You cannot reply to topics in this forum