Swaping GIF topic icons for SVGs

For support and discussion related to templates and themes in phpBB 3.3.
Post Reply
Zinnn
Registered User
Posts: 38
Joined: Sun Apr 21, 2019 8:14 am

Swaping GIF topic icons for SVGs

Post by Zinnn »

I want to replace my topic icons, which look very dated, with more modern and minimalist SVG files. What do I have to edit to change iconname.gif -> iconname.svg ?

Edit. by topic icons I mean those lil ones that users can choose when writing a new topic:
Image
Image
Image
Last edited by Zinnn on Mon Jul 20, 2020 5:03 pm, edited 1 time in total.
User avatar
mrgtb
Registered User
Posts: 603
Joined: Wed Oct 03, 2007 10:51 am

Re: Swaping GIF topic icons for SVGs

Post by mrgtb »

I'm offering some PNG forum post icons as replacements if your interested, click my signature link to take a look at some listed.

You can also read the guide here how to change them - https://gtbforum.com/viewtopic.php?f=64&t=7189
Zinnn
Registered User
Posts: 38
Joined: Sun Apr 21, 2019 8:14 am

Re: Swaping GIF topic icons for SVGs

Post by Zinnn »

mrgtb wrote:
Mon Jul 20, 2020 4:58 pm
I'm offering some PNG forum post icons as replacements if your interested, click my signature link to take a look at some listed.

You can also read the guide here how to change them - https://gtbforum.com/viewtopic.php?f=64&t=7189
no, but thanks. I def want to use SVGs, not PNGs
User avatar
mrgtb
Registered User
Posts: 603
Joined: Wed Oct 03, 2007 10:51 am

Re: Swaping GIF topic icons for SVGs

Post by mrgtb »

Zinnn wrote:
Mon Jul 20, 2020 4:52 pm
I want to replace my topic icons, which look very dated, with more modern and minimalist SVG files. What do I have to edit to change iconname.gif -> iconname.svg ?

Edit. by topic icons I mean those lil ones that users can choose when writing a new thread:
Image
Image
Image
Right, I see you meant topic icons. Generally you just upload your own to the images/icons/ then misc/smile folders and add them from the admin cp (same way you add smilies). But not sure if you can do that with SVG or not uploaded?
User avatar
Mick
Support Team Member
Support Team Member
Posts: 22639
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket probably.

Re: Swaping GIF topic icons for SVGs

Post by Mick »

I think the OP needs to read up on the differences between gif, jpg, png and svg, they are not the same and have different characteristics.
"The more connected we get the more alone we become" - Kyle Broflovski©
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 3928
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Swaping GIF topic icons for SVGs

Post by thecoalman »

mrgtb wrote:
Mon Jul 20, 2020 5:23 pm
But not sure if you can do that with SVG or not uploaded?
Just checked this, phpBB doesn't recognize .svg files for topic icons. Don't know if there is easy edit to add support.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
Hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 1011
Joined: Wed Dec 30, 2009 8:14 am
Name: Michael Miday
Contact:

Re: Swaping GIF topic icons for SVGs

Post by Hanakin »

currently they are not supported by the core. We plan to fix update this in 4.0. however currently you are stuck with png as the best option. We currently use retina pngs for these which is just a svg saved as a png 2x the required dimensions.
User avatar
PlanetStyles.net
Former Team Member
Posts: 4590
Joined: Wed Nov 04, 2009 11:16 pm
Location: UK
Name: Christian
Contact:

Re: Swaping GIF topic icons for SVGs

Post by PlanetStyles.net »

A hacky way to achieve this in 3.3 would be to use JS to change the file format of the topic icon source.

That is to say:

1. Upload your new topic icons as gifs, pngs or whatever
2. Also upload .svg versions in the same location and with the same file name
3. JS will target the 13 locations where topic icons display and change the file source image from whatever you chose in step 1 to .svg
4. Voila

The obvious downsides here are:

1. You need to upload and maintain 2 different versions for each icon (one to get it recognised by the ACP, the other is the .svg version that you actually want people to see)
2. There'll possibly (probably) be a noticeable visual change as the script runs and the icon changes from .gif / .png / .whatever to .svg

The best option all around is to use the method currently adopted in the core, which is (as Hanakin said), to use higher-res images which are scaled down.

But, it's definitely technically possible to use .svg. If you really want the JS code, let me know and I'll see what I can knock together.
🚀 Premium phpBB StylesPremium phpBB 3.3 StylesphpBB sidebar Extension
Previously known as Christian 2.0
Post Reply

Return to “[3.3.x] Styles Support & Discussion”