Seite 2 von 3
- hochschieb -
Verfasst: 02.09.2004 10:05
von sw-student
Hallo Leute,
hat sich denn hier mittlerweile was getan? Wäre immer noch an so einem Mod interessiert.
SNap, könntest mal deines hier posten?
Danke, Gruß
~sw~
Verfasst: 03.09.2004 20:30
von saerdnaer
werf mal die suche an; das thema war vor ein paar wochen nochmal im gespräch
Danke!!!
Verfasst: 07.09.2004 14:54
von sw-student
Wuuunderbar
Dank Acids Code sind meine komplette Forentitel und Kategorien mitsamt Beschreibung nun zweisprachig vorhanden.
musste zwar fasst in allen php's eingefügt werden und war ziemlich zeitraubend. Aber nun läufts!
Danke vielmals!
Verfasst: 17.10.2004 23:00
von mgutt
hi,
hier die liste der dateien. ändern in:
modcp.php
posting.php
recent.php
search.php
viewforum.php
viewtopic.php
includes/functions.php
Bei Mods sind auch noch ein paar Dateien anzupassen.
Denkt dran das die "XXX"
komplett das darstellen was da vorher schon stand.
z.B. bei der posting.php stand da vorher:
daraus wird dann:
Code: Alles auswählen
'FORUM_NAME' => get_lang_name($forum_name, $board_config['default_lang']),
Verfasst: 20.10.2004 17:31
von mgutt
so ich bin soweit durch. man könnte nun noch die dateien im adminbereich auch umbennen, aber das verzichte ich erstmal drauf
jetzt aber ein Fehler.
Und zwar kann man bei mir die Sprache wählen:
http://www.maxrev.de/forum/index.php
Wir wählen Deutsch.
jetzt gehen wir z.B. in ein Forum:
http://www.maxrev.de/forum/viewforum.php?f=1
Dann gibt es unten rechts diese "Lustige Jumpbox". Aber da stehen alle Titel in Englisch drin... Warum? Will ich nicht

Verfasst: 21.10.2004 00:35
von Acid
Da müsste noch die make_jumpbox() Funktion in der functions.php entsprechend angepasst werden..
get_lang_name(blub)
Verfasst: 21.10.2004 20:46
von mgutt

kein problem
Code: Alles auswählen
function make_jumpbox($action, $match_forum_id = 0)
{
global $template, $userdata, $lang, $db, $nav_links, $phpEx, $SID;
// $is_auth = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata);
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f
WHERE f.cat_id = c.cat_id
GROUP BY c.cat_id, c.cat_title, c.cat_order
ORDER BY c.cat_order";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't obtain category list.", "", __LINE__, __FILE__, $sql);
}
$category_rows = array();
while ( $row = $db->sql_fetchrow($result) )
{
$category_rows[] = $row;
}
if ( $total_categories = count($category_rows) )
{
$sql = "SELECT *
FROM " . FORUMS_TABLE . "
ORDER BY cat_id, forum_order";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}
$boxstring = '<select name="' . POST_FORUM_URL . '" onchange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }"><option value="-1">' . $lang['Select_forum'] . '</option>';
$forum_rows = array();
while ( $row = $db->sql_fetchrow($result) )
{
$forum_rows[] = $row;
}
if ( $total_forums = count($forum_rows) )
{
for($i = 0; $i < $total_categories; $i++)
{
$boxstring_forums = '';
for($j = 0; $j < $total_forums; $j++)
{
if ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $forum_rows[$j]['auth_view'] <= AUTH_REG )
{
// if ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'] && $is_auth[$forum_rows[$j]['forum_id']]['auth_view'] )
// {
$selected = ( $forum_rows[$j]['forum_id'] == $match_forum_id ) ? 'selected="selected"' : '';
$boxstring_forums .= '<option value="' . $forum_rows[$j]['forum_id'] . '"' . $selected . '>' . get_lang_name($forum_rows[$j]['forum_name'], $board_config['default_lang']) . '</option>';
//
// Add an array to $nav_links for the Mozilla navigation bar.
// 'chapter' and 'forum' can create multiple items, therefore we are using a nested array.
//
$nav_links['chapter forum'][$forum_rows[$j]['forum_id']] = array (
'url' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_rows[$j]['forum_id']),
'title' => get_lang_name($forum_rows[$j]['forum_name'], $board_config['default_lang'])
);
}
}
if ( $boxstring_forums != '' )
{
$boxstring .= '<option value="-1"> </option>';
$boxstring .= '<option value="-1">' . $category_rows[$i]['cat_title'] . '</option>';
$boxstring .= '<option value="-1">----------------</option>';
$boxstring .= $boxstring_forums;
}
}
}
$boxstring .= '</select>';
}
else
{
$boxstring .= '<select name="' . POST_FORUM_URL . '" onchange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }"></select>';
}
// Let the jumpbox work again in sites having additional session id checks.
// if ( !empty($SID) )
// {
$boxstring .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';
// }
$template->set_filenames(array(
'jumpbox' => 'jumpbox.tpl')
);
$template->assign_vars(array(
'L_GO' => $lang['Go'],
'L_JUMP_TO' => $lang['Jump_to'],
'L_SELECT_FORUM' => $lang['Select_forum'],
'S_JUMPBOX_SELECT' => $boxstring,
'S_JUMPBOX_ACTION' => append_sid($action))
);
$template->assign_var_from_handle('JUMPBOX', 'jumpbox');
return;
}
die zeilen alle?
$forum_rows[$j]['cat_id']
Verfasst: 15.01.2005 20:54
von grizzlibaer
Hi,
ich hab den MOD
Alternative Description Language installiert. Läuft wunderbar. Ich würde jetzt gern noch die Kategorien 2 sprachig haben.
Könnte mir vielleicht einer genau erklären was ich da machen muß?
Hier stehen immer nur kleine Brocken die mich etwas verwirren

Und der Code von Acid ist ja nur fürs Forum ...
Danke Euch
gruß
grizzli
Verfasst: 17.01.2005 16:07
von grizzlibaer
*schieb*
wäre für eine Antwort wirklich sehr dankbar
Verfasst: 10.02.2005 12:30
von mgutt
Code: Alles auswählen
#################################################################
## I N S T A L L A T I O N
#################################################################
## Mod Title: Forum descriptions language Hack
## Mod Version: 1.0.0
## Author: Saerdnaer < saerdnaer@web.de >
## Description: This Hack allows you to set different forum
## descriptions for each language
## phpBB Version: Tested on 2.0.3 but this hack should also run on
## lower versions...
##
## Installation Level: easy
## Installation Time: 2 Minutes
## Files To Edit: 2
## /index.php
## /includes/functions.php
##
## Included Files: 0
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files
#################################################################
#
#-----[ OPEN ]------------------------------------------
#
/index.php
#
#-----[ FIND ]------------------------------------------
#
'FORUM_DESC' => $forum_data[$j]['forum_desc'],
#
#-----[ REPLACE WITH ]------------------------------------------
#
'FORUM_DESC' => get_lang_desc($forum_data[$j]['forum_desc'], $board_config['default_lang']), // EDITED BY
#
#-----[ OPEN ]------------------------------------------
#
/includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
function get_lang_desc($desc, $lang)
{
if ( empty($desc) )
{
return '';
}
if ( !strpos(' ' . $desc, '|') && !strpos(' ' . $desc, ':') )
{
return $desc;
}
$desc_array = explode('|', $desc);
$c_desc = count($desc_array);
for ( $i = 0; $i < $c_desc; $i++ )
{
$desc = $desc_array[$i];
$strlen = strlen($desc);
while ( substr($desc, $strlen - 1, 1) == "\\" )
{
$i++;
$desc = substr($desc, 0, $strlen - 1) . $desc_array[$i];
}
list($key, $value) = explode(':', $desc, 2);
if ( empty($value) )
{
$value = $key;
$key = 'else';
}
else
{
$key = strtolower(trim($key));
}
$desc_by_lang[$key] = $value;
}
if ( !isset($desc_by_lang[$lang]) )
{
if( isset($desc_by_lang['else']) )
{
$lang = 'else';
}
else if( isset($desc_by_lang['english']) )
{
$lang = 'english';
}
else
{
$lang = 0;
}
}
return $desc_by_lang[$lang];
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# Thats all. Have a lot fun.
#
# PS: Excuse me for my terrible english ;-)
# EoM
Code: Alles auswählen
#################################################################
## M A N U A L
#################################################################
## Mod Title: Forum descriptions language Hack
## Mod Version: 1.0.0
## Author: Saerdnaer < saerdnaer@web.de >
## Description: This Hack allows you to set different forum
## descriptions for each language
#################################################################
# Hi
#
# This is the manual file of the Forum descriptions language Hack.
# If you want to install it see install.txt
#
# Now to the manual:
#
# After you have installed this hack you can't see any changes in
# the first moment. This is normal. To set the different de-
# scriptons go into the admin panel and click in the 'Forum Admin'
# Group onto the 'Management' link. Select a forum of your choice
# and click on the 'Edit' link after its name. Now you can see the
# 'Edit forum' - form. You can set the different discriptons by
# editing the normal description how e.g. follow:
english: This is just a test descripton
|german: Das ist nur eine Test Beschreibung
# Before the the colon (:) stand the language name in the same spelling how
# the dirs in the language dir are named. After the colon comes the
# text for this language. Then follow a | to separate the next
# language block. You can insert any spaces or breaks between the
# seperator signs but if you would write a | sign in the text you
# must escape it with the backslash ( e.g. \| ) . To write a
# default text witch will be shown if a user has selected a language
# for who you didn't set a special description by leaveing the
# language and the colon away:
# e.g.:
english: This is just a test descripton
| german: Das ist nur eine Test Beschreibung
| This is the default descirption
# If you don't set set a default description the english description
# will be shown. And if you don't set an english description the
# first desription you set will be shown if no special description
# for the users language is set. If you don't understand it ask me by
# email... ( saerdnaer@web.de )
#
# sincerely
#
# Saerdnaer
#
# PS: Excuse me for my terrible english ;-)
# EoM ( End of Manual ;-) )
weiß jemand die stelle für den chmod? ist echt dringend. mein forum sieht sonst grausam aus
