How to Add Custom Smilies In MCHAT

Support area for phpBB's mChat extension
Post Reply
User avatar
Mr_LonEly
Posts: 15
Joined: 09 Mar 2017, 05:02

How to Add Custom Smilies In MCHAT

#1

Post by Mr_LonEly » 29 Aug 2018, 10:58

Hi Kasimi Hope you will be fine

How I can add custom smilies in Mchat ?


:wave:

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

Re: How to Add Custom Smilies In MCHAT

#2

Post by kasimi » 29 Aug 2018, 11:39

Hi,

there is no way to upload smilies only for mChat. mChat always displays the same smilies that you have available when composing forum posts. You can upload new smilies the usual way, in the ACP, tab Posting, Smilies.

EVO_VV
Posts: 40
Joined: 23 Jun 2017, 16:03

Re: How to Add Custom Smilies In MCHAT

#3

Post by EVO_VV » 29 Aug 2018, 13:57

I had a similar request from the forum owner who wanted different Smilies (smaller ones) only for the chat.

The only way I solved it was to 'hack' the core code.

In functions_posting function generate_smilies($mode, $forum_id)

I edited like this :-

Code: Select all

if ($forum_id === 0) 
{
		$sql = 'SELECT COUNT(smiley_id) AS item_count
			FROM ' . SMILIES_TABLE . ' WHERE code LIKE "%mchat%"
			GROUP BY smiley_url';
		$result = $db->sql_query($sql, 3600);
}
else
{
		$sql = 'SELECT COUNT(smiley_id) AS item_count
			FROM ' . SMILIES_TABLE . ' WHERE code NOT LIKE "%mchat%"
			GROUP BY smiley_url';
		$result = $db->sql_query($sql, 3600);
}
The if ($forum_id === 0) works for having Mchat on the Index page even though forum ID 0 can be the ACP etc as well but the chat does not appear there.

The smilies are added to phpBB in the normal fashion BUT the ones that will appear for Mchat have the 'code' prefixed with 'mchat'.

I think that was all I did as at the moment I cannot find any other edits for it.
Works fine for me but I will have to remember to re-apply the edits when upgrading.

User avatar
Mr_LonEly
Posts: 15
Joined: 09 Mar 2017, 05:02

Re: How to Add Custom Smilies In MCHAT

#4

Post by Mr_LonEly » 30 Aug 2018, 04:59

kasimi wrote:
29 Aug 2018, 11:39
Hi,

there is no way to upload smilies only for mChat. mChat always displays the same smilies that you have available when composing forum posts. You can upload new smilies the usual way, in the ACP, tab Posting, Smilies.
ok thanks Dear

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest