Log in

View Full Version : How to check Language


Sergio68
10-20-2006, 11:41 AM
I'd like to built something to check the language an user is using on the forum and show some image related to it.

Something like :

<IF $lang="ENG" >
<img="a1.gif>
</IF>

<IF $lang="ITA" >
<img="b2.gif>
</IF>


Can you tell me the variable name please ?

Anybody ?

rahimt
09-09-2007, 09:42 AM
I am interested in an answer as well. Is there such a variable for a conditional?
Many thanks in advance!

Paul M
09-09-2007, 09:53 AM
In templates it's $bbuserinfo['languageid']

In plugins, $vbulletin->userinfo['languageid']

Sergio68
09-09-2007, 04:48 PM
Wow, thanks Paul :D

jerx
10-27-2008, 05:12 AM
Thank you!

I needed this to link to an external script. I used this:
<a href="$vboptions[bburl]/externalscript/index.php?lang=
<if condition="$bbuserinfo['languageid'] == 1">
language1
<else />
language2
</if>
">$vbphrase[script]</a>

Here is all you need to know of template conditionals:
http://www.vbulletin.com/docs/html/template_conditionals