Hope someone likes this new BBCode.
The purpose is writing the text of a post in several languages, i.e: Post news either in english and in spanish.
You can see how it works in my test site at www.rolanddeschain.net You can read the news section in spanish or english.
How it works.
Simple:
- [lang=spanish]Here text in spanish[/lang]
- [lang=italian]Here text in italian[/lang]
- And so on...
Installation.
Copy the attached files in your forum and add any other lang package you may need. (sorry only spanish and english provided)
Open includes/bbcode.php
Find
After Add
- 'lang' => array(
- 'nested' => false,
- 'inurl' => false,
- 'allow_empty' => false
- ),
Find
Afterr Add
- // LANG
- if ($tag ==='lang')
- {
- global $userdata;
- $bbcodelang = $item['params']['param'];
- include ($phpbb_root_path . 'language/lang_' . $bbcodelang .'/lang_other.' . $phpEx);
- $user_lang = $board_config['default_lang'];
- if($userdata['session_logged_in'])
- {
- $html = '<a href="' . $phpbb_root_path . 'profile.php?mode=editprofile&cpl_mode=board_settings"><img src="./language/lang_' . $bbcodelang . '/flag.png" alt="' . $bbcodelang . '"> ' . $lang['other_lang_reg'] . '</a><br />';
- }
- else
- {
- $html = '<a href="' . $phpbb_root_path . 'changelang.php?l=' . $bbcodelang . '"><img src="./language/lang_' . $bbcodelang . '/flag.png" alt="' . $bbcodelang . '"> '. $lang['other_lang'] . '</a><br />';
- }
- $start = '<img src="./language/lang_' . $user_lang . '/flag.png" alt="' . $user_lang . '"> ';
- if ($user_lang == $bbcodelang)
- {
- return array(
- 'valid' => true,
- 'start' => $start,
- 'end' => ''
- );
- }
- else
- {
- return array(
- 'valid' => true,
- 'html' => $html
- );
- }
- }
The sad thing is that you must have precompiled posts turned to off for the mod to work properly!!
Greetz!
Multilingual BBcode.zip | ||
Description: | Multilingual BBCode | Download |
Filename: | Multilingual BBcode.zip | |
Filesize: | 1.11 KB | |
Downloaded: | 257 Time(s) |