mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
Multi-language db-verify fix.
This commit is contained in:
@@ -9,9 +9,9 @@
|
|||||||
* Administration - DB Verify
|
* Administration - DB Verify
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_admin/db_verify.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_admin/db_verify.php,v $
|
||||||
* $Revision: 1.10 $
|
* $Revision: 1.11 $
|
||||||
* $Date: 2009-11-20 22:23:02 $
|
* $Date: 2009-11-23 00:52:27 $
|
||||||
* $Author: e107steved $
|
* $Author: e107coders $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
require_once("../class2.php");
|
require_once("../class2.php");
|
||||||
@@ -71,6 +71,8 @@ function read_tables($tab)
|
|||||||
{
|
{
|
||||||
global $tablines, $table_list, $tables, $pref;
|
global $tablines, $table_list, $tables, $pref;
|
||||||
|
|
||||||
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
$file = split("\n", $tables[$tab]);
|
$file = split("\n", $tables[$tab]);
|
||||||
foreach($file as $line)
|
foreach($file as $line)
|
||||||
{
|
{
|
||||||
@@ -104,6 +106,7 @@ function read_tables($tab)
|
|||||||
if($pref['multilanguage'])
|
if($pref['multilanguage'])
|
||||||
{
|
{
|
||||||
$langs = table_list();
|
$langs = table_list();
|
||||||
|
$mes->add(print_a($langs,TRUE), E_MESSAGE_DEBUG);
|
||||||
foreach(array_keys($table_list) as $name)
|
foreach(array_keys($table_list) as $name)
|
||||||
{
|
{
|
||||||
if($langs[$name])
|
if($langs[$name])
|
||||||
@@ -113,7 +116,14 @@ function read_tables($tab)
|
|||||||
$tablines[$ltab] = $tablines[$name];
|
$tablines[$ltab] = $tablines[$name];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$mes->add(print_a($table_list,TRUE), E_MESSAGE_DEBUG);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -675,24 +685,34 @@ function table_list()
|
|||||||
$exclude[] = "stat_info"; $exclude[] = "stat_last";
|
$exclude[] = "stat_info"; $exclude[] = "stat_last";
|
||||||
$exclude[] = "submit_news"; $exclude[] = "rate";
|
$exclude[] = "submit_news"; $exclude[] = "rate";
|
||||||
$exclude[] = "stat_counter";$exclude[] = "user_extended";
|
$exclude[] = "stat_counter";$exclude[] = "user_extended";
|
||||||
$exclude[] = "user_extended_struc";
|
$exclude[] = "user_extended_struct";
|
||||||
$exclude[] = "pm_messages";
|
$exclude[] = "pm_messages";
|
||||||
$exclude[] = "pm_blocks";
|
$exclude[] = "pm_blocks";
|
||||||
|
|
||||||
|
$replace = array();
|
||||||
|
|
||||||
|
$lanlist = explode(",",e_LANLIST);
|
||||||
|
foreach($lanlist as $lang)
|
||||||
|
{
|
||||||
|
if($lang != $pref['sitelanguage'])
|
||||||
|
{
|
||||||
|
$replace[] = "lan_".strtolower($lang)."_";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$tables = mysql_list_tables($mySQLdefaultdb);
|
$tables = mysql_list_tables($mySQLdefaultdb);
|
||||||
while (list($temp) = mysql_fetch_array($tables))
|
while (list($temp) = mysql_fetch_array($tables))
|
||||||
{
|
{
|
||||||
$prefix = MPREFIX."lan_";
|
$prefix = MPREFIX."lan_";
|
||||||
$match = array();
|
$match = array();
|
||||||
if(preg_match('/^'.$prefix.'(.*)/', $temp, $match))
|
if(strpos($temp,$prefix)!==FALSE)
|
||||||
{
|
{
|
||||||
$e107tab = str_replace(MPREFIX, "", $temp);
|
$e107tab = str_replace(MPREFIX, "", $temp);
|
||||||
$pos = strrpos($match[1],"_")+1;
|
$core = str_replace($replace,"",$e107tab);
|
||||||
$core = substr(str_replace("lan_","",$e107tab),$pos);
|
|
||||||
if (str_replace($exclude, "", $e107tab))
|
if (str_replace($exclude, "", $e107tab))
|
||||||
{
|
{
|
||||||
$tabs[$core] = $e107tab;
|
$tabs[$core] = $e107tab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
27
index.php
27
index.php
@@ -9,8 +9,8 @@
|
|||||||
* News frontend
|
* News frontend
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/index.php,v $
|
* $Source: /cvs_backup/e107_0.8/index.php,v $
|
||||||
* $Revision: 1.8 $
|
* $Revision: 1.9 $
|
||||||
* $Date: 2009-11-18 01:04:24 $
|
* $Date: 2009-11-23 00:52:27 $
|
||||||
* $Author: e107coders $
|
* $Author: e107coders $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -38,20 +38,23 @@ if (isset($pref['frontpage']['all']) && $pref['frontpage']['all'])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // This is the 'new' method - assumes $pref['frontpage'] is an ordered list of rules
|
{ // This is the 'new' method - assumes $pref['frontpage'] is an ordered list of rules
|
||||||
foreach ($pref['frontpage'] as $fk=>$fp)
|
if(vartrue($pref['frontpage']))
|
||||||
{
|
{
|
||||||
if (in_array($fk, $class_list))
|
foreach ($pref['frontpage'] as $fk=>$fp)
|
||||||
{
|
{
|
||||||
// Debateable whether we should append $query - we may be redirecting to a custom page, for example
|
if (in_array($fk, $class_list))
|
||||||
if (strpos($fp, '{') !== FALSE)
|
|
||||||
{
|
{
|
||||||
$location = $tp->replaceConstants($fp).$query;
|
// Debateable whether we should append $query - we may be redirecting to a custom page, for example
|
||||||
|
if (strpos($fp, '{') !== FALSE)
|
||||||
|
{
|
||||||
|
$location = $tp->replaceConstants($fp).$query;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$location = ((strpos($fp, 'http') === FALSE) ? e_BASE : '').$fp.$query;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$location = ((strpos($fp, 'http') === FALSE) ? e_BASE : '').$fp.$query;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user