ricolog is a PHP plugin for the CMS that is able to log page hits and referers for a unlimited number of pages
It also includes an on-the-fly administration that has options for custom SQL SELECT statements, updating logs, checking records, and supports multiple users with unique permissions for each user (full access, read only, etc)
Download
cms(1.1.0).zip (newest framework + all official plugins)
Terms of Use
Script is released as public domain. For full Terms of Use visit my Use Policy
Open and run addPlugin_rlog.php in your browser. This creates the necessary tables and settings.
When you install the plugin, for security reasons, the default permission set for all users and admins is "no access" so if you want to give specific users access to ricolog, you need to go to the admn.php and edit the ricolog permission for the users
counter.php options
You can set the blocked referers. For each domain or url that you don't want the referers to be logged, stick them in the @block array at the top of counter.php script. It's handy to set your own site URL as blocked, otherwise it'll log each page they visit on your site as a referer. (since technically it is)
Set the display type (note: how hits are displayed will not effect the logs)
set to 0 : Nothing is displayed on the page. The counter is hidden.
set to 1 : Shows the number of hits to only that page.
set to 2 : Adds the hits for all the logged pages then displays total.
Displaying
To add a counter to any of your pages that allow SSI (change to location of your counter script): <!--#include virtual="cms/counter.php"-->
To add a counter to any of your PHP pages (change to location of your counter script):
<?php
require("cms/counter.php");
?>
Forcing specific "display types" (optional)
You can also force a specific page to have a different display type than your counter.php setting (see counter.php options for more info on display types). For example, to hide the counter on just one page: <!--#include virtual="cms/counter.php?display=0"-->
If you know SQL you can open rlog.php edit the "Quick-Links" down about line 50 to use custom MySQL statements for custom select statements and links
The format is: $quick['Text for Link']="SQL STATEMENT HERE";
You refer to the referer table as $db_mysql->table['referer'] and the counter table is $db_mysql->table['counter'] (for more examples, check out the existing quick-links already listed there)
About
Creates two tables in your database. A counter and a referer table. "cms_referer" and "cms_counter" by default (can be renamed)
Four Admin user permission levels
0: No access. Default access level. Users cannot even login to ricolog
1: Read-only access. Users can login and view current counter and referer values
2: Edit logs access. Users can login and change the counter and referer number values
3: Full access - MySQL queries. Users can login and change values, but can also run custom MySQL queries. This allows easy mass updating of values, or custom SELECT statements. However, this is dangerous as a user who knew SQL could potentially delete entire tables from the database