This line:
eval("\$catlistbit .= \"".gettemplate('links_catbit')."\";");
is not on the right place. Try to do it first without templates and then implement it in the templates:
PHP Code:
$result = $DB_site->query("SELECT * FROM links_cat ORDER by catorder");
if ($row3 = $DB_site->num_rows($result)) {
while ($row=$DB_site->fetch_array($result)) {
$catid=$row["linkcatid"];
$catname=$row["catname"];
$catbyline=$row["catbyline"];
echo "<p>$catname $catbyline";
$result1 = $DB_site->query("SELECT * FROM links_content WHERE categoryid='$catid' ORDER BY name ASC ");
if ($row4 = $DB_site->num_rows($result1)) {
while ($row2=$DB_site->fetch_array($result1)) {
$name=$row2["name"];
$byline=$row2["byline"];
$content=$row2["content"];
echo "<br>$name $byline";
} // end if row3
} // end while row
} // end if row4
} // end while row2