function build_lang_select($language = 'english')
	{
		$language = ($language == '') ? 'english' : $language;
		$dirname = 'language';
		$dir = opendir($dirname);

		$lang_options = array();
		while ($file = readdir($dir))
		{
			if (preg_match('#^lang_#i', $file) && !is_file(@ip_functions::ip_realpath($dirname . '/' . $file)) && !is_link(@ip_functions::ip_realpath($dirname . '/' . $file)))
			{
				$filename = trim(str_replace('lang_', '', $file));
				$displayname = preg_replace('/^(.*?)_(.*)$/', '\1 [ \2 ]', $filename);
				$displayname = preg_replace('/\[(.*?)_(.*)\]/', '[ \1 - \2 ]', $displayname);
				$lang_options[$displayname] = $filename;
			}
		}

		closedir($dir);

		@asort($lang_options);
		@reset($lang_options);

		$lang_select = '<select name="lang" onchange="this.form.submit()">';
		while (list($displayname, $filename) = @each($lang_options))
		{
			$selected = ($language == $filename) ? ' selected="selected"' : '';
			$lang_select .= '<option value="' . $filename . '"' . $selected . '>' . ucwords($displayname) . '</option>';
		}
		$lang_select .= '</select>';
		return $lang_select;
	}
Example #2
0
define('IN_INSTALL', true);
define('IN_ICYPHOENIX', true);
// Uncomment the following line to completely disable the ftp option...
//define('NO_FTP', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './../');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
//define('THIS_PATH', '_install/');
$this_path = dirname(__FILE__);
$path_dirs = explode(DIRECTORY_SEPARATOR, $this_path);
define('THIS_PATH', $path_dirs[sizeof($path_dirs) - 1]);
define('THIS_FILE', 'install.' . PHP_EXT);
//define('THIS_FILE', basename(__FILE__));
require('includes/functions_install.' . PHP_EXT);
require('schemas/versions.' . PHP_EXT);
$ip_functions = new ip_functions();
$ip_sql = new ip_sql();

if (!isset($_POST['install_step']))
{
	// Open config.php... if it exists
	if (@file_exists(@$ip_functions->ip_realpath(IP_ROOT_PATH . 'config.' . PHP_EXT)))
	{
		include(IP_ROOT_PATH . 'config.' . PHP_EXT);
	}

	// Check if Icy Phoenix or phpBB are already installed
	if (defined('IP_INSTALLED') || defined('PHPBB_INSTALLED'))
	{
		if (defined('BYPASS_SESSION'))
		{