vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Geotargeting by GeoIP integration (https://vborg.vbsupport.ru/showthread.php?t=107036)

The M.I.P. 02-02-2006 10:00 PM

Geotargeting by GeoIP integration
 
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.

AshokForums.com 02-03-2006 09:33 AM

Thanks.. Installed

TTG 02-03-2006 09:51 AM

Looks interesting .. does it do any better than simply using this

Zia 02-03-2006 10:58 AM

sounds nice...will it be a reason of heavy server load?

The M.I.P. 02-03-2006 02:36 PM

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.

Snake 02-03-2006 06:40 PM

<font color="#15a018">* Aftermath installs</font>

IrPr 02-03-2006 07:38 PM

Nice one
but i could be a complete modification that shows Country code or flag is postbit(legacy) and member profile area...

Borimikan 02-03-2006 11:09 PM

where is the best place to have this on? in what template?

IrPr 02-04-2006 07:51 AM

Quote:

Originally Posted by Borimikan
where is the best place to have this on? in what template?

Postbit / Memberinfo

The M.I.P. 02-04-2006 09:00 AM

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.


All times are GMT. The time now is 12:16 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.02519 seconds
  • Memory Usage 1,737KB
  • 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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