Back to vBulletin 3.6 Add-ons

GLA - Geographic Location Awareness for vBulletin
Mod Version: 1.00, by mfyvie

This modification is in the archives.
vB Version: 3.6.7 Rating: (24 votes - 4.92 average) Installs: 258
Released: 07 Jul 2007 Last Update: 17 Jul 2007 Downloads: 18074
Not Supported DB Changes Uses Plugins Additional Files  

*** Staff note: The author of this modification has passed away in a http://www.englishforum.ch/announcements/20529-mourning-loss-friend-leader-innovator-genuinely-nice-guy.html. We wish his family all strength in dealing with this traggic issue. ***

GLA - Geographic Location Awareness for vBulletin

What does this do?

GLA adds an additional layer of information into your vBulletin site (visitors' country name). GLA doesn't output anything to the user, or change any display on your forum, it simply adds additional information which is then available to other programs or mods.

But what can I use it for?

There are many applications, but the main idea is that this mod enables other mod writers to very easily add location awareness functions into their own mods. If you were thinking of writing a mod to display a person's registration country in the postbit, it's now very easy to do.

Why should I download and install this?

Unless you are also going to install one of the other mods which requires GLA, there isn't much point. If you are a developer, you might install this to add functionality to your own mods.

How will I update this?

Easy - you can update the database used for matching country names to IP addresses yourself - it's very easy. Full instructions are provided in the install.txt file inside the zip file.

How do I install?

Download the zip file and look for install.txt. But basically it's easy - upload the contents of the upload folder to your forum directory, and import the enclosed .xml file. That's it.

How do I know if it is working?

A test script is provided that will test every aspect of your GLA installation to inform you of any potential problems. Please see the installation instructions for information about this test script.

What about flags?

This includes flags, meaning that other mods won't have to package flags. You can change the flags if you like, instructions are provided.



How about a quick summary of features?
  • Fast - GLA adds almost no overhead. This is important for big sites. Only a single query is executed each time a session is created
  • Transparent - new variables are automatically available to any part of your site
  • Updateable - you can update the database yourself
  • Free - a free database is used
  • Accurate - the database provider claims 98% accuracy
  • Configuration - absolutely nothing to configure for this mod (since it just provides data to other mods)
  • Extendible - GLA may encourage other mod developers to add location features. Why not ask the author of your favourite mod to use GLA? Were you thinking of making a mod which uses location data, but didn't know how? GLA solves the problem for you - now all you need to do is read a variable
  • Easy developer information - hints and tips are provided with the zip file to make life easier for developers
Is there a list of mods that currently use GLA?



Yes, a list will be maintained here. Please let me know if you find a mod which requires GLA that isn't listed, so I can add it. The current list of GLA mods is as follows:
  • http://www.vbulletin.org/forum/misc.php?do=producthelp&pid=gla_who_online
  • Check Proxy RBL on Registration

    Spoiler (click to open)


    Here's some unsupported and untested code that can be used to modify the current version of Proxy RBL mod (4.0) to work together with GLA (Geographic Location Awareness). This allows you to specify an additional whitelist or blacklist based on the country where the user has registered from. In my case I seem to have quite a few Swiss IP addresses listed, but most of my registrations are from Switzerland. Therefore I simply whitelist Switzerland. You can also use this so users from a certain country are always matched, regardless of whether their IP address is listed in a certain blacklist.

    I haven't made a fancy user interface for this, because this is not my mod. My code is posted freely here for Daniel to consider implementing as standard. Please remember that unless you have installed and tested GLA first and it is working (details on the GLA thread), then this code won't work. Right let's get started:

    Go into the AdminCP -> Plugins and Products -> Plugin Manager -> DMeNTED's RBL Checker -> Check IP against RBLs/IPs. Click the large edit box and locate this code:

    Code:
          if ($DM_rblcheck_result == $DM_rblcheck_srvmask) {
                // ********************** NOTIFICATIONS **********************
    Above this section insert:
    Code:
    // Modification to incorporate country checks into RBL checker. This will only work if GLA is already installed, tested and working
    // Obtain GLA here: index.php?t=151601
    if (isset($vbulletin->session->vars['country']))
    {
        // Country blacklist - enter a list of countries which are exempted from the RBL checker (use valid *lower case* ISO 2 letter codes only!)
        // See http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for list of codes
        // example: $whitelist = array('gb', 'fr', 'it');
        $whitelist = array();
        if (in_array($vbulletin->session->vars['country_iso2'], $whitelist)) 
        {
            // We have a match on the whitelist, bail out of the entire plugin, but reset the variables first.
            $DM_rblcheck_result = null;
            return;
        }
        // Same as above example for whitelist. People from these countries will be flagged as positive matches, regardless of the RBL status.
        // Think carefully before using the blacklist - it is generally not recommended to ban entire countries 
        $blacklist = array();
        if (in_array($vbulletin->session->vars['country_iso2'], $blacklist)) 
        {
            // We have a match on the blacklist, set the variables and continue
            $DM_rblcheck_result = $DM_rblcheck_srvmask;
            $DM_rblcheck_errcode = "Matched a blacklisted country: " . $vbulletin->session->vars['country'];
        }
    }
    This modification is untested (though it is running on my system, but I haven't had any alerts yet so I can't say 100% whether it is working). If it works for you - maybe say so. Don't forget that you have to insert the correct country codes into the code (see the comments in the code itself), and don't get to use 'quotation' marks and commas to separate multiple entries.

    Now to add the country name into your reports find this line:

    Code:
    $DM_rblcheck_errcode = "MATCHED IN THE RBL DATABASE of the " . $DM_rblcheck_rblserv . " RBL.";
    And replace with:

    Code:
    $DM_rblcheck_errcode = "USER FROM: $vbulletin->session->vars['country'] MATCHED IN THE RBL DATABASE of the " . $DM_rblcheck_rblserv . " RBL.";
    Also, further to this post, I recommend moving the hook used for Check IP against RBLs/IPs to register_addmember_complete (and change to execution order 4 if you do this), due to the fact that multiple notifications get sent for every bot that turns up.

    It might be useful to duplicate sections of code in both plugins so that blocking is done in the Check IP against RBLs/IPs plugin and notifications are done in Auto-Ban or Flag for Moderation plugin. This would avoid all the unnecessary notifications for bots that never succeed in registering anyway.

    Remember, just to repeat myself again (I know some people have trouble reading instructions sometimes). Do not ask for support for GLA on this thread - install it and if it doesn't work go through every post on the GLA thread as there are steps for verifying it on that thread.

    Close
    (unsupported, hack for an existing mod)
Before posting on this thread:

Please post on this thread only for issues relating to GLA itself. If you have an issue that concerns a mod that uses GLA, please post on the appropriate http://www.vbulletin.org/forum/misc.php?do=producthelp&pid=gla_who_online for that mod. If you have an issue which concerns the underlying functionality of GLA itself, then post here.

Even though this is a required mod from another mod and may be fairly boring, please click install if you are using it. Support requests from people who have not clicked install may not be answered.

No screen shots for this mod, since there's nothing to see.

Version history
1.0 (07.07.07) Initial version

Download

This modification is archived, downloads are still allowed.

File Type: %1$s Geo_Location_Awareness_1_0.zip (861.3 KB, 7968 downloads)

Screenshots

Click image for larger version
Name:	gla_test.jpg
Views:	2426
Size:	70.1 KB
ID:	67081  


vblts.ru supports vBulletin®, 2022-2024