vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Forum Display Enhancements - GLA - Geographic Location Awareness for vBulletin (https://vborg.vbsupport.ru/showthread.php?t=151601)

mfyvie 07-08-2007 03:20 PM

I guess it would be possible to manually add IP ranges to the database by hand if you wanted to. What are the IP ranges in question?

shamda 07-08-2007 03:23 PM

Quote:

Originally Posted by mfyvie (Post 1285884)
I guess it would be possible to manually add IP ranges to the database by hand if you wanted to. What are the IP ranges in question?


Well my isp is 66.229.216.150 which is c-66-229-216-150.hsd1.fl.comcast.net . Pretty popular isp.

steven s 07-08-2007 03:34 PM

Another cool plugin might be to display one flag of each country currently view pages.

mfyvie 07-08-2007 04:13 PM

Actually, what I meant was the range you wanted added, not just the ip address.

Anyway, if we look up that address you gave in the ARIN database we see that it is registered to comcast as you say, and covers the following range:

66.229.0.0 - 66.229.255.255 (a class B range, a pretty big chunk)

Before we do anything we need to convert this to numerical format. This is pretty simple, we just do it like this for the first part of the range:

66 * 256 * 256 *256
+
229 * 256 *256
+
0 * 256
+
0

This give us 1122304000

Now we do the same for the end of the address:

66 * 256 * 256 *256
+
229 * 256 *256
+
255 * 256
+
255

This gives us 1122369535

So we want to assign addresses between 1122304000 and 1122369535 to the US. But wait - are you really sure that this whole address range is in the US? How are you sure? Anyway, since this is your own database and nobody else's, you can do what you like.

Use a tool (like PhpMyAdmin, or the SQL query function in the admincp) to look inside your database. Execute the following SQL command to give you any ranges inside the one you want like this:

Code:

SELECT * FROM ip2country WHERE ip_from <= 1122369535 AND ip_to >= 1122304000
(note that I reversed the order of the high number and the low number).

We see that a single result is returned:

1122320960 - 1122320995 - only 35 addresses? In the middle of that range assigned to portugal? Probably a mistake.

Ok, so let's say you are absolutely sure that you want to add that big block in. You could make an SQL query like this:
Code:

INSERT INTO ip2country (ip_from, ip_to, country_code2, country_code3, country_name) VALUES ('1122304000', '1122369535', 'us', 'usa', 'United States')
Now you can use repair optimise table (in admincp) just for the ip2country table to rebuild the indexes.

Then you should be done. Anyone else can also use these instructions for another IP range if they like.

Some useful links:

http://ip-to-country.webhosting.info/forum (is full of spam, and isn't very useful, but these are the official forums for the database)
http://www.arin.net/whois/ (for looking up IP address ranges)

And of course - read install.txt and developer.txt in the installation archive for links, etc.

mfyvie 07-08-2007 04:23 PM

By the way, if anyone is wondering if their OWN address is being found in the database, you can go to this page:

http://ip-to-country.webhosting.info/

They look up your address and display the country. When I visit the site I see the details. If you visit the site and don't see your country come up, your IP is not in the database.

meissenation 07-08-2007 07:36 PM

Now we just need someone to make a plugin which will allow the admins to pick countries to ban and then have it dynamically ban anyone that registers with a certain country :D

mfyvie 07-08-2007 07:40 PM

Quote:

Originally Posted by meissenation (Post 1286076)
Now we just need someone to make a plugin which will allow the admins to pick countries to ban and then have it dynamically ban anyone that registers with a certain country :D

The best thing would be for this mod to be extended to include support for GLA. Since that mod already exists, it does 90% of the functionality, it just doesn't support GLA. I've sent a PM to the author, but haven't heard back yet.

TrIn@dOr 07-10-2007 02:21 PM

Very nice, will u notify Country-IP-DB updates here?

mfyvie 07-10-2007 03:03 PM

Quote:

Originally Posted by TrIn@dOr (Post 1287605)
Very nice, will u notify Country-IP-DB updates here?

Maybe, I can't say what will happen with that database in the future, but I may consider repacking it as a new version when there is a new database. I'm not sure how often database updates will come out. We'll just have to see what happens.

TrIn@dOr 07-10-2007 03:29 PM

Quote:

Originally Posted by mfyvie (Post 1287632)
Maybe, I can't say what will happen with that database in the future, but I may consider repacking it as a new version when there is a new database. I'm not sure how often database updates will come out. We'll just have to see what happens.

http://ip-to-country.webhosting.info/node/view/6

Approximately one time per month!


All times are GMT. The time now is 11:37 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01108 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete