MyBB Community Forums

Full Version: Smilies Improvements - Sprite mode for smilies
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,
I think it's good if admin can use sprite images for smilies.
please see this picture:
Seems complicated for this point.

What about adding a class to all smilies? That would make it easier for administrators to implement that themselves. I dunno.
XenForo uses class for smilies and a style for Sprite smilies:
<style type="text/css">
img.mceSmilie,
img.mceSmilieSprite
{
	vertical-align: text-bottom;
	margin: 0 1px;
}

/* smilie sprite classes */

img.mceSmilieSprite.mceSmilie{$smilie_id}
{
	width: 18px; height: 18px; background: url('styles/default/xenforo/smilies/sprite.png') no-repeat 0px -100px;
}
</style>

<!-- Default Smilie -->
<img src="styles/default/xenforo/smilies/wink.png" class="mceSmilie" alt=";)">

<!-- Sprite Smilie -->
<img src="styles/default/xenforo/clear.png" class="mceSmilieSprite mceSmilie{$smilie_id}" alt=":D" >
At this point adding the full feature you are requesting is not possible. But I agree we should add a class to each smilies so that administrators can style them as they please.
(2014-07-08, 06:21 AM)Omar G. Wrote: [ -> ]At this point adding the full feature you are requesting is not possible. But I agree we should add a class to each smilies so that administrators can style them as they please.

On my forum I was playing around with it (We have sprites for about everything), and it worked out pretty swell with sprites and I made an auto generator, would you like me to look into it and give an example code?
If we allow administrators to enter a class, sprites become easy for the administrator to create themselves.
But I think it's better if We add "Sprite mode" tool for smilies.
If it's done by adding classes to the smileys, imo it shouldn't use the <img /> tag. Some browsers will load both the src"" in the image tag AND the background-image set with CSS so it's counter intuitive in those cases. Using "clear.png" is still an http request, albeit a tiny one. It'd be great if there were some way around that (Just use <a> for all smilies regardless of if it's a single smiley or sprite?).

I do agree though, adding a class would be better so sprites could be used, regardless of if it's just on the current <img> tags or not.
https://github.com/Zalvie/mybb_Sprited-S...milies.php

The plugin I made a while ago, If anyone needs it
Is there it for 1.8? thanks
Pages: 1 2