Hi
In private_message module
Why the help of bbcode is English? :gruebel:
modules.php?name=Private_Messages&file=bbcode (file= Private_Messages/bbcode.php)
Brief: I translated this file in French.
So that this help is multilanges, rename the file exists by english_bbcode.php
Into module dir, add my joined file french_bbcode.php, add a german_bbcode.php file, translate it from English for example or you can find it here : http://de.wikipedia.org/wiki/BBCode
And make this changes in index file:
Line :547
global $currentlang;
if (!MX_IS_USER) {
header("Location: modules.php?name=Your_Account&op=login");
exit;
} else {
$module_name = basename(dirname(__FILE__));
// Link verwendet in Sprachdateien
if (!defined("_PMSBBCODELINK")) define("_PMSBBCODELINK", "<a href=\"#\" onClick=\"window.open('modules.php?name=" . $module_name . "&file=" . $currentlang ."_bbcode','pmbbcode','left=10, top=10, width=640,height=480,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0'); return false;\">");
Hallo
Dieselbe Sache mit nbcode in gustbook modul.
EN:
in modules/Guestbook/include/lib.inc.php
line 33
global $module_name, $NB_setting, $currentlang;
line 123
<a href="javascript:openCentered(\'modules/' . $module_name . '/codes/' . $currentlang . '_codes.html\',\'codes\',\'640\',\'450\',\'scrollbars=yes\')">' . _NBSHOWLEGEND . '</a>
don't forget to create ( german_codes.html, english_codes.html, french_code.html.....)
that's all.
Danke
Hi :)
thanks for your great work :thumbup:
I've implement this in the pragmaMx CVS files.
By using only the include over the $currentlang variable, there is no fallback for missing languages.
Here is the new code for modules/Private_Messages/bbcode.php:
<?php
if (!defined('mxMainFileLoaded')) die ('You can\'t access this file directly...');
$module_name = basename(dirname(__FILE__));
include_once('modules/' . $module_name . '/config.php');
include_once('modules/' . $module_name . '/functions.php');
$themesel = mxgettheme();
require_once('themes/' . $themesel . '/theme.php');
if (@file_exists('modules/' . $module_name . '/language/bbcode-' . $currentlang . '.php')) {
include_once('modules/' . $module_name . '/language/bbcode-' . $currentlang . '.php');
} else {
include_once('modules/' . $module_name . '/language/bbcode-english.php');
}
?>
The different bbcode language files are included dynamicly with fallback to english....
And nearly the same in the guestbook files...
<?php
if (!defined('mxMainFileLoaded')) die ('You can\'t access this file directly...');
$module_name = basename(dirname(__FILE__));
ob_start();
if (@file_exists('modules/' . $module_name . '/codes/bbcode-' . $currentlang . '.html')) {
include_once('modules/' . $module_name . '/codes/bbcode-' . $currentlang . '.html');
} else {
include_once('modules/' . $module_name . '/codes/bbcode-english.html');
}
$x = ob_get_clean();
// Smiliepfade korrigieren
$x = preg_replace('#(<img[^>]*src=")../images/([^>/]+.gif"[^>]*>)#i', '\1modules/' . $module_name . '/images/\2', $x);
echo $x;
?>
The new line 123 is this code:
<a href="javascript:openCentered(\'modules.php?name=' . $module_name . '&file=bbcode\',\'codes\',\'640\',\'450\',\'scrollbars=yes\')">' . _NBSHOWLEGEND . '</a>
The new files are comming with the next servicepack... ;)
@Andi
HI
I'm not understand one thing.
ZitatHere is the new code for modules/Private_Messages/bbcode.php:
:puzzled:
you mean bbcode.php or index.php ?
thank.
Hi :)
Zitatyou mean bbcode.php or index.php ?
yes, i mean bbcode.php ;)
I've moved the "old" bbcode.php and your new french_bbcode.php in the language folder and renamed them to bbcode-XXX.php. The "new" bbcode.php in the module folder includes one of them dependent on the adjusted language.
HI
now I understand . :red:
but there are a small problem:
These lines, already exist in bbcode- english ( and in other bbcode-language when they are created ).
include_once('modules/' . $module_name . '/config.php');
include_once('modules/' . $module_name . '/functions.php');
$themesel = mxgettheme();
require_once('themes/' . $themesel . '/theme.php');
+ two other related lines (for page title) :
echo "<html><head><title>bbCode, $sitename</title>\n";
echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n";
from line 29 to 36
I think that these lines should be removed & move lines 35-36 to bbcode.php and rename $ThemeSel to $themesel in line 36 :gruebel:
when I activated the debug-mode I got this message
Warning: include_once(modules/language/config.php) [function.include-once]: failed to open stream: No such file or directory in I:\AppServ\xampp\htdocs\mx_ar\modules\Private_Messages\language\bbcode-english.php on line 30
Warning: include_once() [function.include]: Failed opening 'modules/language/config.php' for inclusion (include_path='.;I:\AppServ\xampp\php\pear\') in I:\AppServ\xampp\htdocs\mx_ar\modules\Private_Messages\language\bbcode-english.php on line 30
Warning: include_once(modules/language/functions.php) [function.include-once]: failed to open stream: No such file or directory in I:\AppServ\xampp\htdocs\mx_ar\modules\Private_Messages\language\bbcode-english.php on line 31
Warning: include_once() [function.include]: Failed opening 'modules/language/functions.php' for inclusion (include_path='.;I:\AppServ\xampp\php\pear\') in I:\AppServ\xampp\htdocs\mx_ar\modules\Private_Messages\language\bbcode-english.php on line 31
one thing more:
normaly this ||||| modules/' . $module_name . '/config.php = modules/Private_Message/config.php
then what is this ?
modules/language/config.php
:puzzled:
Merci = thank you = danke = شكرا
Hi :)
yes, my code lines in this post are only previews ;)
There are more changes in the included files....
When it's ready, you can see it in servicepack 3, which will released in the next few days...