Mecha CMS

Add extra functionality to the core engine.

Emoticon

Emoticon using icon fonts.

Download Stable Version Download Development Version

Something looks broken? We accept bounties to fix them faster.

^81 Downloads
v2.3.212 Downloads
v2.3.150 Downloads
v1.2.2366 Downloads
Emoticon

This extension replaces every emoticon and smiley patterns (which you can also set it yourself) into a graphical emoticon icons. Icon font credit to Icomoon.

Open .\lot\x\emoticon\state.php file to configure:

return [
    'type' => 1, // Can be `0` or `1`
    // Determine character(s) to be recognized as emoticon(s)
    // Order does matter!
    'alter' => [
        'angry' => '>:( >:( ๐Ÿ˜ ', // Must come before `:(`
        'baffle' => 'o_o O_o o_O ๐Ÿ˜ฏ',
        'confuse' => ':s :S ๐Ÿ˜•',
        'cool' => 'B) ๐Ÿ˜Ž',
        'cry' => ':\'( T_T ๐Ÿ˜ข ๐Ÿ˜ญ',
        'evil' => '>:) >:) ๐Ÿ˜ˆ', // Must come before `:)`
        'frustrate' => '>:O >:O ๐Ÿ˜ซ',
        'grin' => ':)) ๐Ÿ˜', // Must come before `:)`
        'happy' => ':D =D ๐Ÿ˜ƒ',
        'hipster' => ':3',
        'neutral' => ':| ๐Ÿ˜',
        'sad' => ':( ๐Ÿ˜ž ๐Ÿ™ โ˜น',
        'sleepy' => ':OzZ ๐Ÿ˜ช', // Must come before `:O`
        'shock' => ':O ๐Ÿ˜ฒ ๐Ÿ˜จ',
        'smile' => ':) ๐Ÿ˜Š โ˜บ',
        'tongue' => ':p :P ๐Ÿ˜‹ ๐Ÿ˜› ๐Ÿ˜œ ๐Ÿ˜',
        'wink' => ';) ๐Ÿ˜‰',
        'wonder' => ':\ :/ ๐Ÿค”'
    ]
];

Any pattern defined in the array value, plus a :key: syntax, will be replaced with <span class="emoticon:key"></span> element. Any pattern found in the HTML opening tag (as a tag name, attribute name or value) will be ignored. Any pattern found in the HTML contents of <code>, <kbd>, <pre>, <script>, <style> and <textarea> will also be ignored.

You might also like: