Ver código fonte

Merge pull request #96 from Adjokip/master

Panel Language Fix
OwN-3m-All 9 anos atrás
pai
commit
49ab96b64f
2 arquivos alterados com 10 adições e 8 exclusões
  1. 5 4
      home.php
  2. 5 4
      index.php

+ 5 - 4
home.php

@@ -35,17 +35,17 @@ define("IMAGES", "images/");
 define("INCLUDES", "includes/");
 define("MODULES", "modules/");
 
-// Load languages.
-include_once("includes/lang.php");
-ogpLang();
-
 define("CONFIG_FILE","includes/config.inc.php");
 
 require_once CONFIG_FILE;
 // Connect to the database server and select database.
 $db = createDatabaseConnection($db_type, $db_host, $db_user, $db_pass, $db_name, $table_prefix);
 
+// Load languages.
+include_once("includes/lang.php");
+
 if (!$db instanceof OGPDatabase) {
+	ogpLang();
 	die(get_lang('no_db_connection'));
 }
 
@@ -56,6 +56,7 @@ if(hasValue($_SESSION['user_id'])){
 
 $settings = $db->getSettings();
 @$GLOBALS['panel_language'] = $settings['panel_language'];
+ogpLang();
 
 require_once("includes/view.php");
 $view = new OGPView();

+ 5 - 4
index.php

@@ -36,10 +36,6 @@ require_once("includes/functions.php");
 require_once("includes/helpers.php");
 require_once("includes/html_functions.php");
 
-// Load languages.
-include_once("includes/lang.php");
-ogpLang();
-
 // Start the session valid for opengamepanel_web only
 startSession();
 
@@ -62,7 +58,11 @@ require_once CONFIG_FILE;
 // Connect to the database server and select database.
 $db = createDatabaseConnection($db_type, $db_host, $db_user, $db_pass, $db_name, $table_prefix);
 
+// Load languages.
+include_once("includes/lang.php");
+
 if (!$db instanceof OGPDatabase) {
+	ogpLang();
 	die(get_lang('no_db_connection'));
 }
 
@@ -73,6 +73,7 @@ if(hasValue($_SESSION['user_id'])){
 
 $settings = $db->getSettings();
 @$GLOBALS['panel_language'] = $settings['panel_language'];
+ogpLang();
 
 require_once("includes/view.php");
 $view = new OGPView();