Here my little Christmas gift.
This will show a world map on your site and the countries of the connected users to your matchserver port.
Live example here: Statistics | Freestyle GunZ
Requirements:
- Access to shell_exec function.
Installation:
1) Upload to root of your www.
2) Open worldmap.php and edit the server IP and server port in case you changed it.
3) Add the following to the page where you want to include the live world map:
4) Done.PHP Code:<?php
require("worldmap.php");
?>
Download:
worldmap.rar
Notes:
- I also added caching, default is 1 hour. You can change this in the script.
- You can modify the height and width of the worldmap at line 5 in worldmap.php.
- If you have many online users, it can take a bit for the script to finish since it has to fetch the country code from an external site.
- Should work right out of the box after you modified the server IP and port, if not, let me know if there are any bugs.
- The IP to country code may not be 100% accurate, but I'm sure you can live with that.
- If you already included jQuery on your website, you may have to remove line 2 in worldmap.php to avoid any issues.
Credits:
jVectorMap: Home
jQuery: jQuery
Telize: Telize - JSON IP and GeoIP REST API




Reply With Quote


