This howto was originally contributed by ramanan
Setting up Mint for Textpattern is fairly straight forward. The first part of the Mint install instructions involves filling in information in Mint’s configuration file. You can grab this information from your Textpattern configuration file. The configuration data for Textpattern is stored in the config.php file located in your textpattern folder. This file contains values for 7 variables, but we need only concern ourselves with the first four, which are:
$txpcfg['db'] = 'DB_NAME';
$txpcfg['user'] = 'DB_LOGIN';
$txpcfg['pass'] = 'DB_PASSWORD';
$txpcfg['host'] = 'DB_HOST';
This information is all you need to configure Mint. Mint’s configuration file is located in the config folder of your Mint install; it is called db.php. You will need to open it and set the following values using the information from your Textpattern configuration file. You can see how I have matched the values from the two files. (Note that I am assuming you don’t want to change the database table prefix. You may want to do this if you have two copies of Mint running in the same database.)
$Mint = new Mint (array
(
'server' => 'DB_HOST',
'username' => 'DB_LOGIN',
'password' => 'DB_PASSWORD',
'database' => 'DB_NAME',
'tblPrefix' => 'mint_'
));
Now that your mint configuration file is ready, you can upload the folder to your web site as per the instructions. Browsing to this folder should complete the install process.
The last step that remains is adding the JavaScript Mint needs to run to the pages you want statistics logged for. If you want all pages generated by Textpattern to log stats, then the simplest way to do things is to add the following line to your index.php file. The end of the file is reproduced below (as of 4.0.1):
...
include $txpcfg['txpath'].'/publish.php';
// THIS IS THE NEW LINE WE ADD
@include_once($_SERVER["DOCUMENT_ROOT"]."/mint/config/auto.php");
textpattern();
This will insert the JavaScript in to every page on your site. (Here we have assumed that your Mint directory and your Textpattern web site are located in the root folder of your web server.)
(Alternatively, if you have a form template that generates your HTML head sections for all your pages, you can just include the javascript yourself in this template. In that case, include this line of code: <script src="/mint/?js" type="text/javascript"></script> somewhere in that template.)