The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
languageid question
Is there a variable to check for the language id or name in php?
|
#2
|
|||
|
|||
Try $languageid and I also think its stored in the user's cookie, but I'm not sure off the top of my head.
|
#3
|
||||
|
||||
Here's what I have now and it doesn't seem to be working:
Code:
if ($vbulletin->options['languageid'] == 1) I want to check for whatever the user is using from the language dropdown in the footer, if possible. |
#4
|
|||
|
|||
Have you tried $vbulletin->userinfo['languageid'] ?
|
#5
|
||||
|
||||
Bingo! It worked! Thank you, sir!
I tried $bbuserinfo['languageid'] earlier and it wouldn't t take. Is id1 ALWAYS English then? It seems that the 2 languages I am testing this one are id1 for English and id3 for Italian. But on the user's other site he has id4 for Italian. |
#6
|
|||
|
|||
$vbulletin->userinfo['languageid'] only get the languageid which the users selected in their usercp.
If the users change the language via Quick Chooser, it will not be displayed. |
#7
|
||||
|
||||
Sorry, you are wrong on that as i just tested it and it changed according to what was selected in the language drop-down.
|
#8
|
|||
|
|||
Yes, I think you can assume ID: 1 is always English, but even that may not be correct, as licenses provided in other languages may have their language as default.
Point is, since languages are imported by the forum owner, you can't assume that any ID equals a specific language, you'd have to compare the actual title. |
#9
|
||||
|
||||
So, then use this?
Code:
if ($vbulletin->userinfo['languageid'] == 'English (US)') { setlocale(LC_TIME, 'en_US.utf8'); } else { setlocale(LC_TIME, $vbulletin->options['site_lifestatus_setlocale']); } That doesn't work for the name. |
#10
|
|||
|
|||
No, you'll probably have to fetch the language title in the query dynamically with a hook; I don't have time right now to take a good look at it, but the query is in fetch_userinfo() function in functions.php
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|