<?php

// Configuration for myChess
// `````````````````````````
// This file is require_once'd by most PHP pages.

// Branding

define('LANGUAGE',     'en-GB');
define('DB_PATH',      '../games.db');
define('APP_NAME',     'myChess');
define('S_ABOUT', '
myChess is a free, two-human chess service. You can monitor your games via RSS
or email. The <a href="http://code.google.com/p/mappy/">full source code</a> for
the service is available online.
');
define('HISTORY_COUNT', 5);
define('FROM_EMAIL',   'mail@myChess.local');
define('RSS_EMAIL',    'rss@myChess.local');
define('RSS_ITEMCOUNT', 4);

// Constants

require_once 'lang/'.LANGUAGE.'.php';
define('HOME_ADDRESS',  '?p=home');
define('PLAYER_W',      1); // Uppercase pieces
define('PLAYER_B',      2); // Lowercase pieces
define('PLAYER_S',      3);
define('DEFAULT_BOARD', 'r|n|b|k|q|b|n|r|p|p|p|p|p|p|p|p|||||||||||||||||||||||||||||||||P|P|P|P|P|P|P|P|R|N|B|Q|K|B|N|R');

// Helper functions

function redirect($url) {
	header('Location: '.$url);
	die();
}

function main_url() {
	return 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']).'/index.php';
}