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
  #2  
Old 02-03-2006, 09:33 AM
AshokForums.com AshokForums.com is offline
 
Join Date: Nov 2005
Posts: 160
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks.. Installed
Reply With Quote
  #3  
Old 02-03-2006, 09:51 AM
TTG's Avatar
TTG TTG is offline
 
Join Date: May 2004
Location: Sth London
Posts: 1,042
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks interesting .. does it do any better than simply using this
Reply With Quote
  #4  
Old 02-03-2006, 10:58 AM
Zia's Avatar
Zia Zia is offline
 
Join Date: Dec 2005
Location: golpo.net
Posts: 931
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sounds nice...will it be a reason of heavy server load?
Reply With Quote
  #5  
Old 02-03-2006, 02:36 PM
The M.I.P.'s Avatar
The M.I.P. The M.I.P. is offline
 
Join Date: Nov 2002
Location: 127.0.0.1
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zia
sounds nice...will it be a reason of heavy server load?
This depends on your server. If your server is already running with high loads, you will definitely experience a loss of performance.
It's a non-intrusive plugin, so just give it a try.

The Maxmind guys basically included an option to use shared memory on Un*x machines (requires PHP with --enable-shmop), so that file i/o can be reduced and the db is kept in memory only once.
While this is a good idea in principle, its implementation is not unproblematic (e.g. because there's only a fixed shm key). So I did not use it in this plugin - but feel free to extend it.

If you need high-performance geotargeting, you'd be better off with using a different approach like GeoIP Apache module.
Reply With Quote
  #6  
Old 02-03-2006, 06:40 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<font color="#15a018">* Aftermath installs</font>
Reply With Quote
  #7  
Old 02-03-2006, 07:38 PM
IrPr IrPr is offline
 
Join Date: Mar 2005
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice one
but i could be a complete modification that shows Country code or flag is postbit(legacy) and member profile area...
Reply With Quote
  #8  
Old 02-03-2006, 11:09 PM
Borimikan Borimikan is offline
 
Join Date: Apr 2005
Location: Brooklyn, NY
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

where is the best place to have this on? in what template?
Reply With Quote
  #9  
Old 02-04-2006, 07:51 AM
IrPr IrPr is offline
 
Join Date: Mar 2005
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Borimikan
where is the best place to have this on? in what template?
Postbit / Memberinfo
Reply With Quote
  #10  
Old 02-04-2006, 09:00 AM
The M.I.P.'s Avatar
The M.I.P. The M.I.P. is offline
 
Join Date: Nov 2002
Location: 127.0.0.1
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by IrPr
Quote:
Originally Posted by Borimikan
where is the best place to have this on? in what template?
Postbit / Memberinfo
Don't forget that this plugin doesn't save its data in the users table or in a userfield. Location info is only available for a user/visitor who is currently surfing your forums.

The perfect use is to display banner ads depending on the geographic location of a visitor or to show location-specific content.
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 08:02 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.11354 seconds
  • Memory Usage 2,297KB
  • Queries Executed 23 (?)
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
  • (4)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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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_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