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

Home » FUDforum » How To » Open Forum To One Country Only
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Open Forum To One Country Only [message #182085] Sat, 05 October 2013 12:15 Go to next message
Blogeezer is currently offline  Blogeezer   Canada
Messages: 16
Registered: October 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Hi, I wish to have my forum available to people from my country only. The forum is specific to my country dealing with everything from politics to eco systems to government issues, and input from people in other countries would not work, for obvious reasons.
Is there any way to accomplish this?
Thank you for any assistance anyone can offer.
Re: Open Forum To One Country Only [message #182186 is a reply to message #182085] Sat, 05 October 2013 13:22 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
Do you want to prevent users from other countries from registering, posting or viewing the forum?
Re: Open Forum To One Country Only [message #183059 is a reply to message #182186] Sun, 06 October 2013 01:03 Go to previous messageGo to next message
Blogeezer is currently offline  Blogeezer   Canada
Messages: 16
Registered: October 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
From registering.
Re: Open Forum To One Country Only [message #183060 is a reply to message #183059] Sun, 06 October 2013 02:57 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
OK, one possible solution is to upload/ activate a plugin like this:
<?php
plugin_add_hook('PRE_REGISTER', 'plugin_canada');
function plugin_canada($uent) {
	if (file_get_contents('http://ipinfo.io/'. get_ip() .'/country') !== 'CA') {
		die('<h2>Sorry, we only allow registratiosns from users in Canada!</h2>');
	}
	return $uent;
}
Re: Open Forum To One Country Only [message #183061 is a reply to message #183060] Sun, 06 October 2013 08:29 Go to previous messageGo to next message
Blogeezer is currently offline  Blogeezer   Canada
Messages: 16
Registered: October 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Thank you so much, will give it a try and let you know.
Re: Open Forum To One Country Only [message #183063 is a reply to message #183060] Sun, 06 October 2013 14:43 Go to previous messageGo to next message
Blogeezer is currently offline  Blogeezer   Canada
Messages: 16
Registered: October 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Ok, I enabled plugins, but of the 25 that popped up nothing comes remotely close to having anything to do with this. Can this code you have written out be embedded in one of the script pages somewhere to serve the same purpose? This is all new to me, so am I just missing something with the plugins?
Re: Open Forum To One Country Only [message #183064 is a reply to message #183063] Sun, 06 October 2013 14:46 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
Put the code in a file called 'canada.plugin' and upload it to your forum's plugin directory.
After that, you should see it in the list of plugins you can enable.
Re: Open Forum To One Country Only [message #183068 is a reply to message #183064] Sun, 06 October 2013 23:48 Go to previous messageGo to next message
Blogeezer is currently offline  Blogeezer   Canada
Messages: 16
Registered: October 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Once again thank you so much, the plugin worked. I had to laugh though when I tried to set up a new registration on one of my other email addresses, it told me Registration was for Canada only! It would not allow me to register. That's great, just what I wanted to happen, was it not for the fact I live in Canada. So it is not accepting my IP address which is wholly Canadian. Go figure. I'll try and play around with it, there must be something amiss here, maybe some minor tweak to the code is necessary. Heck, I was just happy to see the whole plugin process work. Even if I cannot get it to work, thanks again for your assistance.
Re: Open Forum To One Country Only [message #183075 is a reply to message #183068] Mon, 07 October 2013 05:05 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
Are you running FUDforum on your PC?
If so, you are probably using IP 127.0.0.1, which isn't in any particular country.
Re: Open Forum To One Country Only [message #183078 is a reply to message #183075] Mon, 07 October 2013 06:55 Go to previous messageGo to next message
Blogeezer is currently offline  Blogeezer   Canada
Messages: 16
Registered: October 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
As a matter of fact I am. Thanks for clearing that up. I will get others to register and see how it works on their computers.
Thanks.
Re: Open Forum To One Country Only [message #183387 is a reply to message #183078] Mon, 21 October 2013 16:10 Go to previous messageGo to next message
Blogeezer is currently offline  Blogeezer   Canada
Messages: 16
Registered: October 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Sorry for not getting back sooner. I must change my last reply that "no, I am not running fud on my computer." And secondly, I have now had a number of people on different computers try and register, all in Canada by the way, with the same message returned that the registration is only available to Canadians.
So while the idea worked and is a good one, it is not allowing Canadians to register. Any further suggestions?
Re: Open Forum To One Country Only [message #183388 is a reply to message #183387] Mon, 21 October 2013 16:43 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
Is it working for some, but not for others?
Can some Canadians have American IP addresses, for example?
If so, it may explain what's going on.
Re: Open Forum To One Country Only [message #183391 is a reply to message #183078] Mon, 21 October 2013 23:06 Go to previous message
Blogeezer is currently offline  Blogeezer   Canada
Messages: 16
Registered: October 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Four different people from two different provinces tried and all were rejected.

[Updated on: Mon, 21 October 2013 23:09]

Report message to a moderator

Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: How do I change the register page contents
Next Topic: Moderator for all forums?
Goto Forum:
  

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

Current Time: Tue Oct 24 07:25:36 EDT 2017

Total time taken to generate the page: 0.00801 seconds