Oh, right. I should have thought that a user might have more than one vehicle. I'm not exactly an sql expert myself, but I don't know of any way to use a join to handle that situation. You'll probably have to add another query for each user to get their vehicle records.
At postbit_display_complete you could do something like:
Code:
global $vbulletin;
if ($vehicle = $vbulletin->db->query_first_slave("SELECT year, make, model FROM DTO_garage_vehicle WHERE userid = " . $post['userid']))
{
$post['year'] = $vehicle['year'];
$post['make'] = $vehicle['make'];
$post['model'] = $vehicle['model'];
}
or if you wanted to show all of a user's vehicles you could use query_read_slave() instead and have a while loop to get each vehicle, then maybe save an array and use a vb:each loop in the template.
Also I should mention that this adds an additional query for each post. I know people try to limit the number of queries being done to make their site run faster, but I don't know how much of an effect this would have. It probably depends a lot on how busy your site is and what kind of server you have. But if it's a problem you could probably do something like make a custom profile field with the info pre-formatted, and update it when the user changes their vehicle information. Then you would only need to use the profile field in the postbit (and it would already be available without any extra queries).
Edit: the code I posted above was orignially missing the "global" line.