Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: Aaron10 - elokuu 13, 2014, 10:24:37 IP

Otsikko: Replace ' ' with '%20' in avatar URL
Kirjoitti: Aaron10 - elokuu 13, 2014, 10:24:37 IP
I have preset avatar galleries with spaces in them and in when viewing topics etc. the URL to the images aren't automatically putting a %20 in the URL making the page invalid. How would I make it so %20 is automatically replacing ' ' in avatar URLs?
Otsikko: Re: Replace ' ' with '%20' in avatar URL
Kirjoitti: Kindred - elokuu 13, 2014, 10:28:33 IP
You should never ever ever use spaces in file names or urls for the web.  The %20 is a workaround, but should never be needed if the site is designed correctly.
Otsikko: Re: Replace ' ' with '%20' in avatar URL
Kirjoitti: Hj Ahmad Rasyid Hj Ismail - elokuu 13, 2014, 10:39:25 IP
There are a lot of guides using css for avatar which you can simply learn and use. With regards to additional space, if so needed, the using of :: before and ::after can be applied via css as well.

Edited: Sorry I get it wrongly. I must be day dreaming again... :)
Otsikko: Re: Replace ' ' with '%20' in avatar URL
Kirjoitti: Kindred - elokuu 14, 2014, 08:16:40 AP
Aharis...    WHAT?? ??? 

Otsikko: Re: Replace ' ' with '%20' in avatar URL
Kirjoitti: Aaron10 - elokuu 14, 2014, 12:42:27 IP
Yeah I just renamed the directories and everyones updated.

Just wonder though if it's an external URL and is out of my control, will the %20 be added if I have it set to download external avatars?
Otsikko: Re: Replace ' ' with '%20' in avatar URL
Kirjoitti: Arantor - elokuu 14, 2014, 12:56:11 IP
Fairly sure it should handle that correctly. I seem to recall this was even tweaked in recent versions somewhere to make sure this was correctly handled.

In any case, if it gets downloaded the filename will be ignored and SMF will use its own.
Otsikko: Re: Replace ' ' with '%20' in avatar URL
Kirjoitti: Aaron10 - elokuu 14, 2014, 01:36:41 IP
Good stuff.

Marked as Solved.