In the screenshot "Test1" is supposed to have "vBulletin" and "Test2" is supposed to have "Xen Web".
I'm not sure if this code snippet will suffice but I don't want to post all the code as it may be overwhelming.
PHP Code:
if($last_cat != $dlink['dlc_catid'])
{
$last_cat = $dlink['dlc_catid'];
eval('$custom_droplinks_cat .= "' . fetch_template('custom_droplinks_cat') . '";');
}
$custom_droplinks_bit .= "<tr><td class='vbmenu_option'>$img<a href='".$dlink['url']."' target='$new' title='".$dlink['alt']."'>".$dlink['name']."</a></td></tr>";
Edit: I think I may have to do two separate queries.