Well you could always count how many forums there are using COUNT() and then add something like this $i++
Example:
PHP Code:
// Begin Forumlinks
$countforum=$DB_site->query("SELECT COUNT(*) AS total FROM forum WHERE active='1'");
$forumcount = $countforum['total'];
$forumlinksperms=$DB_site->query("SELECT forumid,title,parentid FROM forum WHERE active='1' ORDER BY displayorder");
$forumlink = "";
$i=0;
while ($forumlinksperm=$DB_site->fetch_array($forumlinksperms)) {
$i++;
$getperms=getpermissions($forumlinksperm[forumid]);
if ($getperms[canview]) {
if ($forumlinksperm[parentid]=='-1') {
$forumlink .= "<b>$forumlinksperm[title]</b> | ";
} elseif ($forumcount == $i) {
$forumlink .= "$forumlinksperm[title]";
} else {
$forumlink .= "$forumlinksperm[title] | ";
}
}
}
// End Forumlinks
It adds a extra query.. but this might work.