XF 1.1 The Happy Place v3 - Smilies not showing up

Luxus

Well-known member
I have installed v3 of The Happy Place, an add-on from inph and Kier. However smilies are not showing up as you can see below:



Does this add-on not work properly with XF 1.1.2?
 

Shelley

Well-known member
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
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
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.
 

ArnyVee

Well-known member
I've actually started to play with that. Weird code... All I'll say..... (But I am looking at it)
Cool .... hopefully you can get it working properly because it is certainly necessary :)

Anything that can help organize smilies would be awesome :D
 

latimer

Active member
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
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)
 
Top