<?php
//error_reporting( E_ALL );
unset( $config, $lang );

/*
* Directories 
*/
$config['dir_core'] = 'core/';
$config['dir_db'] = 'db/';
$config['dir_libraries'] = 'libraries/';
$config['dir_plugins'] = 'plugins/';
$config['dir_lang'] = 'lang/';
$config['dir_templates'] = 'templates/';
$config['dir_images'] = '_images/';

/*
* If You want embed PHP code in template files 
* set this variable true but it is not recommended and
* script will be slower
*/
$config['embed_php'] = false;

/*
* Add minutes difference between your local time and server time
*/
$config['time_diff'] = 0;

/*
* If should be use wysiwyg editor or default
*/
$config['wysiwyg'] = false;

/*
* Administrator login and password 
*/
$config['login'] = "admin";
$config['pass'] = "admin";

/*
* Default language
*/
$config['default_lang'] = "en";

$config['cookie_admin'] = defined( 'CUSTOMER_PAGE' ) ? null : 'A';

if( isset( $sLang ) && is_file( $config['dir_lang'].$sLang.'.php' ) && strlen( $sLang ) == 2 ){
  setCookie( 'sLanguage'.$config['cookie_admin'], $sLang, time( ) + 86400 );
  define( 'LANGUAGE', $sLang );
}
else{
  if( !empty( $_COOKIE['sLanguage'.$config['cookie_admin']] ) && is_file( $config['dir_lang'].$_COOKIE['sLanguage'.$config['cookie_admin']].'.php' ) && strlen( $_COOKIE['sLanguage'.$config['cookie_admin']] ) == 2 )
    define( 'LANGUAGE', $_COOKIE['sLanguage'.$config['cookie_admin']] );
  else
    define( 'LANGUAGE', $config['default_lang'] );
}

$config['language']	= LANGUAGE;
$config['version'] = '0.1';
$config['images_sizes'] = Array( 0 => 180, 1 => 800 );
$config['max_dimension_of_image'] = 900;
$config['admin_list'] = 10;
$config['comments_list'] = 5;
$config['default_directory'] = "";

$config['config'] = 'config/general.php';
$config['config_lang'] = 'config/lang_'.LANGUAGE.'.php';

$config_db['pages'] = $config['dir_db'].LANGUAGE.'_pages.php';
$config_db['pages_ext'] = $config['dir_db'].LANGUAGE.'_pages_ext.php';
$config_db['images'] = $config['dir_db'].LANGUAGE.'_images.php';
$config_db['images_votes'] = $config['dir_db'].LANGUAGE.'_images_votes.php';
$config_db['images_comments'] = $config['dir_db'].LANGUAGE.'_images_comments.php';

define( 'DIR_CORE', $config['dir_core'] );
define( 'DIR_DB', $config['dir_db'] );
define( 'DIR_IMAGES', $config['dir_images'] );
define( 'DIR_LIBRARIES', $config['dir_libraries'] );
define( 'DIR_PLUGINS', $config['dir_plugins'] );
define( 'DIR_LANG', $config['dir_lang'] );
define( 'DIR_TEMPLATES', $config['dir_templates'] );

define( 'DB_PAGES', $config_db['pages'] );
define( 'DB_PAGES_EXT', $config_db['pages_ext'] );
define( 'DB_IMAGES', $config_db['images'] );
define( 'DB_IMAGES_VOTES', $config_db['images_votes'] );
define( 'DB_IMAGES_COMMENTS', $config_db['images_comments'] );

define( 'DB_CONFIG', $config['config'] );
define( 'DB_CONFIG_LANG', $config['config_lang'] );

define( 'MAX_DIMENSION_OF_IMAGE', $config['max_dimension_of_image'] );
define( 'VERSION', $config['version'] );
define( 'WYSIWYG', $config['wysiwyg'] );
define( 'TIME_DIFF', $config['time_diff'] );
?>