What I would have done is make use of two different templates so you would have:
forumhome_ads:
Code:
<table border="0">
<tr>
<th>Title</th>
<th>Username</th>
</tr>
$adsbits
</table>
and
forumhome_ads_bits:
Code:
<tr>
<td>
<a href="vbfclassifieds.php?do=showad&adid=$row[id]">
$row[title]
</a>
</td>
<td>
<a href="/member.php?u=$row[userid]">
$row[username]
</a>
</td>
</tr>
Then your PHP:
PHP Code:
$result = $db->query_read("SELECT vbfclassifieds_ads.title, vbfclassifieds_ads.userid, vbfclassifieds_ads.id, user.userid, user.username FROM vbfclassifieds_ads LEFT JOIN user ON vbfclassifieds_ads.userid = user.userid LIMIT 5");
$adsbits = '';
while($row = $db->fetch_array($result))
{
eval('$adsbits .= "'. fetch_template('forumhome_ads_bits') .'";');
}
eval('$displaydata = "'. fetch_template('forumhome_ads') .'";');