Mecha CMS

Add extra functionality to the core engine.

Emoticon

Emoticon using icon fonts.

Download Version 2.3.1 Download Development Version

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

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 an :β€Œ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 be ignored.

You might also like: