MOD Description: This MOD Provides you with a phoogle (php + google) map which displays a google map of site visitors whose geographic location has been obtained from their IP address (the IP here is not for icy phoenix!)
The program has two parts:
1) The "add IP" script (actually its the script called "ip_phoogle_map.php") which looks up a visitors IP from the large data file GeoLiteCity.dat (which must also be in the includes directory), this is only done if the visitor is new, and is not a common search bot.
2) The portal (CMS) block which generates the display of visitor markers in a block. The display routine also automatically scales the IP Phoogle Map to fit the browser window size, taking into account the left and right 180 px "header" columns.
FYI - the google map resize function
The resize function only works for the page "onload" - that is, due to the nature of how javascript works, it can only get the window size when the page loads, and then resize the google map to suite. If you resize the browser after the page has loaded, then its not possible for the script to change the size, as the script has already "ran". What happens though, is if you resize the browser, then reload the page (or press F5), the page will reload, the script will run again, and the google map will be resized to suite the new window size... so just hit F5 when you resize the browser, and all will be well ;)
And as said previously, the google map is not actually resized to the entire browser window size, but also take into account the page columns. Since most people would display this on a 3 column layout, I've subtracted the left and right "header" column widths (which are currently fixed in the Icy templates, so changing them in CMS does nothing), this is so that the map will not be over-sized push the left and right columns outside the browser window. If you have a 2 column TPL, then you need to add back in the width of the right column (180 px) in the block template. I did intend to make that automatically adjustable, but since header widths are hard-coded in the templates, its not accessible as page variables...
It is also worth pointing out there are slight differences between the way different browsers report the window size - IE is actually the worst, MS has changed its mind a lot over how it reports dimensions, hence the extra browser checking lines in the block template.
##########################################
## Compatibility: This mod should work with any IMPortal install
## and Icy Phoenix.
##
## MOD Version: 0.0.1
##
## Installation Level: Dead Easy
## Installation Time: 3 Minutes
##
## Files To Edit: 2
##
## templates/mg_themes/ip_phoogle_map_block.tpl
## /includes/page_header.php
##
## Included Files: 9
Demo can be seen working Here
(Note: I've customised the mod on my site to display to a fixed width to suit my theme - a default mod install will resize depending on browser window size).
Screenshot:
To simplify everything, I've bundled in all 3rd party files except GeoLiteCity.dat. All of the third-party files here have been modified to suit the phpbb environment and to make them secure. It is better to upload this zip file direct to your icy phoenix root folder and decompress there (directory structure should be maintained, so all the files should be placed where they belong).
You must get your own google map API key. If you don't have one, get one Here
Installation: I have created an install script which installs the required table and maintains the table prefix, so that it matches your phpbb / icyphoenix table structure. You must be logged in as admin to run the script.
*EDIT* Could not upload full installation with GeoLiteCity.dat (even though compressed) - seems to be a problem uploading 15MB files on this board (Error no mode specified on posting.php - although mode was new at start of upload). You must obtain GeoLiteCity.dat from the MaxMind Website
