updated as of: August 20, 2012
last author: Andy Theuninck
Want to just start shoe-horning the tools you need into this structure? Here's the anatomy of a PHP tool under fannie. You'll need to add one to four lines to an existing tool. I know, demanding.

Grab the config

The first thing every script should do is include config.php. This gives you a variable named $FANNIE_ROOT that is the absolute path to the top of fannie. Any other files you need can be included using this variable.

Need a database connection?

If you need a database connection, include $FANNIE_ROOT."src/mysql_connect.php". The name is historic; it works with mssql too. This include brings in a variable named $dbc. $dbc is not a mysql resource; it's a class wrapped around ADOdb for multiple dbms support. If you want to use this class, it's pretty intuitive. $dbc->query is equivalent to mysql_query, $dbc->num_rows is equivalent to mysql_num_rows, etc.

Want a skin

If you want the "outer frame" of fannie with menu, include two more files: $FANNIE_ROOT."src/header.html" and $FANNIE_ROOT."src/footer.html". It's optional. I don't always use it when I want the full screen width.