diff -r c75ad574b56d -r 8a00247d1dee includes/common.php --- a/includes/common.php Sat Oct 27 13:54:44 2007 -0400 +++ b/includes/common.php Sun Oct 28 14:32:13 2007 -0400 @@ -104,6 +104,7 @@ // In addition, $enano_config is used to fetch config information if die_semicritical() is called. global $email; +global $lang; if(!isset($_SERVER['HTTP_HOST'])) grinding_halt('Cannot get hostname', '
Your web browser did not provide the HTTP Host: field. This site requires a modern browser that supports the HTTP 1.1 standard.
'); @@ -188,6 +189,27 @@ } } +// Is there no default language? +if ( getConfig('lang_default') === false ) +{ + $q = $db->sql_query('SELECT lang_id FROM '.table_prefix.'language LIMIT 1;'); + if ( !$q ) + $db->_die('common.php - setting default language'); + if ( $db->numrows() < 1 && !defined('ENANO_ALLOW_LOAD_NOLANG') ) + { + grinding_halt('No languages', 'There are no languages installed on this site.
+If you are the website administrator, you may install a language by writing and executing a simple PHP script to install it:
++<?php +define("ENANO_ALLOW_LOAD_NOLANG", 1); +$_GET["title"] = "langinstall"; +require("includes/common.php"); +install_language("eng", "English", "English", ENANO_ROOT . "/language/english/enano.json");'); + } + $row = $db->fetchrow(); + setConfig('default_language', $row['lang_id']); +} + // Our list of tables included in Enano $system_table_list = Array( table_prefix.'categories',