View Full Version : Rejected ¿How to configure a editor button for product bbcodes?

16-07-11, 14:53
I live in a bilingual region wich shares spanish and catalan as languages.

Spanish is set as default forum language, but many users can contextually change from spanish to catalan depending on wich thread/forums are visiting.

Many users would profit of a post editor button that would just insert catalan product bbcodes in desired messages.


I have tried to agregate this button by hand but text is only inserted in message (bbcodes) and not executed as product command.

Is there a simple solution for this?

<a href="http://img220.imageshack.us/img220/1208/editorm.jpg" target="_blank">http://img220.imageshack.us/img220/1208/editorm.jpg</a>

18-07-11, 12:15
There are possible simple solutions to the issue you have:
1. Turn on automatic language detection (vBET options in Admin CP) - users will just write messages and vBET will opaque it in lang BBCode automatically
2. Force users to set their default language (also option in vBET) - when user has set his default language other that forum language then vBET automatically add to editor BBCode option (not like button, but like radio button - wrap into language or not) - you can see how it works even on our forum - just set your default language to other than English (use User CP).

Please tell do you need more help? :)

24-07-11, 21:17
No answer - considered solved. If not please write here :)

08-08-11, 22:17
Thanks for replying.

None of those solutions adapt 100% to my needs though.

I wouldn't like to force my users to choose language in profile, as most of them change writing language among threads or topics.

Moreover, google auto language detect doesn't fit either. It only applies to posts tagged as [lang] and with most of users without profile language assigned, this way is not functional.

I have another relevant issue, wich is that once language is selected in profile it can be reverted to "not selected". I insist my users do not have a fixed language use or profile (it is a real bilingual context) and after testing configuration they see a fixed asignation that they can revert. We'd need a fix for that.

My suggestion of language tag button on editor is more flexible and offers functionlity more "on demand" to users from my point of view.

You should also be aware that adding secondary usergroups the way your product does affects very commonly usergroup albums configuration. "0" default for albums image size means unlimited size and overides any other posible usergroup album preset. It is part of vBulletin usergroup mechanics, but it would be best to create new language usergroups with some fixed no infinite size album permission.

Thanks for your support.

09-08-11, 18:04
Google auto detect works only for messages which are NOT tagged as [ lang] (there is no need to check if it is already set). It is implemented to set [ lang] for the user message automatically and it works for all users no matter do they have set their default language or not. You misunderstood how it works. If you think it works wrong no your forum - please open new thread for new issue.

Please open new threads for your new issues - this will allow us to mange your issues separately and keep clean issue history. We are not able to manage many issues in one thread. So please open new threads for usergroup issue and auto detect if you think is working wrong on your forum.

Please note that adding button for language BBCode has some issues. Do you really want to force your user each time to click the button and select one of 53 languages, finding it first of course on such long list. Please note that actual solution do not supper such issue. And it is done in purpose to avoid such issue. Also such "on demand" functionality has no purpose at all. Who will write his messages in different languages? Each message in different language and each time select in which message it is?... Ever if someone want it is better to use auto detection for this than force user to select it himself.

You do not want to force you user to set default language, but want to force him to do this each time he writes message?... Also you do not have to force your user to set default language - please use automatic language detection. It is designed for such cases and it is working OK. You misunderstood how it works.

User default language is not default vBulletin language use. It has no influence on anything but editors. Why you want to unset it?

11-08-11, 22:08
I don't need buttons for 53 languages, just for one non implicit one.
And I wouldn't force user to anything. In worst case I could myself edit and add tags with one simple click, now unaffordable.

I'll open thread on automatic translation issue as indeed it is not working ok in my forum.

13-08-11, 02:02
So if you want it just for one language then please note that vBET automatically adds something like that. If user has chosen his default language and it is other that forum default language, then vBET will add to each editor option which will allow to automatically opaque user message in lang BBCode. It is not button but radio button - allowing to turn on (it is set by default) or turn it off. You can see how it works on our forum by setting your default language to other than English.

When it is used then editor sends additional data to server. It is parameter named vbet_postInLanguage and it's value is language code which should be included in lang BBCode. So if you want to set your own button then you can send by editor form this data when button is set, or you can define button with client side logic (Java Script) which will wrap/unwrap in editor when button is set/unset. It seems to be simper to just set/unset value for hidden vbet_postInLanguage field (which you can add with your button).
It will not require any Java Scripts at all if your button will be checkbox field (instead of hidden one which value is set by button). This seems to be the easiest way - vBET when gets this parameter set will take care about wrapping message in lang BBCode on server side

I will go to your new threads to support your other issues. Do you need any more support with this one?

15-08-11, 11:54
Thanks for your support. I can't see the radio button language choice in my 3.7.3 version forum.I'll try to activate it.We deal anyway a complex situation. Most bilingual users wouldn't like to see any post translated among both well known languages.But we need to mark in some way catalan posts to offer translations to some only spanish speakers users.In conjuction with automatic detection, we'd benefit for an option of "zero" flag that would avoid any translltion to user.That way both catalan and spanish posts would appear in original versions, and only foreigner and non bilingual readers would require translation activation of the forum.I apreciate your product and I think is a great job. I admit our needs are pretty peculiar but we want users to be really comfortable with language configuration of the site.

15-08-11, 11:56
I see line feeds are lost when editing posts in this forum.

18-08-11, 11:53
If you want to have 0 flag then please use notranslate BBCode :) it will not be translated AT ALL - it means not to any language. Please consider is it what you really want - if you support also other languages (not only those 2) then much messages will be not translated at all.

This is example of notranslate BBCode usage: This will not be translated at all

Also translation for bilingual users shouldn’t be a problem - you have included original message.

If you wan for example messages in Catalan not translated on language X (but for others translated) then you will have to:
1. have those messages marked as Catalan
2. modify vBET code for BBCode handling by adding condition which will return original text for this translation pair.

18-08-11, 12:42
I'll detail a definition of the coding modification I need and I'd like to budget you for that.

It is not only avoiding translation among 2 laguages: It consists on a new viewing configuration available (don't translate spanish&catalan) as implicit mode for forum.

It should be complemented by a way to mark current catalan posts in some automated way (google batched query¿?) before autodetection is reactivated.

18-08-11, 13:44
I admit Java-original-version viewing mode is quite suitable for our bilingual context.

I hadn't tested it untill now as I though it was only intended for SEO performance.

19-08-11, 07:57
I see 2 posts before you are asking for help, but in last one you wrote that actual solution is suitable. So assuming - do you need any more help here or it is already OK? Id you do - what do you need?

19-08-11, 13:41
Related to the topic of this thread, I still think a button in editor to automate bbcodes insertion by staff members would be great.

As for my concrete forum, I'll detail my needs as a project in another thread.

21-08-11, 15:41
So can we consider this one closed, or still some help here needed? :)

21-08-11, 22:39
There are possible simple solutions to the issue you have:
1. Turn on automatic language detection (vBET options in Admin CP) - users will just write messages and vBET will opaque it in lang BBCode automatically
2. Force users to set their default language (also option in vBET) - when user has set his default language other that forum language then vBET automatically add to editor BBCode option (not like button, but like radio button - wrap into language or not) - you can see how it works even on our forum - just set your default language to other than English (use User CP).

Both options are not ideal for my need.
I'd need as a staff member to have a way to alter message language wrapping at just one click.

Maybe this is not troubleshooting, I admit. You can move to features proposals if you agree.

22-08-11, 12:53
OK, but what for do you need this? I need to find out what is really needed. You already opened other feature request to create simple tool which will wrap all already created messages appropriately in lang BBCode. So if you will have this one then all old messages will be wrapped. Also if automatic language detection is turned on, all new incoming messages will be wrapped appropriately (with exceptions where Google will not recognize the language). So in such case what for this button? Please give us full scenario how you think it will be working. I understand you want to have button, but I really do not understand the need and I'm not sure is it already covered by your other feature request. Especially that you wrote now that this button is for staff member so as I understand now it is for correcting messages which are not wrapped in lang BBCode appropriately. Please correct me if I understand it wrong.

22-08-11, 13:06
Even with autodetection enabled, I'd like to provide users a simple way to indicate they are writting in catalan as they write in both spanish and catalan in the forum.

If autodetection works 100% is not a must, but I think is a very simple request and is more versatile for bilinguals than the radio button selector: bbcode/no bbcode

22-08-11, 13:42
OK so. I was lost, because in previous message I saw that it is for staff members not for all members. So I wasn't sure what for it should really exist.

Now I understand (sorry if you wrote it before and had to repeat it).

Your request it too unique for your particular forum to be included in official release. So we do not plan to include it in vBET. Especially that with auto detection enabled it is really not needed and as said Albert Einstein "things should be as simple as possible, but not simpler". We think that giving such button will only confuse users who will think that they must to click it in case of writing in Catalan. And this lowers usability of forum. Simpler solutions - like just write what you want and let the system care about the rest - are better for users in our opinion.

But we can help you to add such button.
As I wrote already it will be easy if you use already existing functionality and just change the appearance of it. So vBET already knows how to wrap in lang BBCode, according to additional input from editor. All you really need is to change the look of it (we have radio button, you want just button) and include it always (we include in particular condition).
So - you already know how to add the button as shows image include in first post. What you also need is to:
1. include hidden field:

<input id="vbet_addbbcodes" type="hidden" name="vbet_postInLanguage" value="0">
2. Include simple Java Script which will set there catalan code (not tested):

<script language="javascript">
function vbet_setCatalan(){
document.getElementById("vbet_addbbcodes").setAttribute("value", "ca");
return false;
Please note that you can made it more complex to allow set/unset the button
3. Execute the Java Script function when button is clicked. So in your button add:

If you do not want to make more complex function (which will be able also to unset value) then you can just set function body in onClick attribute and do not include java script as function at all.
Also please note that if you want it to be user friendly you suppose to add this button as toggle button so user will know is it already turned on or not. This would be all much simpler if you would like to add there checkbox instead of button, but with button it is also possible to make it, just more complex if you want to make it right (so setting and unsetting)

Please note that the change will be visible after user commits message – so it will be used on server side.

If you want it to work on browser side, then you do not need 1st step – just Java Script function (attached to button), which will take by id (or by structure if you cannot predict editor id) editor text area and add to content opening and closing lang BBCode. In such case you also do not have to worry about any toggle button (user will just see that it is already added in editor). Just you should check it is already wrapped (does text start by lang BBCode) and ignore button click in such case (to avoid wrapping several times).

Please tell do you need more help here. If yes – please tell where particularly.

23-08-11, 23:55

Very detailed and well explained, thanks.

24-08-11, 21:54
thanks for your reply:) i will mark this thread as solved

AfrikaansAlbanianArabicBelarusianBulgarianCatalanChineseCroatianCzechDanishDutchEnglishEstonianFilipinoFinnishFrenchGalicianGermanGreekHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKoreanLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishTaiwaneseThaiTurkishUkrainianVietnameseWelshYiddish
Languages translations made by vBET 4.9.99