<?PHP

//zone crontab
//[[$PHP55]] [[$D2ND_A]]/crontab/web/emailer.php -c [[$D2ND_A]]/phpini/expodrom.eu/php.ini
//[[$PHP55]] [[$D2ND_A]]/crontab/web/emailer.php -c /data01/virt39580/domeenid/www.expodrom.eu/phpini/expodrom.eu/php.ini

session_start();
error_reporting(E_ALL & ~E_NOTICE);//change after install
//error_reporting(0);//for live
date_default_timezone_set('Europe/Tallinn');//change after install

//SOME FORCED CHANGES IN
///data03/virt22772/domeenid/www.projectpartner.ee/crontab/otsing
//_ManualUrl

define('_Title', 'Project Framework');//if title is not set from database

if(!is_file($_SERVER['DOCUMENT_ROOT'].'/inc/conf.php')){

	define ('_RootFolder', $_SERVER['DOCUMENT_ROOT'].str_replace('/admin', '', dirname($_SERVER['SCRIPT_NAME'])));
	define ('_RootUrl', 'http://'.$_SERVER['HTTP_HOST'].str_replace('/admin', '', dirname($_SERVER['SCRIPT_NAME'])));
	define ('_RootAjax', _RootUrl.(preg_match('/admin/i', $_SERVER['PHP_SELF']) ? '/admin' : '').'/ajax.php');
}
else{

	define ('_RootFolder', $_SERVER['DOCUMENT_ROOT']);
	define ('_RootUrl', 'http://'.$_SERVER['HTTP_HOST']);
	define ('_RootAjax', _RootUrl.(preg_match('/admin/i', $_SERVER['PHP_SELF']) ? '/admin' : '').'/ajax.php');
}
define('redirectLinks', true);
define ('_defaultLanguage', 'DEFAULT_LANGUAGE');//DEFAULT_LANGUAGE

/*
For session hijack
*/
if( !isset($_SESSION['initiated']) ){
    session_regenerate_id();
    $_SESSION['initiated'] = true;
}


define('_IP', $_SERVER['REMOTE_ADDR']);

/*
* DEFINES
*/

//define('_SQL', 'PgSql');//core/classes/class.PgSql.php
define('_SQL', 'MySql');//core/classes/class.Mysql.php

define('sqlconf[prefix]', '');//table prefix
define('sqlconf[host]', 'DB_HOST');//DB_HOST
define('sqlconf[port]', 'DB_PORT');//DB_PORT
define('sqlconf[database]', 'DB_DATABASE');//DB_DATABASE
define('sqlconf[user]', 'DB_USER');//DB_USER
define('sqlconf[password]', 'DB_PASSWORD');//DB_PASSWORD
define('sqlconf[error_report_email]', 'DB_ERROR_REPORT_EMAIL');//DB_ERROR_REPORT_EMAIL
define('sqlconf[show_error]', true);//DB_ERROR_SHOW_ERROR
define('sqlconf[log_time]', false);//DB_QUERYS_LOADTIME OVER 1 SEC - WARNING: IT WILL SLOW DOWN PAGE SO USE ONLY, IF U WANT VIEW QUERY LOG TIMES
define('phpmyadmin', 'DB_MYADMIN');

$_UseStaticPagelist = false;//if u want configure models and pages access manually use true else false
if( !constant('sqlconf[host]') || strlen(constant('sqlconf[host]')) == 7 || $_UseStaticPagelist == true ){

	$_UseStaticPagelist = true;
	define('_ModelPageList', json_encode(array(
		'content' => array(
			array('is_static' => true, 'is_first_page' => false, 'model' => 'installer', 'page' => 'install', 'page_position' => 'admin,public')
		),
		'title' => array(
			array('is_static' => true, 'is_first_page' => false, 'model' => 'header_data', 'page' => 'title', 'page_position' => 'admin,public')
		)
	)));
}

define('_UseStaticPagelist', $_UseStaticPagelist);

define ('_Template', 'project');//this is default template
//template file names
if( !constant('sqlconf[host]') || strlen(constant('sqlconf[host]')) == 7 )
	define ('_TemplateGraphicPublic', 'admin.template');
/*
else if(preg_match('/MSIE 7.0/i', $_SERVER['HTTP_USER_AGENT']))
	define ('_TemplateGraphicPublic', 'templateIE7');
*/
/*
else if( preg_match('/chrome/i', $_SERVER['HTTP_USER_AGENT']) )
	define ('_TemplateGraphicPublic', 'template.chrome');
*/
else
	define ('_TemplateGraphicPublic', 'template');
define ('_TemplateGraphicAdmin', 'admin.template');
define ('_TemplateGraphicAjax', 'ajax.template');
define ('_TemplateGraphicFB', 'template.fb');
//end of template file names

define ('_HostTemplate', _RootUrl.'/templates/'._Template);
define ('_CurrentTemplate', _RootFolder.'/templates/'._Template);
define ('_TmpBaseFolder', _RootFolder.'/tmp');
define ('_Core', _RootFolder.'/core');
define ('_Classes', _Core.'/classes');

if(!is_dir(_TmpBaseFolder)){

	mkdir(_RootFolder.'/tmp');
}

?>