View Full Version : Smilies css sprite
fxdigi-cash
09-11-2014, 03:39 PM
Hi,
I'm trying to optimize my vb4 and reached now the last stages where I'm at a loss with how to use Smilies CSS Sprite
I want to know how to do that because users are going to use smilies all around the vb board.
any hint on that? is there a temple I should play with or a php file that I have to play with its code??
any idea?
Zachery
09-11-2014, 04:32 PM
That's going to be a fair lot of work. I don't know if it'd honestly be worth it.
tbworld
09-11-2014, 05:39 PM
Analyze your page and server load characteristics. If smileys are a significant increase on page size and thus page load time, then reduce the number of smileys posted per post and limit the number of overall smileys used on the board.
If the smileys are small, then they will be cached by the device, otherwise they are just another image for the device to deal with as an "http request". Limiting the number of requests is always an advantage, although modern browsers handle this much better.
Assuming simple non-animated smileys: If you just used 20 smileys then a sprite would obviously be an advantage on reducing requests and page load times, but as @Zachery kindly pointed out: it will not be easy (and more work then I wanted to undertake).
For mobile devices I convert smileys to text except for :smile:. I do not use animated smileys and have limited the smiley group to around 15-20.
tpearl5
09-11-2014, 05:44 PM
For mobile devices I convert smileys to text except for :smile:, I do not use animated smileys and limited the smiley group to around 20.
Curious what you are doing to accomplish this?
Tip: use https://kraken.io/web-interface and optimize all of your images using the lossless mode, or lossy mode if you don't mind to lose a few pixels. It can optimize your images up to 50% or even more.
Zachery
09-11-2014, 09:14 PM
Just, in my mind.
For smilies, you're often going to only have a few on a page. Having to serve the entire smilies sheet probably does more harm than good.
Plus its going to be a mega pita to deal with the editor, and the clickable interface, etc.
fxdigi-cash
09-12-2014, 01:45 AM
fair enough everyone. Thanks a lot.
ok, in this case, how about changing url of the smilies path from cookie to cookieless
which template I have to edit and how??
I found few templates related to smilies: smiliepopup , smiliepopup_smilie , smiliepopup_category
I want to add my own cookieless domain instead of the forum domain...
Zachery
09-12-2014, 03:12 AM
Do you have a cookieless domain serving images?
fxdigi-cash
09-12-2014, 03:54 AM
Do you have a cookieless domain serving images?
yes, of course. there is no point of asking if I don't have one :)
Zachery
09-12-2014, 03:32 PM
You'd be surpised how many people want to do something, but don't have it setup.
Just update the urls for the smilies.
fxdigi-cash
09-16-2014, 12:35 PM
You'd be surpised how many people want to do something, but don't have it setup.
Just update the urls for the smilies.
Hi Zachery, sorry to reply late, I got busy...
Thanks for the solution, but I've never thought I have to change the url for each smilie. what if I have 200 smilies on my board!! do I have to change the url to each one??
isn't there a better way to do that specifying a url to all smilies at once??
I'm just curious if there is a solution for any vb that has a lot of smilies!!
Thanks again :)
Zachery
09-16-2014, 12:54 PM
You could do a query to replace them in the database, but that is not my forte.
tpearl5
09-16-2014, 01:55 PM
You could do a query to replace them in the database, but that is not my forte.
You wouldn't be able to do it with a query alone since you can't do a find/replace via regex in MySQL. It would be easy if the file name were in a different field, but unfortunately you would need a script to loop through and make the URL changes to retain the file name.
You could use this to get a specific URL:
SELECT * FROM `smilie` WHERE `smiliepath` LIKE '%domain.com%'
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.