Sprachwechsler - Zwischen Sprachen umherschalten [BETA]
Bevor du anfängst erstelle ein Backup der Daten und der Datenbank
Datenbankänderungen
Als erstes müssen die Tabellen entsprechend umbenannt werden:
Code: Alles auswählen
RENAME TABLE `easyhp_menu` TO `easyhp_menu_de`;
Code: Alles auswählen
RENAME TABLE `easyhp_sites` TO `easyhp_sites_de` ;
Code: Alles auswählen
RENAME TABLE `easyhp_site_comments` TO `easyhp_site_comments_de`;
Code: Alles auswählen
RENAME TABLE `easyhp_site_news` TO `easyhp_site_news_de`;
Hier das Beispiel für en (Englisch):
Code: Alles auswählen
CREATE TABLE easyhp_menu_en (
`id` int(11) NOT NULL auto_increment,
`menu_order` int(10) unsigned NOT NULL default '0',
`site_id` int(10) unsigned NOT NULL default '0',
`title` varchar(55) collate latin1_general_ci NOT NULL default '',
`link` varchar(255) collate latin1_general_ci NOT NULL default '',
`ext` int(1) NOT NULL default '0',
`window` varchar(15) collate latin1_general_ci NOT NULL default '',
`level` char(1) collate latin1_general_ci NOT NULL default '0',
`isset` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1
Code: Alles auswählen
CREATE TABLE easyhp_sites_en (
`id` int(11) unsigned NOT NULL auto_increment,
`title` varchar(55) collate latin1_general_ci NOT NULL default '',
`text` mediumtext collate latin1_general_ci NOT NULL,
`date` varchar(255) collate latin1_general_ci NOT NULL default '',
`set_date` int(1) NOT NULL default '0',
`cat` varchar(255) collate latin1_general_ci NOT NULL default '',
`level` int(11) NOT NULL default '0',
`trash` int(1) NOT NULL,
`trash_date` varchar(255) collate latin1_general_ci NOT NULL,
`comments_on` int(11) NOT NULL default '0',
`news` int(1) NOT NULL default '0',
`newssite` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1
Code: Alles auswählen
CREATE TABLE easyhp_site_comments_en (
`id` int(11) NOT NULL auto_increment,
`site_id` int(11) NOT NULL,
`subject` varchar(55) collate latin1_general_ci NOT NULL,
`username` varchar(255) collate latin1_general_ci NOT NULL,
`date` varchar(255) collate latin1_general_ci NOT NULL,
`text` text collate latin1_general_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1
Code: Alles auswählen
CREATE TABLE easyhp_site_news_en (
`id` int(11) NOT NULL auto_increment,
`site_id` int(11) NOT NULL,
`title` varchar(255) collate latin1_general_ci NOT NULL,
`message` text collate latin1_general_ci NOT NULL,
`username` varchar(255) collate latin1_general_ci NOT NULL,
`date` varchar(255) collate latin1_general_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1
Code: Alles auswählen
$sprachen = array('de', 'en');
Code: Alles auswählen
$sprachenordner = array("german_formal", "english");
Datei-Änderungen
Kopiere die includes/sprache.php nach includes/sprache.php Öffne die includes/mysql.php
Finde :
Code: Alles auswählen
if (!defined("IN_EASYHP")) {
die();
}
Code: Alles auswählen
@include "includes/sprache.php";
@include "../includes/sprache.php";
Finde darin:
Code: Alles auswählen
@include "language/$config->default_language/main_language.php";
Code: Alles auswählen
@include "language/$sprach_ordner/main_language.php";
Öffne die Datei includes/constants.php.
Finde:
Code: Alles auswählen
//
// MySQL-Tables
//
Code: Alles auswählen
if (empty($sprache))
$sprache1 = "_de";
Code: Alles auswählen
define ("MENU_TABLE", $dbprefix . "_menu");
Code: Alles auswählen
define ("MENU_TABLE", $dbprefix . $sprache1 . "_sites");
Code: Alles auswählen
define ("SITES_TABLE", $dbprefix . "_menu");
Code: Alles auswählen
define ("SITES_TABLE", $dbprefix . $sprache1 . "_sites");
Code: Alles auswählen
define ("SITE_COMMENTS_TABLE", $dbprefix . "_site_comments");
Code: Alles auswählen
define ("SITE_COMMENTS_TABLE", $dbprefix.$sprache1 . "_site_comments");
Code: Alles auswählen
define ("NEWS_TABLE", $dbprefix . "_site_news");
Code: Alles auswählen
define ("NEWS_TABLE", $dbprefix . $sprache1 . "_site_news");
Sind aber nicht zwingend notwendig:
Öffne die admin/admin_configuration.php ...
Und finde:
Code: Alles auswählen
$query[save_settings] = "UPDATE " . CONFIG_TABLE . " SET domain_name = '$domain_name', website_name = '$website_name', website_title = '$website_title', path = '$path', default_style = '$default_style', default_language = '$default_language', footer_title = '$footer_title', disable = '$disable', logo_url = '$logo_url', email = '$email', frontpage = '$frontpage'";
Code: Alles auswählen
$query[save_settings] = "UPDATE " . CONFIG_TABLE . " SET domain_name = '$domain_name', website_name = '$website_name', website_title = '$website_title', path = '$path', default_style = '$default_style', footer_title = '$footer_title', disable = '$disable', logo_url = '$logo_url', email = '$email'";
Suche und lösche:
Code: Alles auswählen
<table width="100%">
<tr>
<td width="20%">{l_default_language}</td>
<td width="80%">
<select name="default_language">
{d_default_language}
</select>
</td>
</tr>
</table>
<table>
<tr>
<td><div class="desc">{desc_default_language}</div></td>
</tr>
</table>
Code: Alles auswählen
<table width="100%">
<tr>
<td width="20%">{l_frontpage}</td>
<td width="80%">
<select name="frontpage">
{d_frontpage}
</select>
</td>
</tr>
</table>
<table>
<tr>
<td><div class="desc">{desc_frontpage}</div></td>
</tr>
</table>