phpbb3 module

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by SpectralDart on August 13, 2007 at 6:08am
Start:
2007年01月12日 22:00 Etc/GMT

Some of you might have noticed that after following the instructions to merge drupal 5.2 and phpbb3 RC4 that you get a phpbb3_users INSERT that goes wrong. Here is a fix you'll need to introduce into your phpbb.module file :

 // Get the board language 
 // Insert a minimal user.
 $query = "INSERT INTO {$phpbbcfg['db_users']} "
 ."(`user_id`,`username`,`username_clean`,`user_password`,"
 ."`user_regdate`,`user_email`,`user_options`,`user_lang`,`user_timezone`,"
 ."`user_permissions`, `user_sig`, `user_occ`, `user_interests`) "
 ." VALUES({$edit['uid']},'{$edit['name']}','{$edit['name']}','"
 .md5($edit['pass']) ."',". time() .",'{$edit['mail']}','853','$language',$timezone, '', '', '', '')";
 $res = db_query($query) or die('Query failed: ' . db_error() . " \n" . $query . "\n");

It was missing certain entries in the table that were necessary (user_permissions, user_sig, user_occ and user_interests).

I have not tested how well the delete will work at this point but thats the next thing on my list.

Comments

What type of database are

Posted by arkepp on August 13, 2007 at 3:18pm

What type of database are you using?

The database should assume the default value for the fields not specified. Either way, you should probably specify NULL instead of '', it'll save phpBB a lot of work.

Maybe you are logged in as the Drupal admin user, which should not exist in phpBB?

database

Posted by SpectralDart on August 13, 2007 at 9:07pm

I'm using MYSQL database.. It looks like that the database doesn't assume any defaults and wants these values. I also looked in the phpbb3 code and they use '' (empty strings) instead of NULL.

No, I didnt logged as an admin. They were users I created after the merger of PHPBB and Drupal.. The standard deletion code doesn't work either.

But anyways, this type of implementation assumes that you don't do any user manipulation from phpbb otherwise, if you delete a user from phpbb with the phpbb admin, and then you try to delete that user from DRUPAL, an error message will occur.. Same with the creation. The code needs to be made more intelligent to deal with those issues.

Strange, maybe a diffference

Posted by arkepp on August 13, 2007 at 11:02pm

Strange, maybe a diffference between mysql or mysqli, I am not sure. I have been working off a clean install of phpBB 3 RC4.

Either way, if phpBB does it too then that's good enough for me. I'll include your patch, but I would be happy if someone confirmed the problem. There shouldn't be anything special about the three columns you have added?

I think you are running the code that partially implements user deletion, see http://groups.drupal.org/node/5439

It's a beta, I still change it to try new things. Download a new copy tomorrow.

About the change

Posted by SpectralDart on August 13, 2007 at 11:06pm

You might want to wait before including those changes. I've noticed that after creating an account from drupal, when I get in phpbb and try to find the created user to modify its permissions, it can't find the user. But I did a member listing with the admin and its there.. Something really strange is happening and I think it has to do with an incomplete creation of the phpbb account. We'll have to look in more details as to what phpbb3 is doing before we actually start putting junk in that might cause more harm than good.. Well, its a suggestion anyways.. We need to do more tests..

Is anyone else using MYSQL with DRUPAL 5.2 and PHPBB3 RC4?

dupe

Posted by arkepp on August 13, 2007 at 11:53pm

Hm, I have just re-tested

Posted by arkepp on August 13, 2007 at 11:52pm

Hm, I have just re-tested that part, I can find and modify users just fine throug the Users and Groups tab in the administration control panel.

I will remove the partially implemented deletion code, and leave the rest as is.

For the record, I am consistently using the mysqli library.

MYSQLI

Posted by SpectralDart on August 15, 2007 at 10:52pm

What is the benefit/difference of using mysqli instead of mysql? Speed? Would the "I" at the end stand for INTEGRATED which means you do not need a server running?

The i stands for "improved".

Posted by arkepp on August 16, 2007 at 6:53pm

The i stands for "improved". It's faster, but otherwise pretty much the same.

phpbb

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /