PDA

View Full Version : Add info in postbit from another MySQL database


nomx
03-27-2007, 07:04 AM
I've looked through the forums a while (about 4 hours) and haven't found much to help me starting out.

Basically, I need to use information from the postbit ( $post['field7'] ) in the MySQL query to another database. What would be the best way about doing this?

I've seen quite a few threads that come close to what I'm looking for, but none of them had definitive answers. It will need a bit more php coding, so would I need to make a hook somewhere? I truely have no idea where to begin on this.

Marco van Herwaarden
03-27-2007, 07:09 AM
Please try to explain what exactly you want to do, as that will probably lead to the best answer.

nomx
03-27-2007, 07:44 AM
In the postbit_legacy template, I need to display a field from a database not belonging to vBulletin, however I need to use one of the variables from vBulletin as a part of the MySQL query to the other database.

Marco van Herwaarden
03-27-2007, 08:00 AM
You would need to create a plugin, probably best location would be the 'postbit_display_complete' hook location, and create PHP code to retrieve the information from the other database (using the $post['fieldXX'] variable).

Once retrieved, store the value in $post['mycustumdata'] and you wil be able to use that field in the postbit template.

nomx
03-27-2007, 05:46 PM
Alright, thanks for the direction, have it all working now!