After i installed vbulletin and added a new language (Arabic language) and set it to be the default one, i discovered that if i register and then login the layout goes back to the English layout which is wrong. After searching here and there i noticed that the languageid is hard coded so every time it is set to 1 (English language).
What i did so that i added these lines of code:

// To change the languageid, $languageid=2 means Arabic language, $languageid=1 means English language.
$languageid = 2;
if(isset($_SESSION['language'])){
  if('en' == $_SESSION['language']){
    $languageid = 1;
  }
}

// Set up the insertion query.

Then i modified the query to be:

$result = drupalvb_db_query("INSERT INTO {user} (username, usergroupid, password, passworddate, usertitle, email, salt, showvbcode, languageid, timezoneoffset, posts, joindate, lastvisit, lastactivity, options) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', 1, %d, '%s', 0, '%s', '%s', '%s', '%s')", $edit['name'], $usergroupid, $passhash, $passdate, $usertitle, $edit['mail'], $salt, $languageid, $timezone, $joindate, time(), time(), $options);

instead of :

$result = drupalvb_db_query("INSERT INTO {user} (username, usergroupid, password, passworddate, usertitle, email, salt, showvbcode, languageid, timezoneoffset, posts, joindate, lastvisit, lastactivity, options) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', 1, 1, '%s', 0, '%s', '%s', '%s', '%s')", $edit['name'], $usergroupid, $passhash, $passdate, $usertitle, $edit['mail'], $salt, $timezone, $joindate, time(), time(), $options);
CommentFileSizeAuthor
#3 drupalvb-DRUPAL-5--2.language.patch4.39 KBsun

Comments

Ashraf Sufian’s picture

Sorry :)
This modification was on drupalvb.inc.php

sun’s picture

Status: Active » Postponed (maintainer needs more info)

This should be fixed since 5.x-2.0-RC1. Which version do you have installed? (See CHANGELOG.txt if you are unsure)

sun’s picture

Title: Language problem » Bad languageid and timezone set for users created by DrupalvB
Version: 6.x-2.x-dev » 5.x-2.1
Status: Postponed (maintainer needs more info) » Fixed
StatusFileSize
new4.39 KB

Committed attached patch, which fixes the language and timezone for new users created by DrupalvB.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

hodba’s picture

Priority: Normal » Critical

I have the same problem with the languages as the following:

- Drupal 6.8 Arabic interface, UTF-8 encoding
- VB 3.7.4 arabic interface, Windows 1256 encoding.
- drupal vb 6.x-2.0 module

please check and advice

hodba’s picture

Status: Closed (fixed) » Active
sun’s picture

Priority: Critical » Normal
Status: Active » Closed (fixed)

@hodba: Please open a new issue. This one has been fixed a long time ago. Also, if you do so, you will have to provide a lot of more information than you did here.