Hi, I’ve made a snippet what gets some of the bbclone stats to your site (click to see
bbclone in action). This is an ongoing project,
I’ll try to get the totals page done next and after that (
done), I will try to make these more template driven.
The output of this snippet is pretty configurable in the current state too. Here’s some instructions how to get this done:
First you need to install BBClone:
- 1. Download BBClone from http://bbclone.de/download.php
- 2. Download newest IP2EXT from http://bbclone.de/download.php?sub=ip2ext
- 3. Extract both packages and copy the new ip2ext folder inside the bbclone folder overwriting old files
- 4. Upload the bbclone directory to your webserver (can be anywhere you want)[list][li]NOTE: You can rename the bbclone folder if you want!
[/li][li]5. CHMOD all files inside bbclone/var/ to 0666,
exept .htaccess file![/li]
[li]6. Paste the following code to the bottom of modx index.php (tried to do this as a plugin but did not succeed,
could someone help?)
- NOTE: Edit the $bbclone_path to point to your bbclone folder!
[/li]
[/list]
$page_title=$modx->documentObject['pagetitle'];
$bbclone_path=$modx->config['$base_path']."bbclone/";
define("_BBC_PAGE_NAME", "$page_title");
define("_BBCLONE_DIR", $bbclone_path);
define("COUNTER", _BBCLONE_DIR."mark_page.php");
if (is_readable(COUNTER)) include_once(COUNTER);
- 7. Configure BBClone to work the way you want by editing the file bbclone/conf/config.php (ie. count only unique visitors, hide config information, etc) Read the manual about configuration settings at http://help.bbclone.de/index.php?n=Config.HomePage
After you have installed BBClone, go and visit your site and then point your browser to the bbclone url (ie. www.somedomain.com/bbclone). You should see your visit details in bbclone now.
Now to the snippets:
With the attached snippets, you can get the time stats and global stats of bbclone to your page. The code is pretty much the same as show_time.php and show_global.php in bbclone and I really can’t take any credits of it. I just modified them to work as a snippet and made some css changes so you can customize the look of it to fit your desing.
There are some configuration setting at the start of the snippets. They are commented and it should be clear how to use them, but feel free to ask if you have any problems!
Snippet Installation:
bbclone_show_time
- 1. Copy the content of bbclone_show_time.txt to a new snippet and name it
- 2. Change the paths at the start of the snippet to point to correct locations
- 3. Change the graph print sizes (if needed)
- 4. Copy the content of bbclone_show_time.css to the HEAD of your template or to your css file (but edit out the <style> tags if you put it in a external css file)
- 5. Change the colors in the css to fit your color scheme, there are comments to tell what class is for what
- 6. Call your snippet in some document and see the results
bbclone_show_global
- 1. Copy the content of bbclone_show_global.txt to a new snippet and name it
- 2. Change the paths at the start of the snippet to point to correct locations
- 3. Set the other configurable values to be the same as in bbclone config file
- 4. Call your snippet in some document and see the results (uses same css as the snippet above)
If you are an advanced user, you can easily modify the whole output of the snippets by changing the return strings of them.. the functions returns content in tables. That’s it for now..
EDIT: Added show_global, you should reload the show_time snippet also, made some slight changes.