BBCode Multilingual Site


Subject: BBCode Multilingual Site
Hile, neighbours and friends...

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:

Code: [Download] [Hide]
  1. [lang=spanish]Here text in spanish[/lang]  
  2.  
  3. [lang=italian]Here text in italian[/lang]  
  4.  
  5. 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
Code: [Download] [Hide]
  1. 'codeblock' => array(  
  2. 'nested' => false,  
  3. 'inurl' => false,  
  4. ),  
  5.  


After Add
Code: [Download] [Hide]
  1. 'lang' => array(  
  2. 'nested' => false,  
  3. 'inurl' => false,  
  4. 'allow_empty' => false  
  5. ),  
  6.  


Find
Code: [Download] [Hide]
  1. // MARQUEE 


Afterr Add
Code: [Download] [Hide]
  1. // LANG  
  2. if ($tag ==='lang')  
  3. {  
  4. global $userdata;  
  5. $bbcodelang = $item['params']['param'];  
  6. include ($phpbb_root_path . 'language/lang_' . $bbcodelang .'/lang_other.' . $phpEx);  
  7. $user_lang = $board_config['default_lang'];  
  8. if($userdata['session_logged_in'])  
  9. {  
  10. $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 />';  
  11. }  
  12. else  
  13. {  
  14. $html = '<a href="' . $phpbb_root_path . 'changelang.php?l=' . $bbcodelang . '"><img src="./language/lang_' . $bbcodelang . '/flag.png" alt="' . $bbcodelang . '"> '. $lang['other_lang'] . '</a><br />';  
  15.  
  16. }  
  17. $start = '<img src="./language/lang_' . $user_lang . '/flag.png" alt="' . $user_lang . '"> ';  
  18. if ($user_lang == $bbcodelang)  
  19. {  
  20. return array(  
  21. 'valid' => true,  
  22. 'start' => $start,  
  23. 'end' => ''  
  24. );  
  25. }  
  26. else  
  27. {  
  28. return array(  
  29. 'valid' => true,  
  30. 'html' => $html  
  31. );  
  32. }  


The sad thing is that you must have precompiled posts turned to off for the mod to work properly!!

Greetz!

Last edited by Xusqui on Sat 22 Mar, 2008 18:18; edited 1 time in total

Multilingual BBcode.zip
Description: Multilingual BBCode 
Download
Filename: Multilingual BBcode.zip
Filesize: 1.11 KB
Downloaded: 290 Time(s)

Subject: Re: BBCode Multilingual Site
nice addon! i'll give a try 8)

Subject: Re: BBCode Multilingual Site
Nice mod. :wink:

I will try it.

Subject: Re: BBCode Multilingual Site
Tested Xusqui (in test site) nice MOD for multilanguage sites :wink:

Subject: Re: BBCode Multilingual Site
Very nice addon!

Subject: Re: BBCode Multilingual Site
cool.. this is very nice...

i´ll have a look..

thanks =)

Subject: Re: BBCode Multilingual Site
Hile Xusqui amigo, sorry I'm not sure I understand this mod... I mean, if you want to post something in a different language, cini mi se da mogu pisati ovdje :mrgreen: I mean, I can just write what I want, right?...

(As your demo link does not currently take me to a working demo, I can't see it in action).

Or taking a guess, maybe what you mean to say is - you can write in several languages in one post, and by using these tags, only the text in the language chosen by the user / visitor is displayed? ;)

PS does this work in the CMS block templates? If so, and my guess is correct, then this is a great idea for anyone who wants to build a multi-lingual site, but doesn't want to have to hack the language files. And hence, if this is indeed the case, I salute you sir on these advances in multi-lingual website building, surely a must for the omnivorous reader... ;)

Profile PM  
Subject: Re: BBCode Multilingual Site
moreteavicar wrote: [View Post]
(As your demo link does not currently take me to a working demo, I can't see it in action).


please take a look to this post... http://www.ka-tet-corp.com/portal2.0/viewtopic.php?f=1&t=3603

moreteavicar wrote: [View Post]

Or taking a guess, maybe what you mean to say is - you can write in several languages in one post, and by using these tags, only the text in the language chosen by the user / visitor is displayed? ;)


I guess it works like this.

Subject: Re: BBCode Multilingual Site
Oh wow, you get a link to press... how cute ;)
I was thinking from the drop-down menu for choosing languages, but actually its quite nice seeing that link there...

Marvelous job indeed Xusqui!

Profile PM  
Subject: Re: BBCode Multilingual Site
Pues a mi simplemente no me funciona :oops:

He seguido todo al pie de la letra ... tal y como lo mencionan en el primer mensaje .. pero no logro obtener el resultado. No veo el iconito para poder usar este bbcode y al ponerlo manualmente; en vez de cambiar el lenguaje lo unico que pone es la opción de que uno cambie el lenguaje pero de todo el sitio-foro.

Bueno espero que nos ilustren un poco mas ... gracias. :cry:

Sorry for me typing in spanish ... but a see gays on this post and theys write in spanish on others forums ... so i´am wait for spanish assistance. Or same body give me one link for this MOD but on spanish instruction. :|

Subject: Re: BBCode Multilingual Site
Don_lobo wrote: [View Post]
Pues a mi simplemente no me funciona :oops:

He seguido todo al pie de la letra ... tal y como lo mencionan en el primer mensaje .. pero no logro obtener el resultado. No veo el iconito para poder usar este bbcode y al ponerlo manualmente; en vez de cambiar el lenguaje lo unico que pone es la opción de que uno cambie el lenguaje pero de todo el sitio-foro.

Bueno espero que nos ilustren un poco mas ... gracias. :cry:

Sorry for me typing in spanish ... but a see gays on this post and theys write in spanish on others forums ... so i´am wait for spanish assistance. Or same body give me one link for this MOD but on spanish instruction. :|
Sorry, to support icy in Spanish www.phpbb-es.com

@Perdona, para soporte en español en www.phpbb-es.com :roll:

Subject: Re: BBCode Multilingual Site
ok, I will check it out, thanks buddy! :mryellow:


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.8293s (PHP: 3% SQL: 97%)
SQL queries: 13 - Debug Off - GZIP Enabled