• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.1 The Happy Place v3 - Smilies not showing up

Shelley

Well-known member
#2
If your using a spritesheet that will be the reason they aren't showing. It's a known issue, you'll have to revert back to using individual images (smilies) if your wanting the smilies to display pending this is the case, that your using a spritesheet.
 

Adam Howard

Well-known member
#3
If your using a spritesheet that will be the reason they aren't showing. It's a known issue, you'll have to revert back to using individual images (smilies) if your wanting the smilies to display pending this is the case, that your using a spritesheet.
I've actually started to play with that. Weird code... All I'll say..... (But I am looking at it)
 

Luxus

Well-known member
#4
If your using a spritesheet that will be the reason they aren't showing. It's a known issue, you'll have to revert back to using individual images (smilies) if your wanting the smilies to display pending this is the case, that your using a spritesheet.
Thank you, that is indeed the cause.
 

latimer

Active member
#6
Not exactly the most graceful fix, but this should allow you to use both individual images and sprites with the add-on.

In the "happy_place" template find:
Code:
var smilieFile  = DOM.encode(smilie[1]),
smilieTitle = DOM.encode(smilie[0]),
smilieCode  = DOM.encode(smilieName),
smilieLink  = '<img src="' + smilieFile + '" title="' + smilieTitle + '" alt="' + smilieCode + '" class="smilie" />';
Add beneath:
Code:
if (!isNaN(parseFloat(smilieFile)) && isFinite(smilieFile))
{
var smilieLink  = '<img src="styles/default/xenforo/clear.png" title="' + smilieTitle + '" alt="' + smilieCode + '" class="mceSmilieSprite mceSmilie' + smilieFile + '" />';
}
Find:
Code:
window.tinyMCE.editors['{$editorId}_html'].execCommand('mceInsertContent',false, '<img src="' + $(this).children().attr("src") + '" alt="' + $(this).children().attr("alt") + '"class="smilie" data-smilie="yes" />' );
Replace with:
Code:
window.tinyMCE.editors['{$editorId}_html'].execCommand('mceInsertContent',false, '<img src="' + $(this).children().attr("src") + '" alt="' + $(this).children().attr("alt") + '"class="' + $(this).children().attr("class") + '" data-smilie="yes" />' );
I couldn't find a variable that indicates whether or not a smilie is a sprite in xenforo_smilies, so what it does is check if the smilie file is numeric and renders it as a sprite if it is.
 

Shelley

Well-known member
#7
Not exactly the most graceful fix, but this should allow you to use both individual images and sprites with the add-on.

</snip>

I couldn't find a variable that indicates whether or not a smilie is a sprite in xenforo_smilies, so what it does is check if the smilie file is numeric and renders it as a sprite if it is.
I think any fix is welcomed but I've chopped and changed between sprites and individual images so many times due to it breaking I'll just stick with using individual smiley images. Appreciate the fix which I'm sure users will to. (y)