Closed (fixed)
Project:
Drupal vB
Version:
5.x-2.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Aug 2008 at 10:16 UTC
Updated:
9 Jan 2009 at 10:21 UTC
Jump to comment: Most recent file
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);
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | drupalvb-DRUPAL-5--2.language.patch | 4.39 KB | sun |
Comments
Comment #1
Ashraf Sufian commentedSorry :)
This modification was on drupalvb.inc.php
Comment #2
sunThis should be fixed since 5.x-2.0-RC1. Which version do you have installed? (See CHANGELOG.txt if you are unsure)
Comment #3
sunCommitted attached patch, which fixes the language and timezone for new users created by DrupalvB.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #5
hodba commentedI 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
Comment #6
hodba commentedComment #7
sun@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.