well you could tie into index.php and a mysql_connect if it dies script. That way if it can't connect to the mysql database which means it will die something in index.php displays sorry but forums are down.
use something like
<?php
$link = mysql_connect("localhost", "mysql_user", "mysql_password") or die($cant_connect = 1);
mysql_close($link);
?>
then if $cant_connect == 1 you run error page.. and if it's not then you run ubbthreads