Wie Arbeite ich mit der Sprachdatei?
Verfasst: 08.02.2008 15:12
Hallo zusammen,
ich bin dabei mir einen Kleinen MOD zu bauen. Leider weiß ich nicht genau wie ich mit der Sprachdatei Arbeiten muß.
Ich habe jetzt eine Englische und eine Deutsche Sprachdatei.
Mit dem Code:
Nun möchte ich den befehlt TS_ERROR gern in meinem MOD anfragen. Nun weiß ich aber nicht genau wie ich meine Andere Skripte ändern muß, damit mir der Text an der richtigen stelle angezeigt wird.
hier mal meine Template Datei:
An der stelle wo jetzt folgendes steht: "Zugriffsrechte fehlen!<br>You cant access this Page!" möchte ich gern den Inhalt aus der Sprachdatei geladen haben. Wie kann ich das jetzt machen?
Hier ist auch noch einmal meine Hauptdatei:
Es wäre super klasse wenn mir jemand helfen könnte. Ist warscheinlich einfacher als ich denke, aber leider bin ich neu auf dem gebiet, und bin da auf Eure hilfe angewiesen.
Besten Dank!
ich bin dabei mir einen Kleinen MOD zu bauen. Leider weiß ich nicht genau wie ich mit der Sprachdatei Arbeiten muß.
Ich habe jetzt eine Englische und eine Deutsche Sprachdatei.
Mit dem Code:
Code: Alles auswählen
$lang = array_merge($lang, array(
'MY_TITLE' => 'TS-Viewer',
'TS_ERROR' => 'You cant access this Page!',
));
hier mal meine Template Datei:
Code: Alles auswählen
<!-- INCLUDE overall_header.html -->
<center>
<table width="100%">
<tr> <br><br><br><br>
<td width="150" valign="top">
<!-- INCLUDE ../../../linksleft.php -->
</td>
<td>
<!-- IF S_IN_GROUP -->
<center>
<table class="tsbg" cellspacing="0" width="215">
<caption><div class="cap-left"><div class="cap-right"> <h4>TS-Viewer</a></h4> </div></div></caption>
<tr>
<td align="left">
<iframe src="../../../tsv/ts.php" height="600" width="215"></iframe>
</td>
</tr>
</table>
</center>
<!-- ELSE -->
<center><table class="tsbg" cellspacing="0" width="400">
<caption><div class="cap-left"><div class="cap-right"> <h4>Interner Bereich</a></h4> </div></div></caption>
<tr><td align="center"><div class="tsnoaccess"><br>Zugriffsrechte fehlen!<br>You cant access this Page!<br><br></div></td></tr></table></center>
<!-- ENDIF -->
</td>
</tr>
</table>
</center><br><br>
<!-- INCLUDE overall_footer.html -->
Hier ist auch noch einmal meine Hauptdatei:
Code: Alles auswählen
<?php
/**
*
* @author Original Author Username webmaster@fc-gilde.eu - http://www.fc-gilde.eu
* @author Another Author Username webmaster@fc-gilde.eu - http://www.fc-gilde.eu
*
* @package {PACKAGENAME}
* @version $Id$
* @copyright (c) 2007 Your Group Name
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
// Specify the path to you phpBB3 installation directory.
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
// The common.php file is required.
include($phpbb_root_path . 'common.' . $phpEx);
// since we are grabbing the user avatar, the function is inside the functions_display.php file since RC7
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
// specify styles and/or localisation
// in this example, we specify that we will be using the file: my_language_file.php
$user->setup('mods/tsv_lang');
// Page title, this language variable should be defined in the language file you setup at the top of this page.
page_header($user->lang['MY_TITLE']);
// Set the filename of the template you want to use for this file.
// This is the name of our template file located in /styles/<style>/templates/.
$template->set_filenames(array(
'body' => 'tsv_temp.html',
));
// Die zu prüfenden Gruppen IDs müssen mit Komma getrennt eingetragen werden
$check_group = '4,5,7,8';
$is_in_group = get_group_auth($check_group);
// Wenn der User in dieser Gruppe ist, liefert die Funktion den Wert TRUE zurück.
if ($is_in_group == true)
{
// Teile dem Template System mit, das die Variable "S_IN_GROUP" den Wert TRUE bekommt
$template->assign_var('S_IN_GROUP', true);
}
// Completing the script and displaying the page.
page_footer();
?>
Besten Dank!