Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Geotargeting by GeoIP integration Details »»
Geotargeting by GeoIP integration
Version: 1.0.2, by The M.I.P. The M.I.P. is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.5.x Rating:
Released: 02-02-2006 Last Update: 02-02-2006 Installs: 19
Uses Plugins
Additional Files  
No support by the author.

This plugin uses Maxmind's GeoIP database to look up a visitor's country depending on his IP-address.
You may use this e.g. to display specific content or advertisements depending on the geographical location of your visitors.

Installation:
  1. Download geoip.inc PHP module and save it in your forum's includes/ directory.
  2. Download the latest GeoLite Country Database GeoIP.dat.gz, uncompress it (gunzip or evil ones like WinRAR) and save the uncompressed file under includes/GeoIP.dat (you can change the location of this file in your vBulletin Options).
    You should update this file once in a while.
  3. Make sure to have plugin system enabled.
  4. Install product mip-geoiptracker-1.0.xml
Usage:
Use $bbuserinfo[country] (or $vbulletin->userinfo[country]) in your code, your templates, etc.
Have a look on the plugin sources and on GeoIP PHP API if you're interested in getting infos other than the country code.

Changes:
  • 1.0.1 --> 1.0.2
    Fixed bug with geoipdatfile setting not being included in product.
  • 1.0 --> 1.0.1
    Basic caching is done using cookies.

This plugin is likely to work also with commercial versions of Maxmind GeoIP databases, which would - with minor tweaks - allow resolving a user's location down to region and even city levels.

On high-traffic sites, I recommend using GeoIP PHP extension or Apache module instead of this plain PHP code.

Please note that I don't give free support for this plugin, as the vBulletin part is too simple and the rest is code from Maxmind.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 05-27-2008, 07:36 AM
Thomas P's Avatar
Thomas P Thomas P is offline
 
Join Date: Oct 2001
Location: Munich, DE
Posts: 365
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to block certain IPs based on their geolocation using this hack?
Reply With Quote
  #23  
Old 08-29-2009, 10:16 AM
imported_silkroad imported_silkroad is offline
 
Join Date: Dec 2003
Posts: 563
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Psionic Vision View Post
Nevermind, it's based on DNS resolver... And DNS queries may cause page load delays, although not necessarily server load.
Bleh. Not interesting.
No, this is wrong.

This program is based on IP address which comes "without network load cost" from the HTTP $_SERVER['REMOTE_ADDR'] global PHP var.

Basically, the server simply takes the REMOTE_ADDR (IP address) and queries a file on the same server (can download file for free) and returns country information.

This is a great feature for many forums that would like to display different content to the user based on country.
Reply With Quote
  #24  
Old 08-29-2009, 10:18 AM
imported_silkroad imported_silkroad is offline
 
Join Date: Dec 2003
Posts: 563
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Thomas P View Post
Is it possible to block certain IPs based on their geolocation using this hack?
Yes, you can easily do this, but you need to write the extra code yourself.
Reply With Quote
  #25  
Old 08-29-2009, 10:19 AM
imported_silkroad imported_silkroad is offline
 
Join Date: Dec 2003
Posts: 563
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Tom Freeman View Post
Sorry if this is a dumb question, but does this mod also allow me to geolocate forums. Therefore only showing certain forums to certain users based on their geographic location?

Thanks,
Tom
Yes, it does. Basically, with a bit of writing code, you can do "just about anything" based on Country (or even City).

For many users, it might be easier just to install this PHP extension (since this mod is not supported anymore):

http://us3.php.net/manual/en/book.geoip.php
Reply With Quote
  #26  
Old 08-31-2009, 07:48 AM
imported_silkroad imported_silkroad is offline
 
Join Date: Dec 2003
Posts: 563
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, we found it was easier to install Apache2 mod_geoip. A plugin for this is not really necessary, FYI. So, I recommend mod_geoip for this because it is easy to install and runs great.
Reply With Quote
  #27  
Old 09-08-2009, 08:00 AM
imported_silkroad imported_silkroad is offline
 
Join Date: Dec 2003
Posts: 563
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We have integrated GeoIP into vBulletin very easily using mod_geoip.

Details on upgrading mod_geoip here

What we have done so far, is use mod_geoip for geo-targetting.

In addition, we made a simple change to the navbar template to say:

Welcome from Country_Name, User_Name

instead of the standard, Welcome, User_Name

Details on vB navbar feature here.
Reply With Quote
  #28  
Old 08-17-2010, 10:36 AM
clubvr4's Avatar
clubvr4 clubvr4 is offline
 
Join Date: Jul 2010
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone ported this to vb4 yet?
Reply With Quote
  #29  
Old 06-11-2012, 06:38 PM
Dave234 Dave234 is offline
 
Join Date: Mar 2012
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work with vbulletin 4.1.11? Does it work with Amazon Associates?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:09 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.06819 seconds
  • Memory Usage 2,283KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete