Quote:
Originally Posted by powerbook
Would you mind in telling me what I should add/remove if I don't want the popup but instead taking you directly to the garage.
Thanks
|
Sure. This isn't supported out of the box so I put together some plugin code to support this. Just replace the contents of the
DTO Garage Postbit Pop-up Menu plugin with the code below, save, and you will have a single link in the postbit that will take you to that user's garage.
Note: The link won't be display if the user has no garage entry or the garage setting "Allow others to view this vehicle" is set to no.
PHP Code:
global $pm, $threadpm;
$show['dto_garage_has_vehicles'] = false;
$usepostid = false;
$doable = false;
// If this is a private message postbit draw then retrieve the userinfo of the user that the PM is from
if (THIS_SCRIPT == 'private') {
if ($_REQUEST['do']!= 'showhistory')
{
$userinfo = fetch_userinfo($pm['fromuserid']);
$doable = true;
}
}
else if ((THIS_SCRIPT == 'showpost' || THIS_SCRIPT == 'showthread') && $post['visible'] != 2)
{
$usepostid = true;
// Get the poster's userinfo
$userinfo = fetch_userinfo($post['userid']);
$doable = true;
}
if($doable && !empty($userinfo))
{
global $db;
$userID = $userinfo['userid'];
$vehicle = $db->query_first("SELECT * FROM " .
TABLE_PREFIX . "DTO_garage_vehicle WHERE userid = ". $userID . " AND display='1'");
$content = '';
if($vehicle)
{
$vehicle_id = $vehicle['vehicle_id'];
$content = "<a target=\"_dto\" href=\"dto_garage.php?do=viewvehicle&vehicle_id=$vehicle_id\">Garage</a>";
}
$template_hook[postbit_userinfo_right] .= $content;
}
Best regards,
Mark