<?php
session_start();
//----------------------
// Includes
//----------------------
require "inc/functions.php"; // functions
require "inc/constants.php"; // constant
require "inc/rain.error.php"; // error manager
require "inc/rain.mysql.class.php"; // mysql
require "inc/rain.tpl.class.php"; // template
//----------------------
// Init Database
//----------------------
// uncomment if you want to use database connection
/*
require "conf.db.php";
$db = new MySql();
$db->connect( $db_hostname, $db_username, $db_password, $db_database );
// unset all database account variable for security reason
unset( $db_hostname );
unset( $db_username );
unset( $db_password );
unset( $db_database );
*/
//----------------------
// Init Template RainTPL
//----------------------
$tpl = new RainTPL( TPL_DIR ); // set your theme
//----------------------
// Set the timezone
//----------------------
if( function_exists( "date_default_timezone_set" ) )
date_default_timezone_set( TIMEZONE );
//----------------------
// Set the language
//----------------------
define( "LANG_ID", "en" );
// include the generic vocabulary
require LANG_DIR . LANG_ID . "/generic.php";
// set local variables for time, money, etc.
setlocale( LC_ALL, explode(",", LOCALE) );
//----------------------
// Load Contents
//----------------------
/* here your functions to load contents */
// ex.
$title = "Rain Framework";
$content = "The easy php framework";
$tpl->assign( "title", $title );
$tpl->assign( "content", $content );
$tpl->assign( "time", time() );
$tpl->assign( "money", "100" );
$tpl->draw( "home" );
?>