Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Ritsu on September 14, 2021, 05:22:48 PM

Title: Country flag field 2.1
Post by: Ritsu on September 14, 2021, 05:22:48 PM
Hi there, basically I want to create a field where one can select its country (name) and the flag would appear on one's profile and post.

Basically the Country Flags mod but for 2.1 but since there's none, all I did was come up with what I did on the attachment lol

I don't want to annoy someone with a perfect answer but where should I be looking at to create such field?
Title: Re: Country flag field 2.1
Post by: Steve on September 14, 2021, 08:21:36 PM
Are you on 2.1 or 2.0.x?

Wouldn't this mod accomplish what you want? https://custom.simplemachines.org/index.php?mod=417
Title: Re: Country flag field 2.1
Post by: Shades. on September 14, 2021, 08:35:09 PM
Quote from: Steve on September 14, 2021, 08:21:36 PMAre you on 2.1 or 2.0.x?

Wouldn't this mod accomplish what you want? https://custom.simplemachines.org/index.php?mod=417

Ehh?

Quote from: Ritsu on September 14, 2021, 05:22:48 PMBasically the Country Flags mod but for 2.1 but since there's none, all I did was come up with what I did on the attachment lol

I don't want to annoy someone with a perfect answer but where should I be looking at to create such field?

I'd say he's on 2.1 but wants the mod updated! ;)  :P
Title: Re: Country flag field 2.1
Post by: Steve on September 14, 2021, 08:38:33 PM
I'm thinking so too but wanted to make sure before I moved this to the correct support board. :)
Title: Re: Country flag field 2.1
Post by: Speed King on September 14, 2021, 10:42:28 PM
I made custom profile field on my forum, with this code:

<img src="https://bg-nacionalisti.org/BNF/images/{INPUT}.png" alt="{INPUT}" /> {INPUT}
Set field type to 'Select box', you need to add image flag files for all countries you want; these images must have same names as related countries (and without accented characters).
Be sure that URL to image files is typed correctly in the code.
Title: Re: Country flag field 2.1
Post by: Steve on September 15, 2021, 08:56:20 AM
Moving to 2.1 support.
Title: Re: Country flag field 2.1
Post by: Kindred on September 15, 2021, 11:19:55 AM
basically, most custom field stuff can be duplicated in 2.1 without a mod - by using the custom profile fields, as speed king has noted.
Title: Re: Country flag field 2.1
Post by: Arantor on September 15, 2021, 11:37:06 AM
The only downside is porting over old fields to new ones but that's often not *that* hard to do with a very careful INSERT INTO ... SELECT FROM query.
Title: Re: Country flag field 2.1
Post by: Shades. on September 15, 2021, 05:53:45 PM
Quote from: Speed King on September 14, 2021, 10:42:28 PMI made custom profile field on my forum, with this code:

<img src="https://bg-nacionalisti.org/BNF/images/{INPUT}.png" alt="{INPUT}" /> {INPUT}
Set field type to 'Select box', you need to add image flag files for all countries you want; these images must have same names as related countries (and without accented characters).
Be sure that URL to image files is typed correctly in the code.
Phew! That was a lot of countries to add but thanks for that! ;)  8)