Here's how I did it on mine..
// If we have a last post for this board we link to it
$lastpost = "";
if ($Poster) {
$append = "";
$Subject_full = $Subject;
if (strlen($Subject) > 26) {
$append = "...";
}
$Subject = substr($Subject,0,26);
$Subject .= $append;
if (!$Icon) { $Icon = "blank.gif"; }
$imagesize = $images['icons'];
$lastpost = "<img src="{$config['images']}/icons/$Icon" $imagesize $imagestyle alt="*" /> <a href="{$config['phpurl']}/$linker.php{$var_start}Cat{$var_eq}$Cat{$var_sep}Number{$var_eq}$lastnumber{$var_sep}Main{$var_eq}$lastmain{$var_extra}#Post$lastnumber" title="$Subject_full" alt="$Subject_full"> $Subject</a>";
$lastposter = "($Poster)";
}
else {
$lastposter = "";
}