Advertisement:
NameCheap

Author Topic: GIF icons in standard Curve theme  (Read 3755 times)

Offline Malamut

  • Semi-Newbie
  • *
  • Posts: 24
GIF icons in standard Curve theme
« on: January 07, 2012, 03:37:27 AM »
I think it's a time to completely remove all GIF icons from standard SMF theme. Icons and smilies in Curve theme now look so old and so poorly, that absolutely spoil the impression of the theme. And it's because SMF use obsolete image format, which doesn't support alpha-channel. IE6 now is entirely die (<1%), so there is no reason not to use PNG for all images.

Benefits of using PNG by default:

- Smallest size.
- An ability to create acceptable-looking icons.
- Alpha-channel! (it's absolutely necessary in modern web).
- Most important for me: theme authors no longer have to rewrite virtually all of the standard templates only to replace GIF with PNG.

Because of features of GIF, forum theme can't look good with GIF icons. It's very easy to replace .gif in source files to .png and to convert all images. It'll be breake a lot of themes with custom templates and a lot of mods, but you must do it sooner or later. So I think that it'll be good to do it sooner. E.g in 2.1 version.

Offline Malamut

  • Semi-Newbie
  • *
  • Posts: 24
Re: GIF icons in standard Curve theme
« Reply #1 on: January 07, 2012, 03:44:23 AM »
P.S. The easest way not to break backwards compatibility with most of themes and mods is to add new setting to theme: which type of icons to use - GIF or PNG.

P.P.S. Or, it's the best solution I think, you can add and ability to select icon pack for forum. It can be very usefull.
« Last Edit: January 07, 2012, 03:53:55 AM by Malamut »

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,986
  • Master of BBC Abuse
Re: GIF icons in standard Curve theme
« Reply #2 on: January 07, 2012, 05:09:18 AM »
So I think that it'll be good to do it sooner. E.g in 2.1 version.

You are a bit behind the times. We're way ahead of you. ;)

http://dev.simplemachines.org/mantis/view.php?id=4714
Mods - Manky Old Themes - Apocalypse theme (WIP)

Quote
(11:43:45 AM) Antechinus: of course, it's also possible that I'm an arrogant know it all bastard
(11:43:59 AM) Eliana Tamerin: you are :P
(11:44:21 AM) Antechinus: hmmph

Offline Malamut

  • Semi-Newbie
  • *
  • Posts: 24
Re: GIF icons in standard Curve theme
« Reply #3 on: January 07, 2012, 08:35:46 AM »
Cool! I'm really waiting 2.1, PNG icons will be the most important thing for me!

Offline IchBin™

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,110
  • Gender: Male
  • I don't speak German.
    • IchBin.us
Re: GIF icons in standard Curve theme
« Reply #4 on: January 07, 2012, 06:13:11 PM »
Cool! I'm really waiting 2.1, PNG icons will be the most important thing for me!

Why is that so important for you? Just curious...
Brad "IchBin™" Grow        TinyPortal        Themes
Coding Guidelines       

Offline Malamut

  • Semi-Newbie
  • *
  • Posts: 24
Re: GIF icons in standard Curve theme
« Reply #5 on: January 10, 2012, 02:12:11 AM »
Why is that so important for you? Just curious...
Very simple: SMF 2 has all major functions, except good theme customization. I've set up functionality of my forum, but now I can't change some parts of it appearance in a acceptable way. E.g. I can't change icons without rewriting all theme files.

Offline IchBin™

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,110
  • Gender: Male
  • I don't speak German.
    • IchBin.us
Re: GIF icons in standard Curve theme
« Reply #6 on: January 10, 2012, 11:36:13 AM »
Well that doesn't make much sense to me, but I'll take your word for it! :)
Brad "IchBin™" Grow        TinyPortal        Themes
Coding Guidelines       

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,986
  • Master of BBC Abuse
Re: GIF icons in standard Curve theme
« Reply #7 on: January 10, 2012, 10:42:41 PM »
I know what he means. The standard gif icons are way out of date for image quality on a variety of backgrounds. We did think of changing them all to png for 2.0, but had too much to do anyway. Having them all png would be a great bonus for custom theming, but at the moment requires digging into a lot of files to rewrite the image calls from gif to png. So yes, I can understand why he regards this as important. Themers would totally love all the icons to be png by default.
Mods - Manky Old Themes - Apocalypse theme (WIP)

Quote
(11:43:45 AM) Antechinus: of course, it's also possible that I'm an arrogant know it all bastard
(11:43:59 AM) Eliana Tamerin: you are :P
(11:44:21 AM) Antechinus: hmmph

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,161
  • Gender: Male
  • THERE'S JUST ME
Re: GIF icons in standard Curve theme
« Reply #8 on: January 11, 2012, 05:16:55 AM »
Add this function at the end of QueryString.php:
Code: [Select]
function gif_replace_integrate($buffer)
{
global $settings;

return preg_replace('~' . $settings['images_url'] . '^(?:(?!bbc).)*\.gif~', $settings['images_url'] . '$1.png', $buffer);
}

and just before (same file):
Code: [Select]
// Return the changed buffer.add this:
Code: [Select]
$buffer = gif_replace_integrate($buffer);Is designed to work with hook, so you can add it to integrate_buffer and it will work the same.

Hopefully this should change most of the gif with png for all the themes (bbc icons (those in the editor) are excluded, maybe few that should not be changed are changed as well...don't know).


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Malamut

  • Semi-Newbie
  • *
  • Posts: 24
Re: GIF icons in standard Curve theme
« Reply #9 on: January 11, 2012, 05:24:19 AM »
emanuele,
Many thanks! I will necessarily try this way in the near future!

Offline Malamut

  • Semi-Newbie
  • *
  • Posts: 24
Re: GIF icons in standard Curve theme
« Reply #10 on: January 23, 2012, 02:21:28 AM »
Some comments:

replace string should be like this:

Code: [Select]
return preg_replace('~"' . $settings['images_url'] . '/(?!loading|bbc/)([^"]+?)\.gif"~', '"' . $settings['images_url'] . '/$1.png"', $buffer);