Back in the old days of YaBB 1 Gold SP1 (a mere week ago) my board was capable of using a different language pack based on the location of the user within the web site.
You see, my site is bilingual (Spanish/English) and I want to make it so as much as possible, including the message board. With YaBB 1 Gold I made a simple modification in YaBB.cgi that looked like this:
&LoadCookie; # Load the user's cookie (or set to guest)
if(defined $yyCookies{'YaBBLanguage'})
{
$language = $yyCookies{'YaBBLanguage'}.".lng";
}
require "$language";
This was inserted right before &LoadUserSettings close to the beginning of the script. Also in
Load.pl I commented out this line: require "$boarddir/$language";
How this worked? Well, the web site has a framed environment and the board runs within a frame. Whenever the user clicks on the link to go to the board, a pre-loader page is loaded first to handle some internal navigational issues, sets a non-persistent cookie called "YaBBLanguage" with the language stored in it and then calls the board. When the board loads, it looks for this cookie. If found then it will use the specified language pack. If not, then it will load whichever language is default from the board configuration. Works pretty cool.
The web site has the same content in both languages and at the home page there are links to select the language. From there the user goes to whatever page he/she wants to see in the selected language, including the message board.
The above code is in Perl. I am not very familiar with PHP but looking at the same places in index.php and Load.php I guessed that it worked the same way and inserted the same modification but it didn't work. It still loads the same language as before. The modified code is like this:
if(isset($HTTP_COOKIE_VARS['YaBBLanguage'])
{
$language = $HTTP_COOKIE_VARS'].lng";
}
include_once "$boarddir/$language";
This was inserted between the load user settings and banning sections of index.php. I also commented out the same line as before in Load.php.
Another variation I tried was this:
if(isset($yabbLang))
{
$language = "$yabbLang.lng";
}
include_once ("$boarddir/$language");
And added this line to the LoadCookie function in Load.php:
$yabbLang = $HTTP_COOKIE_VARS['YaBBLanguage'];
Didn't work either.
Suggestions?
My board is in
http://www.juanadiaz.org/foro/