Wednesday, October 26, 2011

Latest updates to Lampcms now on Github

My Question on Support site for LampCMS project

I recently commited the recent changes to github.
The main changes are: IP to Location module has been completely rewritten to use MongoDB instead of compiled DB file to store IP to Location database.
This means that relying on shared memory extension is no longer required - one less thing to worry about. Since this project requires MongoDB that means that you will be able to use IP to Location lookup guaranteed.

All you have to do is download the GeoIP database from Mixmind.com and make sure it's a .csv version.
I wrote the importer script for it, it's in the root www directory, called geo_import.php

That file has instructions on how to import geo file into your MongoDB.

Once imported the program will use the new classes to lookup location info for your visitors. Lookups are very fast - about 3 milliseconds per lookup and they are done in the shutdown function, after the page has been served to the user, so even these extra 3ms are not added to end-user browsing experience.

Another change is the addition of the "Whos online" module. This module is activated by default. To turn it off comment out the online module in the [OBSERVERS] section of !config.ini

What this module does is stores the data about the visitors browsing your site - it records user info, the url on your website that they are on currently, the ip, the resolved Geo Location based on IP, which usually includes longitude and latitude, country name, and sometimes city (also states are for US and Canada only)

This module only records the data, it also deletes records older than 24 hours so that the ONLINE collection does not grow too big and lookups will always be very fast.

There are 2 separate collections actually - ONLINE keeps track of logged in users and GUESTS keeps track of non-logged in users just browsing your site. For non-logged in users ip address is used as unique id

This module only records the user data, there is currently no functionality to display the "who's online" details on the site.

I'm working on this next, there will be an option to add a block with stats on number of guests and users currently online, also whole page will be available to show details on who is doing what on the site currentlly and later I want to add option to put all visitors on google map.

Also it will be possible to add small blocks of info of who is currently reading "this" question or "this" tag.

And also it will be easy to add small icons next to user to indicate if they are currently online or not.

All these is coming next. I also want to add API calls to get the "Whos online" data.

Finally I added a debugging comments to templating engine, so when your site is in debug mode, the html comments are added to beginning and end of each template so you can view the html source code and see the name of each template used for generating a page. This is very useful for when you write your own templates.

These html comments are only added in debug mode, so there is no overhead in production environment at all.

That's all for now. Download the latest version, try it out, let me know if you have any questions.

Click here to post your reply


No comments:

Post a Comment