Posted by kiryoku on October 16, 2007 at 9:58pm
Anyone else who uses the node profile module?
I'm currently looking for a way of displaying my post count and other information from the phpbb_user database on my drupal profile...
In general I want to be able to update/sync some information from Drupal (user's account settings) to phpbb (Example: add a signature in Drupal so it's displayed in phpbb).
I haven't looked to deeply into the phpbb module yet, I'm not a skilled programmer, but anyway, if anyone comes up with a solution please share your ideas.
Thanks ;)
Categories: phpBB
Comments
Make sure you say you are
Make sure you say you are planning to use the pphBB 2.x module, since I think most people here are waiting for phpBB 3 and assume every topic is about that.
What confuses me is that the 2.x module already does both of the things you ask for.
Sorry, forgot to mention it,
Sorry, forgot to mention it, but yes, I'm using phpbb2x.
Anyway, the module shows the stuff when using the profiel.module shipped with drupal, but I'm using Node profile (http://drupal.org/project/nodeprofile)
in order to be able to display php and views on my users profile. I've been looking into your module, but I can't figure out how to print it on my profile...
The "phpbb" tab is missing to in the users "edit account" section.
Thanks for developing this module, it's great!
The phpBB tab is loaded
The phpBB tab is loaded from that SQL file, so it makes sense you don't have it. I don't know anything about nodeprofile, so I can only answer in general terms.
The way the phpBB 2.x module works is that when you hit save on your profile it loops through all the changed profile fields. If one of those fields matches the name of a column in the phpBB user table, then that data is filtered and copied to phpBB.
If you call the fields the same (look at the .module file) then you may be able to achieve the same effect. But I suspect you will have to get a bit down and dirty with the code.
Thanks for your information,
Thanks for your information, it confirms my wild guessing.. :)
Anyway, I'll have to get it working with node profile before I can go live and I'll take a closer look at the module.
As for now I've tried to create a new field called "user_from" and when I look into my database I can find it in my
the table called content_type_uprofile -> field_user_from_value.
I have no clue if or how it's possible to change the module so that it copied from this table instead of the "profile_fields" table,
but I'll try to figure out something...
If anyone has a clue please help, nodeprofile is useful and it would be really cool to get it working.
In general, it doesn'nt
In general, it doesn'nt actually copy it from the profile_fields table. It only does that if the user is unknown to phpBB.
What it normally does is use hook_user (implemented as phpbb_user() ), which is called every time a user is edited. When this function is called, it is passed an array with the changes that are being made, and the module checks whether any of those are relevant for phpBB.
If the node profile module offers such a hook, then you should implement one for the phpbb module. If it doesn't, you'll have to rely on something else, such as syncronize profiles ones an hour or when the user logs in. Alternatively (not recommended) you can hack the node profile module to also update phpbb.
(hooks are very central to Drupal, you should read up on this system if you haven't already)