FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Need help with Optional manual choice of country in register script (So you can use country flags without using geolocation)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Need help with Optional manual choice of country in register script [message #166114] Sun, 18 September 2011 19:19
ShineOn is currently offline  ShineOn   United States
Messages: 53
Registered: July 2011
Karma: 1
Member
I want to set country in the user profile (and allow the user to set country as well) to have the country flag populate even though geolocation is turned off. The thing is - I have users who originate from and identify with specific countries but do not live in their country of origin, or travel a lot and post from multiple countries, or even for security purposes will post using an anonymizer whose IP is in a different country, and I don't want to confuse people (or worse, tick them off or make it so they feel they can't post) because their posts don't show the correct chosen flag for their nationality, and I do not want to have to manually tweak the flag fields in the user table.

My thought is to use one of the free geoIP csv's to populate the geoip table, and use a select distinct on just country and cc, then use that as a) lookup table for a select box for the country name and b) setting for the flag fields in the user table.

When the country is selected in the form, the corresponding flag icon should automatically appear next to it, and all posts by that user should show that flag.

I'd like this as an option that only shows up if the geoip is disabled or the user is an admin (so we can set peoples' flags for them if we feel the need, even if geoip is on.)

What all do I have to change, in FUDforum 3.0.3, to accomplish this change? I'm expecting there will be an "else" in the flag function in register.php that sets the flag_country and flag_cc based on the country chosen instead of on the geolocation process, and a change to the template for the register form, but am still a bit shaky on the binary option codes and the user option field and how they relate to what goes on in the register form, so any pointers you can give would be great.

After this is working, my next thought is to create an admin report based on the geoip lookup that shows the users who claim to be from a different country than their IP says they're posting from, to catch trolls. That should be an easy add-on that wouldn't require modifying base code.

Any help anyone can provide letting me know all of the files I have to consider changing to make this work would be much appreciated. I am examining the developer docs on the wiki, but am unsure what kind of cascading effect this change might cause.

<edit> Wow, lots of views, but nobody posting any help... </edit>


[Updated on: Tue, 04 October 2011 19:12]

Report message to a moderator

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Hardware Token Authentication
Next Topic: IE6 update plugin
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Dec 11 23:28:30 GMT 2024

Total time taken to generate the page: 0.02438 seconds