Firstly, if you including vB's global.php then there is no need to use mysql_query, use the builtin MySQL functions that coem with vB
PHP Code:
$threads = $DB_site->query("SELECT * FROM thread");
while($thread =$DB_site->fetch_array($threads)) {
$lastpost = vbdate($dateformat, $thread['lastpost']);
echo "$lastpost<br />";
}
If this code is in a function then make sure you have:
PHP Code:
global $DB_site, $timeformat, $dateformat;
Also note that if the page is outputing templates then the echo isn't likly to output anything to the browser.