This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

How to change and add smilies?
#1

I searched but only found one post about changing smiles but it seems to be an outdated version....

what file(s) am I looking for in the 4 version?
Reply
#2

It's not currently possible to add new ones, at least not without hacking the code. But if there are any you don't want then you could modify them to different ones.

The wording for the smilies are here:
/frontend/view/default/language/english/main/form.php

So for example if you didn't want the 'shocked' one you would edit these two lines:

$_['lang_title_smiley_shocked']
$_['lang_tag_smiley_shocked']

Then change the file here:
/frontend/view/default/image/smilies/shocked.png

Have you completed the interview?
Reply
#3

thank you for your help...
that at least gives me a starting point into how to add more

I figured out how to change them
add your smilies into this folder
frontend/view/default/image/smilies

and then in
backend/model/layout_form/smilies.php
(or whatever you renamed your backend folder to)

find


Code:
    public function getSmilies()
    {
        $smilies = array();

        $smilies['smile'] = $this->getImage('smile.png');

        $smilies['sad'] = $this->getImage('sad.png');

        $smilies['huh'] = $this->getImage('huh.png');

        $smilies['laugh'] = $this->getImage('laugh.png');

        $smilies['mad'] = $this->getImage('mad.png');

        $smilies['tongue'] = $this->getImage('tongue.png');

        $smilies['cry'] = $this->getImage('cry.png');

        $smilies['grin'] = $this->getImage('grin.png');

        $smilies['wink'] = $this->getImage('wink.png');

        $smilies['scared'] = $this->getImage('scared.png');

        $smilies['cool'] = $this->getImage('cool.png');

        $smilies['sleep'] = $this->getImage('sleep.png');

        $smilies['blush'] = $this->getImage('blush.png');

        $smilies['confused'] = $this->getImage('confused.png');

        $smilies['shocked'] = $this->getImage('shocked.png');

        return $smilies;
    }

replace the smilies .png's with whatever the ones you want to use
for example I changed
Code:
$smilies['smile'] = $this->getImage('smile.png');

to


Code:
$smilies['smile'] = $this->getImage('happy.gif');

now I just need to figure out where the sprite sheet is called at so I can fix all of that
Reply
#4

to fix the sprites

frontend/view/default/image/smilies
replace sprite.png with your own sprite sheet

frontend/view/default/stylesheet/css/stylesheet.min.css
find
Code:
.cmtx_smiley
{background-image:url("../../image/smilies/sprite.png");background-repeat:no-repeat;display:inline-block;height:20px;vertical-align:middle;width:20px}

.cmtx_smiley:not(:first-child)
{margin-left:15px}

.cmtx_smiley_blush
{background-position:-5px -5px}

.cmtx_smiley_cool
{background-position:-63px -5px}

.cmtx_smiley_cry
{background-position:-93px -5px}

.cmtx_smiley_grin
{background-position:-5px -35px}

.cmtx_smiley_huh
{background-position:-35px -35px}

.cmtx_smiley_laugh
{background-position:-65px -35px}

.cmtx_smiley_mad
{background-position:-5px -65px}

.cmtx_smiley_sad
{background-position:-35px -65px}

.cmtx_smiley_scared
{background-position:-65px -65px}

.cmtx_smiley_shocked
{background-position:-121px -5px}

.cmtx_smiley_sleep
{background-position:-95px -35px}

.cmtx_smiley_smile
{background-position:-95px -65px}

.cmtx_smiley_tongue
{background-position:-5px -95px}

.cmtx_smiley_confused
{background-position:-35px -5px}

.cmtx_smiley_wink
{background-position:-35px -95px}


and replace with your own sprite sheet
make sure to keep the .cmtx_smiley_NAME correct, just change the parts in the {}

to get a sprite sheet you can use

http://draeton.github.io/stitches/
Reply
#5

Nice work. Sorry I forgot it uses a sprite on the frontend. It displays the images individually in the admin area.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Renaud
26-Aug-2014, 07:28 AM
Last Post by Ming
25-Jan-2012, 05:00 PM
Last Post by james
28-Jul-2010, 05:01 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)