mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-22 02:47:27 +08:00
add_staffpanel_lang
This commit is contained in:
+3
-2
@@ -3,14 +3,14 @@ if(!defined('IN_TRACKER')) {
|
||||
die('Hacking attempt!');
|
||||
}
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('display_errors', 1);
|
||||
if (!empty($_SERVER['HTTP_X_REQUEST_ID'])) {
|
||||
define('REQUEST_ID', $_SERVER['HTTP_X_REQUEST_ID']);
|
||||
} else {
|
||||
define('REQUEST_ID', intval(NEXUS_START * 10000));
|
||||
}
|
||||
define('ROOT_PATH', $rootpath);
|
||||
define('VERSION', '1.6.0');
|
||||
define('VERSION_NUMBER', '1.6.0');
|
||||
define('IS_ANNOUNCE', (basename($_SERVER['SCRIPT_FILENAME']) == 'announce.php'));
|
||||
|
||||
require $rootpath . 'include/database/interface_db.php';
|
||||
@@ -28,6 +28,7 @@ if (!IS_ANNOUNCE) {
|
||||
$Cache = new RedisCache(); //Load the caching class
|
||||
$Cache->setLanguageFolderArray(get_langfolder_list());
|
||||
define('TIMENOW', time());
|
||||
define('TIMENOW_STRING', date('Y-m-d H:i:s'));
|
||||
$USERUPDATESET = array();
|
||||
$query_name=array();
|
||||
|
||||
|
||||
@@ -119,8 +119,16 @@ class DB
|
||||
return $this->isConnected;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static function insert($table, $data)
|
||||
{
|
||||
if (empty($table) || empty($data) || !is_array($data)) {
|
||||
throw new DatabaseException("require table and data(array).");
|
||||
}
|
||||
$fields = array_map(function ($value) {return "`$value`";}, array_keys($data));
|
||||
$values = array_map(function ($value) {return sqlesc($value);}, array_values($data));
|
||||
$sql = sprintf("insert into `%s` (%s) values (%s)", $table, implode(', ', $fields), implode(', ', $values));
|
||||
sql_query($sql);
|
||||
return mysql_insert_id();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2691,10 +2691,14 @@ function get_protocol_prefix()
|
||||
}
|
||||
}
|
||||
|
||||
function get_langid_from_langcookie()
|
||||
function get_langid_from_langcookie($lang = '')
|
||||
{
|
||||
global $CURLANGDIR;
|
||||
$row = mysql_fetch_array(sql_query("SELECT id FROM language WHERE site_lang = 1 AND site_lang_folder = " . sqlesc($CURLANGDIR) . "ORDER BY id ASC")) or sqlerr(__FILE__, __LINE__);
|
||||
if (empty($lang)) {
|
||||
global $CURLANGDIR;
|
||||
$lang = $CURLANGDIR;
|
||||
}
|
||||
|
||||
$row = mysql_fetch_array(sql_query("SELECT id FROM language WHERE site_lang = 1 AND site_lang_folder = " . sqlesc($lang) . "ORDER BY id ASC")) or sqlerr(__FILE__, __LINE__);
|
||||
return $row['id'];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user