mysql_select_db('DATABASE') or die("Could not select database 'DATABASE'\n");
That should do it basically it closes the other database connection telling it to connect to threads. My server will have my pages look like yours if I did not use that line. Make sure you typed the right database name for threads where I have DATABASE. It goes right before the closing ?> tag in ubbt_photopost.tmpl